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

Issue 2272683002: Consider pseudo classes as matching for shared style rejection. (Closed)

Created:
4 years, 4 months ago by rune
Modified:
4 years, 3 months ago
Reviewers:
meade_UTC10
CC:
chromium-reviews, blink-reviews-style_chromium.org, blink-reviews-css, dglazkov+blink, apavlov+blink_chromium.org, darktears, blink-reviews, rwlbuis
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Consider pseudo classes as matching for shared style rejection. The user action pseudo classes rely on affectedBy bits to be correctly set on ComputedStyle in order to recalculate style for such changes later on. If two elements may otherwise share style, but will have the affectedBy bits set differently, they may not share style. Example: <style>[attr]:hover {}</style> <div></div> <div attr></div> The second div may share style with the first one when none of them is hovered. However, matching the selector against the first div will fail on the attribute selector before we try to match :hover, hence the flag for affectedByHover will not be set. If we share that ComputedStyle object with the second div, hovering the second div later will have no effect. Instead we always match :hover/:active/:focus/:-webkit-drag when matching rules for style sharing (attribute and sibling rules). That will lead to the attribute selector in the example above to match which will cause style sharing to be rejected for the second div. R=meade@chromium.org BUG=639561 Committed: https://crrev.com/b2aee8879058a6a85104073c38868e4edd66b628 Cr-Commit-Position: refs/heads/master@{#414221}

Patch Set 1 #

Patch Set 2 : Needed one more CORE_EXPORT #

Patch Set 3 : Handle negated selectors #

Unified diffs Side-by-side diffs Delta from patch set Stats (+227 lines, -6 lines) Patch
M third_party/WebKit/Source/core/core.gypi View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/css/CSSSelector.h View 1 2 2 chunks +9 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/css/SelectorChecker.cpp View 1 2 5 chunks +22 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/css/resolver/ElementResolveContext.h View 1 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/css/resolver/SharedStyleFinder.h View 2 chunks +3 lines, -1 line 0 comments Download
A third_party/WebKit/Source/core/css/resolver/SharedStyleFinderTest.cpp View 1 2 1 chunk +191 lines, -0 lines 0 comments Download

Messages

Total messages: 17 (10 generated)
rune
ptal
4 years, 4 months ago (2016-08-23 14:56:52 UTC) #3
rune
On 2016/08/23 14:56:52, rune wrote: > ptal I'm afraid this won't work correctly for negated ...
4 years, 4 months ago (2016-08-23 17:18:02 UTC) #6
rune
On 2016/08/23 17:18:02, rune wrote: > On 2016/08/23 14:56:52, rune wrote: > > ptal > ...
4 years, 4 months ago (2016-08-24 11:23:41 UTC) #9
meade_UTC10
lgtm
4 years, 3 months ago (2016-08-25 00:24:57 UTC) #12
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/2272683002/40001
4 years, 3 months ago (2016-08-25 00:27:13 UTC) #14
commit-bot: I haz the power
Committed patchset #3 (id:40001)
4 years, 3 months ago (2016-08-25 00:34:18 UTC) #15
commit-bot: I haz the power
4 years, 3 months ago (2016-08-25 00:35:55 UTC) #17
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/b2aee8879058a6a85104073c38868e4edd66b628
Cr-Commit-Position: refs/heads/master@{#414221}

Powered by Google App Engine
This is Rietveld 408576698