RESOLVED FIXED 179812
Incorrect computed style in pseudo-elements with display: contents
https://bugs.webkit.org/show_bug.cgi?id=179812
Summary Incorrect computed style in pseudo-elements with display: contents
Emilio Cobos Álvarez (:emilio)
Reported 2017-11-16 21:57:55 PST
Bug 178513 gave them an anon renderer as the main renderer. Unfortunately, the style of that box is exposed via getComputedStyle, so that needs to be handled somehow.
Attachments
Patch (11.37 KB, patch)
2017-11-16 22:14 PST, Emilio Cobos Álvarez (:emilio)
no flags
Archive of layout-test-results from ews105 for mac-elcapitan-wk2 (2.56 MB, application/zip)
2017-11-17 00:02 PST, EWS Watchlist
no flags
Patch (9.88 KB, patch)
2017-11-17 11:11 PST, Emilio Cobos Álvarez (:emilio)
no flags
Patch for landing (9.87 KB, patch)
2017-11-20 03:59 PST, Emilio Cobos Álvarez (:emilio)
no flags
Emilio Cobos Álvarez (:emilio)
Comment 1 2017-11-16 22:14:06 PST
EWS Watchlist
Comment 2 2017-11-17 00:02:49 PST
Comment on attachment 327151 [details] Patch Attachment 327151 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.webkit.org/results/5270189 New failing tests: http/tests/appcache/resource-redirect-2.html
EWS Watchlist
Comment 3 2017-11-17 00:02:50 PST
Created attachment 327152 [details] Archive of layout-test-results from ews105 for mac-elcapitan-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews105 Port: mac-elcapitan-wk2 Platform: Mac OS X 10.11.6
Emilio Cobos Álvarez (:emilio)
Comment 4 2017-11-17 05:12:08 PST
Those look flaky and completely unrelated to this. Antti or Ryosuke, mind reviewing? Thanks! Please don't land this directly yet, I'll ensure the test change is upstreamed first.
Antti Koivisto
Comment 5 2017-11-17 07:12:37 PST
Comment on attachment 327151 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=327151&action=review > Source/WebCore/dom/PseudoElement.h:48 > + bool hasDisplayContents() const { return m_hasDisplayContents; } > + void setHasDisplayContents(bool has) { m_hasDisplayContents = has; } Instead of adding this bit and the element special cases, could we just put the original display:contents style to m_computedStyle in pseudoelement rare data?
Emilio Cobos Álvarez (:emilio)
Comment 6 2017-11-17 07:50:06 PST
(In reply to Antti Koivisto from comment #5) > Instead of adding this bit and the element special cases, could we just put > the original display:contents style to m_computedStyle in pseudoelement rare > data? You'd still need the element special cases to avoid using the renderStyle() or the renderer() unfortunately. I'm not in love with this patch either, but seemed the less-bad approach. We can also regigger the hasDisplayContents / existingComputedStyle logic a bit more using the pseudo rare data, I guess, but that didn't sound particularly preferable to me.
Antti Koivisto
Comment 7 2017-11-17 08:42:27 PST
> You'd still need the element special cases to avoid using the renderStyle() > or the renderer() unfortunately. I'm not in love with this patch either, but > seemed the less-bad approach. > > We can also regigger the hasDisplayContents / existingComputedStyle logic a > bit more using the pseudo rare data, I guess, but that didn't sound > particularly preferable to me. Ok, we can go with this for now but I think there is too much special casing here. Longer term we should formalise the idea that style used for rendering and style used for getComputedStyle are two different things and we need to keep both around.
Antti Koivisto
Comment 8 2017-11-17 08:43:24 PST
I do like that this moves the display:contents special case from style resolution to render tree building.
Emilio Cobos Álvarez (:emilio)
Comment 9 2017-11-17 11:11:53 PST
Emilio Cobos Álvarez (:emilio)
Comment 10 2017-11-17 11:12:34 PST
(In reply to Antti Koivisto from comment #7) > Ok, we can go with this for now but I think there is too much special casing > here. > > Longer term we should formalise the idea that style used for rendering and > style used for getComputedStyle are two different things and we need to keep > both around. Actually you're right, I felt bad about the patch. I uploaded one that should be simpler and nicer :)
Antti Koivisto
Comment 11 2017-11-17 11:23:54 PST
Comment on attachment 327199 [details] Patch Much better! r=me
Emilio Cobos Álvarez (:emilio)
Comment 12 2017-11-20 03:59:23 PST
Created attachment 327357 [details] Patch for landing
WebKit Commit Bot
Comment 13 2017-11-20 04:32:11 PST
Comment on attachment 327357 [details] Patch for landing Clearing flags on attachment: 327357 Committed r225049: <https://trac.webkit.org/changeset/225049>
WebKit Commit Bot
Comment 14 2017-11-20 04:32:13 PST
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 15 2017-11-20 04:33:37 PST
Note You need to log in before you can comment on or make changes to this bug.