DescriptionCall getUncachedPseudoStyle on correct node for ::selection.
getUncachedSelectionStyle is typically called for the LayoutObject we
are currently painting. This might not be the node the ::selection
style is matched for. Specifically, we request getUncachedSelectionStyle
on LayoutText objects, but we need to match the ::selection style on its
parent element.
This already happened inside getUncachedPseudoStyle, but it's guarded by
a hasPseudoStyle() call for the pseudo element type. In the case where
we pass in a LayoutText, we are relying on the computed style with the
PseudoIdSelection bit set to be propagated down to the LayoutText object.
That does not happen if the style change for the element parent is
NoChange or NoInherit.
Instead find the element for which we are matching ::selection in
getUncachedSelectionStyle instead. The firstAncestorOrSelf() call is
still present in getUncachedPseudoStyle as there may be other pseudo
elements types where we rely on this.
R=mstensho@opera.com
BUG=685174
Review-Url: https://codereview.chromium.org/2727253004
Cr-Commit-Position: refs/heads/master@{#454575}
Committed: https://chromium.googlesource.com/chromium/src/+/aac53af022b711ae7d4db563221a06be9f070e82
Patch Set 1 #
Total comments: 4
Patch Set 2 : Documentation fixes. #
Depends on Patchset: Messages
Total messages: 11 (6 generated)
|