DescriptionAvoid unnecessary style recalc for subtree of focused element.
Updating the styles for an element that changes its focus state only needs to
force a recalc of the subtree if the subtree contains an element that could
match a selector which contains a :focus pseudo class left of a child or
descendant combinator. At the same time, that :focus pseudo must match the
element we are updating focus state for. This is indicated by the return value
of Element::childrenAffectedByFocus.
This change does a LocalStyleChange when updating the focus state of an
element which returns false for childrenAffectedByFocus, and
SubtreeStyleChange otherwise.
BUG=315923
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=166517
Patch Set 1 #Patch Set 2 : Added unit test. #Patch Set 3 : Added layout tests to count recalcStyles using the inspector. #Patch Set 4 : --no-find-copies #Patch Set 5 : Fixed contenteditable shadow dom regression. #
Total comments: 5
Patch Set 6 : Rebased onto master #Patch Set 7 : Bleh. --no-find-copies. #Patch Set 8 : Reverted shadow dom fix. #Patch Set 9 : Simplified the code. #Patch Set 10 : Corrected copyright/license. #Patch Set 11 : Translated timeline tests into unit tests. #Patch Set 12 : Corrected comments in tests. #
Total comments: 2
Patch Set 13 : Rebased #Patch Set 14 : Typos in unit-test code. #Patch Set 15 : Fixed Clang linking problem. #
Messages
Total messages: 36 (0 generated)
|