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

Issue 572043002: Support getComputedStyle for non-rendered pseudo elements. (Closed)

Created:
6 years, 3 months ago by rune
Modified:
6 years, 3 months ago
Reviewers:
esprehn
CC:
darktears, apavlov+blink_chromium.org, blink-reviews, blink-reviews-css, blink-reviews-dom_chromium.org, dglazkov+blink, eae+blinkwatch, ed+blinkwatch_opera.com, rwlbuis, rune+blink, sof
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Project:
blink
Visibility:
Public.

Description

Support getComputedStyle for non-rendered pseudo elements. Computed style for pseudo elements exist and is defined by [1] regardless of whether the pseudo element, or its ancestor, is rendered or not [2]. We make sure that the computed pseudo element style hangs off of the RenderStyle of the ancestor, or the computed style in the ancestor's rare-data if the ancestor is not rendered. getCachedPseudoStyle, getUncachedPseudoStyle, and pseudoStyleForElement are all written to not return anything if the pseudo element is not rendered. That is the reason for calling pseudoStyleForElement in a special mode at the end of Element::computedStyle to force creating and adding the pseudo style to the cache. This CL does not try to support computed style for pseudo elements which are not in the document. [1] http://dev.w3.org/csswg/cssom/#dom-window-getcomputedstyle [2] http://dev.w3.org/csswg/cssom/#::after-pseudo-element R=esprehn@chromium.org BUG=414088 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=182203

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+107 lines, -26 lines) Patch
A LayoutTests/fast/css/getComputedStyle/getComputedStyle-with-before-element.html View 1 chunk +39 lines, -0 lines 0 comments Download
A LayoutTests/fast/css/getComputedStyle/getComputedStyle-with-before-element-expected.txt View 1 chunk +21 lines, -0 lines 0 comments Download
M LayoutTests/fast/css/getComputedStyle/getComputedStyle-with-pseudo-element.html View 1 chunk +4 lines, -4 lines 0 comments Download
M LayoutTests/fast/css/getComputedStyle/getComputedStyle-with-pseudo-element-expected.txt View 1 chunk +4 lines, -4 lines 0 comments Download
M Source/core/css/PseudoStyleRequest.h View 2 chunks +13 lines, -0 lines 0 comments Download
M Source/core/css/resolver/StyleResolver.cpp View 3 chunks +6 lines, -4 lines 2 comments Download
M Source/core/dom/Element.cpp View 1 chunk +20 lines, -14 lines 0 comments Download

Messages

Total messages: 9 (1 generated)
rune
6 years, 3 months ago (2014-09-15 21:12:06 UTC) #1
rune
PTAL
6 years, 3 months ago (2014-09-17 18:51:10 UTC) #2
esprehn
https://codereview.chromium.org/572043002/diff/1/Source/core/css/resolver/StyleResolver.cpp File Source/core/css/resolver/StyleResolver.cpp (right): https://codereview.chromium.org/572043002/diff/1/Source/core/css/resolver/StyleResolver.cpp#newcode831 Source/core/css/resolver/StyleResolver.cpp:831: if (pseudoStyleRequest.type == PseudoStyleRequest::ForRenderer) This doesn't make sense, pseudoStyleForElementInternal ...
6 years, 3 months ago (2014-09-17 19:04:42 UTC) #3
rune
https://codereview.chromium.org/572043002/diff/1/Source/core/css/resolver/StyleResolver.cpp File Source/core/css/resolver/StyleResolver.cpp (right): https://codereview.chromium.org/572043002/diff/1/Source/core/css/resolver/StyleResolver.cpp#newcode831 Source/core/css/resolver/StyleResolver.cpp:831: if (pseudoStyleRequest.type == PseudoStyleRequest::ForRenderer) On 2014/09/17 at 19:04:42, esprehn ...
6 years, 3 months ago (2014-09-17 20:00:33 UTC) #4
esprehn
lgtm, okay. Are you sure it's okay to add this cached style and not set ...
6 years, 3 months ago (2014-09-17 21:06:53 UTC) #5
rune
On 2014/09/17 at 21:06:53, esprehn wrote: > lgtm, okay. Are you sure it's okay to ...
6 years, 3 months ago (2014-09-17 22:20:01 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patchset/572043002/1
6 years, 3 months ago (2014-09-17 22:20:35 UTC) #8
commit-bot: I haz the power
6 years, 3 months ago (2014-09-18 00:02:20 UTC) #9
Message was sent while issue was closed.
Committed patchset #1 (id:1) as 182203

Powered by Google App Engine
This is Rietveld 408576698