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

Issue 300693004: DevTools: matched styles respect :visited/:link pseudo classes (Closed)

Created:
6 years, 7 months ago by lushnikov
Modified:
6 years, 6 months ago
Reviewers:
apavlov
CC:
blink-reviews, caseq+blink_chromium.org, loislo+blink_chromium.org, eustas+blink_chromium.org, malch+blink_chromium.org, yurys+blink_chromium.org, lushnikov+blink_chromium.org, vsevik+blink_chromium.org, pfeldman+blink_chromium.org, paulirish+reviews_chromium.org, apavlov+blink_chromium.org, devtools-reviews_chromium.org, sergeyv+blink_chromium.org, aandrey+blink_chromium.org
Visibility:
Public.

Description

DevTools: matched styles respect :visited/:link pseudo classes Method StyleResolver::pseudoCSSRulesForElement is used from both WebPlatform (via window.getMatchedCSSRules) and inspector in its styles sidebar pane. Due to security reasons, this method "lies" about css rules applied for visited and unvisited links so that it is impossible to sniff user history. This patch makes inspector to adjust method results so that it knows which rules are actually applied and which are not. FYI: The previous version of this patch is https://codereview.chromium.org/228673002/ It was reverted due to regression of :host rules, thus this patch adds a test to verify them. BUG=356999 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=174963

Patch Set 1 #

Total comments: 1

Patch Set 2 : address @apavlov comments #

Patch Set 3 : correct matching for shadow rules #

Total comments: 4

Patch Set 4 : address comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+269 lines, -16 lines) Patch
M LayoutTests/inspector-protocol/css/css-protocol-test.js View 2 chunks +12 lines, -7 lines 0 comments Download
A LayoutTests/inspector-protocol/css/css-shadow-host-rule.html View 1 chunk +40 lines, -0 lines 0 comments Download
A LayoutTests/inspector-protocol/css/css-shadow-host-rule-expected.txt View 1 chunk +5 lines, -0 lines 0 comments Download
A LayoutTests/inspector-protocol/css/css-visited-link-matched-styles.html View 1 chunk +121 lines, -0 lines 0 comments Download
A LayoutTests/inspector-protocol/css/css-visited-link-matched-styles-expected.txt View 1 chunk +34 lines, -0 lines 0 comments Download
M Source/core/inspector/InspectorCSSAgent.h View 1 chunk +2 lines, -1 line 0 comments Download
M Source/core/inspector/InspectorCSSAgent.cpp View 1 2 3 7 chunks +55 lines, -8 lines 0 comments Download

Messages

Total messages: 13 (0 generated)
lushnikov
please take a look
6 years, 7 months ago (2014-05-26 13:59:04 UTC) #1
apavlov
lgtm with nits "this test adds" -> "this patch adds" in the description https://codereview.chromium.org/300693004/diff/1/Source/core/inspector/InspectorCSSAgent.cpp File ...
6 years, 7 months ago (2014-05-26 14:03:40 UTC) #2
lushnikov
The CQ bit was checked by lushnikov@chromium.org
6 years, 7 months ago (2014-05-26 15:06:13 UTC) #3
lushnikov
Thanks!
6 years, 7 months ago (2014-05-26 15:06:22 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/lushnikov@chromium.org/300693004/20001
6 years, 7 months ago (2014-05-26 15:06:39 UTC) #5
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). Please consider checking whether the failures are ...
6 years, 7 months ago (2014-05-26 16:32:19 UTC) #6
lushnikov
The CQ bit was unchecked by lushnikov@chromium.org
6 years, 7 months ago (2014-05-26 16:53:23 UTC) #7
lushnikov
@apavlov, please take another look - previous patch was incorrect =/
6 years, 7 months ago (2014-05-27 17:07:30 UTC) #8
apavlov
lgtm with comments https://codereview.chromium.org/300693004/diff/40001/Source/core/inspector/InspectorCSSAgent.cpp File Source/core/inspector/InspectorCSSAgent.cpp (right): https://codereview.chromium.org/300693004/diff/40001/Source/core/inspector/InspectorCSSAgent.cpp#newcode1287 Source/core/inspector/InspectorCSSAgent.cpp:1287: SelectorChecker::SelectorCheckingContext shadowDomContext(selector, &element, SelectorChecker::VisitedMatchEnabled); shadowDOMContext, to ...
6 years, 7 months ago (2014-05-28 09:17:09 UTC) #9
lushnikov
Great, thanks! https://codereview.chromium.org/300693004/diff/40001/Source/core/inspector/InspectorCSSAgent.cpp File Source/core/inspector/InspectorCSSAgent.cpp (right): https://codereview.chromium.org/300693004/diff/40001/Source/core/inspector/InspectorCSSAgent.cpp#newcode1287 Source/core/inspector/InspectorCSSAgent.cpp:1287: SelectorChecker::SelectorCheckingContext shadowDomContext(selector, &element, SelectorChecker::VisitedMatchEnabled); On 2014/05/28 09:17:09, ...
6 years, 6 months ago (2014-05-28 10:59:02 UTC) #10
lushnikov
The CQ bit was checked by lushnikov@chromium.org
6 years, 6 months ago (2014-05-28 10:59:06 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/lushnikov@chromium.org/300693004/50001
6 years, 6 months ago (2014-05-28 10:59:30 UTC) #12
commit-bot: I haz the power
6 years, 6 months ago (2014-05-28 12:14:37 UTC) #13
Message was sent while issue was closed.
Change committed as 174963

Powered by Google App Engine
This is Rietveld 408576698