Project: chromium Issues People Development process History Sign in
New issue
Advanced search Search tips
Starred by 4 users
Status: Fixed
Owner:
Closed: Jun 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug



Sign in to add a comment
:in-range & :out-of-range CSS pseudo-classes shouldn't match inputs without range limitations
Reported by cvreb...@gmail.com, Apr 13 2016 Back to list
UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.112 Safari/537.36

Steps to reproduce the problem:
1. Open the attached testcase in Chrome.
2. Observe the background-colors and borders of the <input>s

What is the expected behavior?
The inputs should have neither a red border nor a red background-color,
because they don't have range limitations ( https://html.spec.whatwg.org/multipage/forms.html#have-range-limitations ),
because they have neither `min` nor `max` attributes
and the HTML spec doesn't define a default minimum or maximum for any of these input types.
Therefore, these inputs should fail the 2nd of the 3 conditions required to match :in-range or :out-of-range .

Per https://html.spec.whatwg.org/multipage/scripting.html#selector-in-range
> The :in-range pseudo-class must match all elements that are [...], have range limitations, and [...]

What went wrong?
The inputs have red borders and/or red backgrounds, indicating that they matched the :in-range or :out-of-range pseudo-classes despite not having range limitations

Did this work before? N/A 

Chrome version: 52.0.2707.0  Channel: canary
OS Version: OS X 10.11.4
Flash Version: Shockwave Flash 21.0 r0
 
testcase.html
674 bytes View Download
Labels: Needs-Bisect OS-Windows
Comment 2 by r...@opera.com, Apr 13 2016
Components: Blink>Forms
Status: Available
Comment 3 by tkent@chromium.org, Apr 13 2016
Labels: -OS-Windows -Needs-Bisect -OS-Mac Hotlist-Interop OS-All
Comment 5 by tkent@chromium.org, Jun 3 2016
Owner: tkent@chromium.org
Status: Started
Project Member Comment 6 by bugdroid1@chromium.org, Jun 3 2016
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a543e0c81913215edafb3337ec88c815ddde8c35

commit a543e0c81913215edafb3337ec88c815ddde8c35
Author: tkent <tkent@chromium.org>
Date: Fri Jun 03 07:52:38 2016

:in-range and :out-of-range CSS selectors should check 'have range limitations.'

Spec.: https://html.spec.whatwg.org/multipage/scripting.html#selector-in-range

These CSS selectors should work only if |min| or |max| attribute has a valid value
except for input[type=range] which has default minimum/maximum values.

BUG= 603268 

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

[delete] https://crrev.com/75f4d6a92c6e94eb090ee44f181dbff933cca359/third_party/WebKit/LayoutTests/imported/wpt/html/semantics/selectors/pseudo-classes/inrange-outofrange-expected.txt
[modify] https://crrev.com/a543e0c81913215edafb3337ec88c815ddde8c35/third_party/WebKit/Source/core/html/forms/InputType.cpp
[modify] https://crrev.com/a543e0c81913215edafb3337ec88c815ddde8c35/third_party/WebKit/Source/core/html/forms/RangeInputType.cpp
[modify] https://crrev.com/a543e0c81913215edafb3337ec88c815ddde8c35/third_party/WebKit/Source/core/html/forms/StepRange.cpp
[modify] https://crrev.com/a543e0c81913215edafb3337ec88c815ddde8c35/third_party/WebKit/Source/core/html/forms/StepRange.h
[modify] https://crrev.com/a543e0c81913215edafb3337ec88c815ddde8c35/third_party/WebKit/Source/core/html/forms/StepRangeTest.cpp

Comment 7 by tkent@chromium.org, Jun 6 2016
Labels: M-53
Status: Fixed
Sign in to add a comment