New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 751406 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
NOT IN USE
Closed: Sep 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 2
Type: Bug-Regression



Sign in to add a comment

Input pseudo class matching not updated properly on input type change

Reported by bzbar...@mit.edu, Aug 2 2017

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:56.0) Gecko/20100101 Firefox/56.0

Steps to reproduce the problem:
1. Load the testcase.

What is the expected behavior?
Green text.

What went wrong?
Red text.

Did this work before? N/A 

Does this work in other browsers? No
 Firefox seems to have the same bug, but will fix it in https://bugzilla.mozilla.org/show_bug.cgi?id=1385478

Safari doesn't have this bug; this works correctly there.

Edge seems to apply :required to hidden inputs (incorrectly, as far as I can tell; 

Chrome version: 61.0.3163.25 (Official Build) dev (64-bit)  Channel: n/a
OS Version: OS X 10.12
Flash Version: Shockwave Flash 26.0 r0
 
bar.html
242 bytes View Download

Comment 1 by bzbar...@mit.edu, Aug 2 2017

Changes from hidden to not-hidden are broken too.  See second testcase.
baz.html
293 bytes View Download

Comment 2 by meade@chromium.org, Aug 3 2017

Labels: Needs-Bisect
Status: Untriaged (was: Unconfirmed)
Did this work before? I'm requesting a bisect to ensure that this is not a regression.
Cc: sandeepkumars@chromium.org
Labels: -Type-Bug -Pri-2 -Needs-Bisect M-62 hasbisect OS-Linux OS-Windows Pri-1 Type-Bug-Regression
Owner: r...@opera.com
Status: Assigned (was: Untriaged)
Able to reproduce the issue using #61.0.3163.25 on Mac 10.12.5, Linux Ubuntu 14.04, Win 10. Observed the text is in red color.

Below is the bisect info.
========================

Good Build: 50.0.2625.0
Bad Build: 50.0.2626.0

Unable to provide the per-revision-bisect info. Hence providing Chromium bisect.

You are probably looking for a change made after 370096 (known good), but no later than 370097 (first known bad).

CHANGELOG URL
==============

https://chromium.googlesource.com/chromium/src/+log/1b08ddc2f37a6463ee7edc3555cb5b1b4e0d71f9..95eaa0cbb6e9a7d348769a335ae702c1214769dc

rune@ - Could you please check whether this is caused with respect to your change, if not please help us in assigning it to the right owner.

Issue is seen M62 as well.

Thanks!!


Comment 4 by r...@opera.com, Aug 3 2017

Yes, that's plausible. The issue is that after we started using invalidation sets for more specific invalidations, we need to catch the various combinations of attributes which causes the evaluation of pseudo selectors to change. In this case, the evaluation of :required depends on the value of the type attribute. Looking at the code, there seems to be the simlilar issues for other pseudo selectors as well.

Labels: Update-Weekly

Comment 6 by r...@opera.com, Aug 4 2017

Status: Started (was: Assigned)
https://chromium-review.googlesource.com/c/602027
Project Member

Comment 7 by bugdroid1@chromium.org, Aug 7 2017

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

commit 64cae83473fce17e2d013ba1ca89d80b5e08c586
Author: Rune Lillesveen <rune@opera.com>
Date: Mon Aug 07 12:45:59 2017

Evaluation of :required and :optional changes on input type changes.

If an input element changes to or from hidden in the presence of a
"required" attribute, the evaluation of :required and :optional will
change. Schedule invalidation sets to update computed style
appropriately.

Bug:  751406 
Change-Id: I64ccaaa58067594e4a150f80fe73aaf4c9f93c83
Reviewed-on: https://chromium-review.googlesource.com/602027
Commit-Queue: Rune Lillesveen <rune@opera.com>
Reviewed-by: Kent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#492304}
[add] https://crrev.com/64cae83473fce17e2d013ba1ca89d80b5e08c586/third_party/WebKit/LayoutTests/external/wpt/html/semantics/selectors/pseudo-classes/required-optional-hidden.html
[modify] https://crrev.com/64cae83473fce17e2d013ba1ca89d80b5e08c586/third_party/WebKit/Source/core/html/HTMLInputElement.cpp

Comment 8 by r...@opera.com, Aug 7 2017

Status: Fixed (was: Started)

Comment 9 by bzbar...@mit.edu, Aug 7 2017

Does that patch just fix :required/:optional, or the various other broken pseudo-classes as well?  For example, :read-write matching is also broken; see attachment.
bar.html
277 bytes View Download

Comment 10 by bzbar...@mit.edu, Aug 7 2017

And :placeholder-shown is broken as well.  See attachment.

I can keep guessing which pseudo-classes you have depending on attributes, of course, but it seems like that would be better done by someone who knows the codebase better.
bar.html
302 bytes View Download

Comment 11 by r...@opera.com, Aug 7 2017

Status: Started (was: Fixed)
Right. I'll look into the other ones as well.

Comment 12 by r...@opera.com, Aug 7 2017

bzbarsky@: Firefox 54 does not update :placeholder-shown going from e.g. "submit" to "text", but does update the other way round. Known/fixed issue, or should I report? (could not find an existing one).

Comment 13 by bzbar...@mit.edu, Aug 8 2017

Known issue; it's tracked in https://bugzilla.mozilla.org/show_bug.cgi?id=1386530

I actually ran into this issue in Blink while writing testcases for that issue and testing how they behave in different browsers.  ;)

Comment 14 by r...@opera.com, Aug 8 2017

Summary: Input pseudo class matching not updated properly on input type change (was: :required matching not updated properly on input type change)
Project Member

Comment 15 by bugdroid1@chromium.org, Aug 9 2017

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

commit 622eab38a8f9300203cb505ad9adc7f027ca588e
Author: Rune Lillesveen <rune@opera.com>
Date: Wed Aug 09 10:28:19 2017

Apply :placeholder-shown and :read-write changes on input type change.

Whether :placeholder-shown, :read-only, and :read-write matches an html
input element depends on its type. Apply changes on type attribute
changes accordingly.

The placeholder text and visibility had to be updated sychronously,
otherwise the pseudo invalidation happens before the placeholder
visibility update as part of layout tree attachment.

Bug:  751406 
Change-Id: Ic5bf1c62073cdf2648dfbf7876828323fecfe4be
Reviewed-on: https://chromium-review.googlesource.com/605252
Commit-Queue: Rune Lillesveen <rune@opera.com>
Reviewed-by: Kent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#492935}
[add] https://crrev.com/622eab38a8f9300203cb505ad9adc7f027ca588e/third_party/WebKit/LayoutTests/external/wpt/html/semantics/selectors/pseudo-classes/placeholder-shown-type-change.html
[add] https://crrev.com/622eab38a8f9300203cb505ad9adc7f027ca588e/third_party/WebKit/LayoutTests/external/wpt/html/semantics/selectors/pseudo-classes/readwrite-readonly-type-change.html
[modify] https://crrev.com/622eab38a8f9300203cb505ad9adc7f027ca588e/third_party/WebKit/LayoutTests/external/wpt/html/semantics/selectors/pseudo-classes/required-optional-hidden.html
[modify] https://crrev.com/622eab38a8f9300203cb505ad9adc7f027ca588e/third_party/WebKit/Source/core/html/HTMLInputElement.cpp

Comment 16 by r...@opera.com, Aug 31 2017

Labels: -Pri-1 Pri-2
Found the same issue with :checked:

https://chromium-review.googlesource.com/c/chromium/src/+/645987

Project Member

Comment 17 by bugdroid1@chromium.org, Sep 1 2017

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

commit f2642047d7708f52fffb1eeae4cf06643ff7f687
Author: Rune Lillesveen <rune@opera.com>
Date: Fri Sep 01 09:19:48 2017

Update :checked style when input type changes.

The :checked pseudo class only matches for certain input types. We need
to schedule style invalidations for :checked when the input changes
between certain types.

Bug:  751406 
Change-Id: I818b498339a643766e0c619cb6b70bfd09c6efcb
Reviewed-on: https://chromium-review.googlesource.com/645987
Reviewed-by: Kent Tamura <tkent@chromium.org>
Commit-Queue: Rune Lillesveen <rune@opera.com>
Cr-Commit-Position: refs/heads/master@{#499156}
[add] https://crrev.com/f2642047d7708f52fffb1eeae4cf06643ff7f687/third_party/WebKit/LayoutTests/external/wpt/html/semantics/selectors/pseudo-classes/checked-type-change.html
[modify] https://crrev.com/f2642047d7708f52fffb1eeae4cf06643ff7f687/third_party/WebKit/Source/core/html/HTMLInputElement.cpp

Project Member

Comment 18 by bugdroid1@chromium.org, Sep 1 2017

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

commit f8eb347a09709d0ae8b84bf5f2dfffe670dec552
Author: Rune Lillesveen <rune@opera.com>
Date: Fri Sep 01 09:27:19 2017

Update :indeterminate style when input type changes.

The :indeterminate pseudo class only matches for certain input types.
We need to schedule style invalidations for :indeterminate when the
input changes between certain types.

Bug:  751406 
Change-Id: I4cae67ce883ec0969119f788718db8b978f9a67d
Reviewed-on: https://chromium-review.googlesource.com/646168
Reviewed-by: Kent Tamura <tkent@chromium.org>
Commit-Queue: Rune Lillesveen <rune@opera.com>
Cr-Commit-Position: refs/heads/master@{#499157}
[add] https://crrev.com/f8eb347a09709d0ae8b84bf5f2dfffe670dec552/third_party/WebKit/LayoutTests/external/wpt/html/semantics/selectors/pseudo-classes/indeterminate-type-change.html
[modify] https://crrev.com/f8eb347a09709d0ae8b84bf5f2dfffe670dec552/third_party/WebKit/Source/core/html/HTMLInputElement.cpp

Project Member

Comment 19 by bugdroid1@chromium.org, Sep 1 2017

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

commit d117e3d55b9d6adf2b6c125db61ee1ff6e7aa371
Author: Rune Lillesveen <rune@opera.com>
Date: Fri Sep 01 09:37:02 2017

Update :in-range/:out-of-range style when input type changes.

The :in-range/:out-of-range pseudo classes only matches for steppable
input typesi. We need to schedule style invalidations for these pseudo
classes when the input changes and at least one of them is steppable.
Changing between two steppable types may also need invalidation as
min/max/value need to be reparsed and their value may not be valid or
their interpretations may be different.

Bug:  751406 
Change-Id: I0dc6517ded832fdaa63f1a3bdda161dcf2b3b448
Reviewed-on: https://chromium-review.googlesource.com/646327
Reviewed-by: Kent Tamura <tkent@chromium.org>
Commit-Queue: Rune Lillesveen <rune@opera.com>
Cr-Commit-Position: refs/heads/master@{#499158}
[add] https://crrev.com/d117e3d55b9d6adf2b6c125db61ee1ff6e7aa371/third_party/WebKit/LayoutTests/external/wpt/html/semantics/selectors/pseudo-classes/inrange-outofrange-type-change.html
[modify] https://crrev.com/d117e3d55b9d6adf2b6c125db61ee1ff6e7aa371/third_party/WebKit/Source/core/html/HTMLInputElement.cpp

Comment 20 by r...@opera.com, Sep 1 2017

Status: Fixed (was: Started)
I've fixed the issues I've found now.

Sign in to add a comment