New issue
Advanced search Search tips

Issue 622679 link

Starred by 5 users

Issue metadata

Status: Fixed
Owner: ----
Closed: Feb 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug

Blocking:
issue 662005



Sign in to add a comment

Do not throw when getting selectionDirection/selectionStart/selectionEnd on input

Reported by sim...@opera.com, Jun 23 2016

Issue description

See https://github.com/whatwg/html/pull/1006

var input = document.createElement('input');
input.type = 'checkbox';
input.selectionDirection; // should return null
input.selectionStart; // should return null
input.selectionEnd; // should return null
 

Comment 1 by tkent@chromium.org, Jun 23 2016

Components: -Blink>DOM
Status: Available (was: Untriaged)
Needs intent-to-ship.

Project Member

Comment 2 by bugdroid1@chromium.org, Aug 24 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e6905fe7256d51d02a0cd778fd3c34611b88e413

commit e6905fe7256d51d02a0cd778fd3c34611b88e413
Author: Kent Tamura <tkent@chromium.org>
Date: Wed Aug 24 06:01:16 2016

Add UseCounter to count InvalidStateError by input.selectionStart, selectionEnd, and selectionDirection getters.

We'd like to remove this InvalidStateError.

BUG= 622679 
R=isherman@chromium.org, kojii@chromium.org

Review URL: https://codereview.chromium.org/2272913002 .

Cr-Commit-Position: refs/heads/master@{#413991}

[modify] https://crrev.com/e6905fe7256d51d02a0cd778fd3c34611b88e413/third_party/WebKit/Source/core/frame/UseCounter.h
[modify] https://crrev.com/e6905fe7256d51d02a0cd778fd3c34611b88e413/third_party/WebKit/Source/core/html/HTMLInputElement.cpp
[modify] https://crrev.com/e6905fe7256d51d02a0cd778fd3c34611b88e413/tools/metrics/histograms/histograms.xml

Comment 3 by tkent@chromium.org, Aug 24 2016

The counter will be available in Google Chrome 54.

Comment 5 by tkent@chromium.org, Nov 22 2016

Labels: Needs-BlinkIntent

Comment 6 by foolip@chromium.org, Dec 14 2016

Blocking: 662005

Comment 7 by foolip@chromium.org, Dec 14 2016

Use counter is at roughly 0.002%. It looks like Firefox has already shipped this behavior, so the risk should be low enough.

Comment 9 by tkent@chromium.org, Feb 17 2017

Labels: -Needs-BlinkIntent Hotlist-Interop Hotlist-GoodFirstBug
The intent was approved.

Comment 10 by ratsu...@gmail.com, Feb 18 2017

Hi tkent@,

Should I touch the histograms.xml and UseCounter.h to remove the metric item since it won't be anymore?

Thanks

Comment 11 by tkent@chromium.org, Feb 20 2017

> Should I touch the histograms.xml and UseCounter.h to remove the metric item since it won't be anymore?

Yes.
UseCounter.h: Remove the unused enum item.
histograms.xml: Add OBSOLETE_ prefix to the enum item.

Project Member

Comment 12 by bugdroid1@chromium.org, Feb 22 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/fa9836f9a52257a725282c2d12f9a4d213cd0109

commit fa9836f9a52257a725282c2d12f9a4d213cd0109
Author: ratsunny <ratsunny@gmail.com>
Date: Wed Feb 22 08:21:14 2017

Don't throw when getting selection(Direction|Start|End) on input

Return null instead of throwing |InvalidStateError| for visiting
|selectionDirection|, |selectionStart| and |selectionEnd| on |input|
which does not apply selection API.

Firefox has the similar behavior.

Spec: https://html.spec.whatwg.org/multipage/forms.html#dom-textarea/input-selectionstart

This change fix 25 fails in layout tests.

BUG= 622679 

Review-Url: https://codereview.chromium.org/2706033004
Cr-Commit-Position: refs/heads/master@{#451926}

[modify] https://crrev.com/fa9836f9a52257a725282c2d12f9a4d213cd0109/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/textfieldselection/selection-not-application.html
[delete] https://crrev.com/cf490d43d2b0e49ff06958cba34c502db192717d/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/the-input-element/selection-expected.txt
[modify] https://crrev.com/fa9836f9a52257a725282c2d12f9a4d213cd0109/third_party/WebKit/LayoutTests/fast/forms/selection-functions-expected.txt
[modify] https://crrev.com/fa9836f9a52257a725282c2d12f9a4d213cd0109/third_party/WebKit/LayoutTests/fast/forms/selection-functions.html
[modify] https://crrev.com/fa9836f9a52257a725282c2d12f9a4d213cd0109/third_party/WebKit/LayoutTests/fast/forms/selection-wrongtype-expected.txt
[modify] https://crrev.com/fa9836f9a52257a725282c2d12f9a4d213cd0109/third_party/WebKit/LayoutTests/fast/forms/selection-wrongtype.html
[modify] https://crrev.com/fa9836f9a52257a725282c2d12f9a4d213cd0109/third_party/WebKit/Source/core/frame/UseCounter.h
[modify] https://crrev.com/fa9836f9a52257a725282c2d12f9a4d213cd0109/third_party/WebKit/Source/core/html/HTMLInputElement.cpp
[modify] https://crrev.com/fa9836f9a52257a725282c2d12f9a4d213cd0109/third_party/WebKit/Source/core/html/HTMLInputElement.h
[modify] https://crrev.com/fa9836f9a52257a725282c2d12f9a4d213cd0109/third_party/WebKit/Source/core/html/HTMLInputElement.idl
[modify] https://crrev.com/fa9836f9a52257a725282c2d12f9a4d213cd0109/tools/metrics/histograms/histograms.xml

Comment 13 by tkent@chromium.org, Feb 22 2017

Labels: M-58
Status: Fixed (was: Available)

Sign in to add a comment