commit | fc5c3629044888b8d723cc11424879bb883d8d3e | [log] [tgz] |
---|---|---|
author | Rune Lillesveen <futhark@chromium.org> | Tue Dec 05 12:13:10 2017 |
committer | Commit Bot <commit-bot@chromium.org> | Tue Dec 05 12:13:10 2017 |
tree | 6cbeafe8b4eab4f0eec5b64231c6bdc769d21874 | |
parent | 9ad779c6e7431a33afae6001ad4957965a26f390 [diff] |
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}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .