::first-letter does not inherit from display:contents parent
Reported by
oriol-bu...@hotmail.com,
May 2 2017
|
|||||||||||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3088.0 Safari/537.36 Steps to reproduce the problem: 1. Place some text inside a block 2. Create a ::first-letter pseudo-element on the block 3. Wrap part of the text (including the first letter) inside a display:contents element What is the expected behavior? The first letter inherits from ::first-letter pseudo-element, which inherits from the display:contents element, which inherits from the block element that generates the pseudo-element. What went wrong? The ::first-letter pseudo-element inherits directly from the block element. Did this work before? No Does this work in other browsers? N/A Chrome version: 60.0.3088.0 Channel: n/a OS Version: 10.0 Flash Version:
,
May 3 2017
Ah, yes, you need to enable web platform features to reproduce. This issue should block issue 657748 to make sure this is fixed before shipping display:contents
,
May 3 2017
Thank you for providing more feedback. Adding requester "shans@chromium.org" to the cc list and removing "Needs-Feedback" label. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
May 3 2017
,
May 3 2017
Yes, this is basically the same as issue 706316 , just applied to first-letter instead. I'd wait to see what are the resolutions to the multiple spec issues regarding this and others underspecifications related with display: contents: https://github.com/w3c/csswg-drafts/issues?q=is%3Aissue+is%3Aopen+label%3Acss-display-3 Thanks for putting it in the tracker though :)
,
May 4 2017
,
May 4 2017
Thanks for the extra info!
,
May 5 2017
,
Aug 1 2017
,
Oct 30 2017
,
Oct 30 2017
,
Nov 23 2017
,
Nov 30 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/acb3d3a0246a5c96b7ea2dc9b0ad6239bfef2775 commit acb3d3a0246a5c96b7ea2dc9b0ad6239bfef2775 Author: Rune Lillesveen <futhark@chromium.org> Date: Thu Nov 30 00:20:59 2017 Test that ::first-letter inherits from display:contents. Bug: 717460 Change-Id: I3cb9ddc2eb70f64244669853fb9f3fc5b6b06a26 Reviewed-on: https://chromium-review.googlesource.com/798270 Reviewed-by: Darren Shen <shend@chromium.org> Commit-Queue: Rune Lillesveen <futhark@chromium.org> Cr-Commit-Position: refs/heads/master@{#520327} [modify] https://crrev.com/acb3d3a0246a5c96b7ea2dc9b0ad6239bfef2775/third_party/WebKit/LayoutTests/TestExpectations [add] https://crrev.com/acb3d3a0246a5c96b7ea2dc9b0ad6239bfef2775/third_party/WebKit/LayoutTests/external/wpt/css/css-display/display-contents-first-letter-002.html
,
Dec 5 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/fc5c3629044888b8d723cc11424879bb883d8d3e commit fc5c3629044888b8d723cc11424879bb883d8d3e Author: Rune Lillesveen <futhark@chromium.org> Date: Tue Dec 05 12:13:10 2017 Wrap text child of display:contents in anonymous if necessary. A text node gets its style from its flat tree parent. The problem is that our layout code expects the LayoutObject parent to have the same inherited styles as the text node. That is not the case if a text node has display:contents ancestors and the display:contents parent does not have the same inherited styles as the closest ancestor generating a box. Example: <div> <div style="display:contents;font-size:50px">Text</div> </div> We're solving this by inserting an anonymous inline between the LayoutText and its parent LayoutObject. We do not try to merge inline wrappers for subsequent text nodes, so for: <div style="display:contents:color:pink">A<!-- -->B</div> we create one wrapper for each of A and B, even though one would suffice. We attach and detach these wrappers on-demand, so if, for instance, the inherited computed styles of the display:contents change so that it matches the computed styles of the LayoutObject parent, we detach the wrapper as it's no longer needed. We also currently detach the wrapper when the computed style of the display:contents and hence the computed style of the wrapper changes. We could have optimized this through more checking and SetStyle on the anonymous wrapper. Bug: 717460 , 706316 , 709808 , 713019 Change-Id: Ia53b9fe2c0a6067c4600dab49cdf43f23b95b8fa Tests: see removed lines from TestExpectations. Reviewed-on: https://chromium-review.googlesource.com/806158 Commit-Queue: Rune Lillesveen <futhark@chromium.org> Reviewed-by: Robert Hogan <robhogan@gmail.com> Reviewed-by: Morten Stenshorne <mstensho@chromium.org> Cr-Commit-Position: refs/heads/master@{#521673} [modify] https://crrev.com/fc5c3629044888b8d723cc11424879bb883d8d3e/third_party/WebKit/LayoutTests/TestExpectations [modify] https://crrev.com/fc5c3629044888b8d723cc11424879bb883d8d3e/third_party/WebKit/Source/core/dom/LayoutTreeBuilder.cpp [modify] https://crrev.com/fc5c3629044888b8d723cc11424879bb883d8d3e/third_party/WebKit/Source/core/dom/LayoutTreeBuilder.h [modify] https://crrev.com/fc5c3629044888b8d723cc11424879bb883d8d3e/third_party/WebKit/Source/core/dom/Text.cpp [modify] https://crrev.com/fc5c3629044888b8d723cc11424879bb883d8d3e/third_party/WebKit/Source/core/layout/LayoutBlock.cpp [modify] https://crrev.com/fc5c3629044888b8d723cc11424879bb883d8d3e/third_party/WebKit/Source/core/layout/LayoutInline.cpp [modify] https://crrev.com/fc5c3629044888b8d723cc11424879bb883d8d3e/third_party/WebKit/Source/core/layout/LayoutObjectTest.cpp [modify] https://crrev.com/fc5c3629044888b8d723cc11424879bb883d8d3e/third_party/WebKit/Source/core/style/ComputedStyle.cpp [modify] https://crrev.com/fc5c3629044888b8d723cc11424879bb883d8d3e/third_party/WebKit/Source/core/style/ComputedStyle.h
,
Dec 5 2017
|
|||||||||||
►
Sign in to add a comment |
|||||||||||
Comment 1 by shans@chromium.org
, May 2 2017