:focus rule in the UA sheet is put into the universal ruleset |
||||
Issue descriptionIt 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
,
May 15 2017
,
May 29 2017
https://chromium-review.googlesource.com/c/517789/
,
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
,
May 30 2017
|
||||
►
Sign in to add a comment |
||||
Comment 1 by ericwilligers@chromium.org
, May 12 2017Labels: -Pri-3 Pri-2
Status: Available (was: Untriaged)