Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(29)

Issue 2727253004: Call getUncachedPseudoStyle on correct node for ::selection. (Closed)

Created:
3 years, 9 months ago by rune
Modified:
3 years, 9 months ago
CC:
chromium-reviews, szager+layoutwatch_chromium.org, zoltan1, blink-reviews-layout_chromium.org, pdr+renderingwatchlist_chromium.org, eae+blinkwatch, leviw+renderwatch, jchaffraix+rendering, blink-reviews
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Call 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. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+33 lines, -18 lines) Patch
M third_party/WebKit/LayoutTests/paint/invalidation/selection/selection-repaint.html View 1 chunk +8 lines, -7 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutObject.h View 1 chunk +3 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutObject.cpp View 1 4 chunks +22 lines, -7 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 11 (6 generated)
rune
ptal
3 years, 9 months ago (2017-03-03 10:58:35 UTC) #3
mstensho (USE GERRIT)
lgtm https://codereview.chromium.org/2727253004/diff/1/third_party/WebKit/Source/core/layout/LayoutObject.cpp File third_party/WebKit/Source/core/layout/LayoutObject.cpp (right): https://codereview.chromium.org/2727253004/diff/1/third_party/WebKit/Source/core/layout/LayoutObject.cpp#newcode3075 third_party/WebKit/Source/core/layout/LayoutObject.cpp:3075: // we use calculate ::selection style on the ...
3 years, 9 months ago (2017-03-03 12:06:35 UTC) #4
rune
https://codereview.chromium.org/2727253004/diff/1/third_party/WebKit/Source/core/layout/LayoutObject.cpp File third_party/WebKit/Source/core/layout/LayoutObject.cpp (right): https://codereview.chromium.org/2727253004/diff/1/third_party/WebKit/Source/core/layout/LayoutObject.cpp#newcode3075 third_party/WebKit/Source/core/layout/LayoutObject.cpp:3075: // we use calculate ::selection style on the shadow ...
3 years, 9 months ago (2017-03-03 12:13:57 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2727253004/20001
3 years, 9 months ago (2017-03-03 12:14:16 UTC) #8
commit-bot: I haz the power
3 years, 9 months ago (2017-03-03 13:56:06 UTC) #11
Message was sent while issue was closed.
Committed patchset #2 (id:20001) as
https://chromium.googlesource.com/chromium/src/+/aac53af022b711ae7d4db563221a...

Powered by Google App Engine
This is Rietveld 408576698