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

Issue 721514 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
NOT IN USE
Closed: May 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug



Sign in to add a comment

:focus rule in the UA sheet is put into the universal ruleset

Project Member Reported by esprehn@chromium.org, May 11 2017

Issue description

It seems there's a tag specifier (*) appended to unqualified pseudos in the UA sheet, which then defeats the :focus rule optimization so we end up matching it for every element in the entire document.

Instead it should be put into the focus rule set which has special handling:
https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/css/ElementRuleCollector.cpp?rcl=dbffa1f17ed75a9376cafd7ff7c76206222771e6&l=238

In general we should probably fix the rule sets to put things like [attr]:focus into the focus ruleset instead of into the universal one.

This was my attempt:
https://codereview.chromium.org/2873123002

 
Cc: ericwilligers@chromium.org
Labels: -Pri-3 Pri-2
Status: Available (was: Untriaged)

Comment 2 by nainar@chromium.org, May 15 2017

Labels: Update-Quarterly

Comment 3 by r...@opera.com, May 29 2017

Cc: -r...@opera.com
Owner: r...@opera.com
Status: Started (was: Available)
https://chromium-review.googlesource.com/c/517789/
Project Member

Comment 4 by bugdroid1@chromium.org, May 30 2017

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

commit 68ea12e6c3607618bbefcc42c79a43a170787646
Author: Rune Lillesveen <rune@opera.com>
Date: Tue May 30 20:09:14 2017

Put unqualified pseudos into the more specific rulesets.

We were incorrectly putting unqualified pseudo classes for :focus,
:visited, :-webkit-any-link and :link into the universal RuleSet which
meant we would match them for every element defeating the optimization
of having the separate rulesets.

This patch starts tracking the pseudos inside the extraction step to
make sure we put them into the right ruleset. It also adds some asserts
that the default UA sheet never adds any universal rules.

This removes one rule (:focus) from the set of rules for every element.

Bug:  721514 
Change-Id: I4208e1c8c938aa0af7a736594f3c0059b6b28fcc
Reviewed-on: https://chromium-review.googlesource.com/517789
Commit-Queue: Rune Lillesveen <rune@opera.com>
Reviewed-by: Naina Raisinghani <nainar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#475642}
[modify] https://crrev.com/68ea12e6c3607618bbefcc42c79a43a170787646/third_party/WebKit/Source/core/css/AffectedByPseudoTest.cpp
[modify] https://crrev.com/68ea12e6c3607618bbefcc42c79a43a170787646/third_party/WebKit/Source/core/css/CSSDefaultStyleSheets.cpp
[modify] https://crrev.com/68ea12e6c3607618bbefcc42c79a43a170787646/third_party/WebKit/Source/core/css/ComputedStyleExtraFields.json5
[modify] https://crrev.com/68ea12e6c3607618bbefcc42c79a43a170787646/third_party/WebKit/Source/core/css/RuleSet.cpp
[modify] https://crrev.com/68ea12e6c3607618bbefcc42c79a43a170787646/third_party/WebKit/Source/core/css/RuleSetTest.cpp
[modify] https://crrev.com/68ea12e6c3607618bbefcc42c79a43a170787646/third_party/WebKit/Source/core/css/SelectorChecker.cpp
[modify] https://crrev.com/68ea12e6c3607618bbefcc42c79a43a170787646/third_party/WebKit/Source/core/css/resolver/SharedStyleFinderTest.cpp
[modify] https://crrev.com/68ea12e6c3607618bbefcc42c79a43a170787646/third_party/WebKit/Source/core/dom/ContainerNode.cpp

Comment 5 by r...@opera.com, May 30 2017

Status: Fixed (was: Started)

Sign in to add a comment