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

Issue 2826153002: Don't assume line-height properties can't change between text and its container.

Created:
3 years, 8 months ago by emilio
Modified:
3 years, 4 months ago
Reviewers:
eae
CC:
chromium-reviews, szager+layoutwatch_chromium.org, zoltan1, blink-reviews-layout_chromium.org, pdr+renderingwatchlist_chromium.org, eae+blinkwatch, leviw+renderwatch, jchaffraix+rendering, blink-reviews
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Don't assume line-height properties can't change between text and its container. This assumption is totally wrong in a world with display: contents. BUG=713019, 657748

Patch Set 1 #

Patch Set 2 : Don't assume line-height properties can't change between text and its container. #

Patch Set 3 : Don't assume line-height properties can't change between text and its container. #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+39 lines, -1 line) Patch
A third_party/WebKit/LayoutTests/css-display-3/display-contents-line-height.html View 1 chunk +15 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/css-display-3/display-contents-line-height-expected.html View 1 2 1 chunk +16 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/layout/line/InlineFlowBox.cpp View 1 2 chunks +8 lines, -1 line 1 comment Download

Messages

Total messages: 11 (7 generated)
emilio
Hi Emil, Could you take a look at this patch? Thanks in advance :)
3 years, 8 months ago (2017-04-19 17:36:00 UTC) #6
eae
This seems reasonable to me. LGTM https://codereview.chromium.org/2826153002/diff/40001/third_party/WebKit/Source/core/layout/line/InlineFlowBox.cpp File third_party/WebKit/Source/core/layout/line/InlineFlowBox.cpp (right): https://codereview.chromium.org/2826153002/diff/40001/third_party/WebKit/Source/core/layout/line/InlineFlowBox.cpp#newcode97 third_party/WebKit/Source/core/layout/line/InlineFlowBox.cpp:97: FlatTreeTraversal::Parent(*child.GetNode()) == parent.GetNode(); ...
3 years, 8 months ago (2017-04-21 10:54:52 UTC) #9
kojii
As I replied to the layout-dev@, this is reasonable, but this isn't the only place ...
3 years, 4 months ago (2017-08-02 07:06:00 UTC) #10
rune
3 years, 4 months ago (2017-08-02 07:42:08 UTC) #11
On 2017/08/02 07:06:00, kojii wrote:
> As I replied to the layout-dev@, this is reasonable, but this isn't the only
> place we assume parent has the same fonts/vertical-align/etc, both in the
> current layout code and in LayoutNG. We could fix them all, but I have mild
> preference to create anonymous inline box in this case and keep the current
> assumption.
> 
> Is this reasonable/possible?

I think that depends on how hard it would be to add/remove anonymous inline
boxes while rebuilding the layout tree. I would need to take a deeper look at
the layout tree building to answer that.

I'd expect we'd wrap subsequent text node children of display:contents elements
into an anonymous inline.

So that this (AAA and aaa being two separate text nodes):

  <div style="display:contents><div
style="display:contents">AAA,aaa<div>BBB</div>CCC<span>DDD</span></div>EEE</div>

will become:

  <anon-block>
    <anon-inline>AAA,aaa</anon-inline>
  </anon-block>
  <block>BBB</block>
  <anon-block>
   
<anon-inline>CCC</anon-inline><inline>DDD</inline><anon-inline>EEE</anon-inline>
  </anon-block>

where the anonymous inline for AAA, and CCC gets their fonts/colors etc from the
inner display:contents, and the anonymous inline for EEE gets relevant style
from the outer one.

Powered by Google App Engine
This is Rietveld 408576698