New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 655070 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner:
NOT IN USE
Closed: Oct 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug-Regression



Sign in to add a comment

Sub-elements of the element with style display:-webkit-box cannot layout inline

Reported by c.georc...@gmail.com, Oct 12 2016

Issue description

Example URL:
http://res.imtt.qq.com///qqbrowser_x5/talonchen/test-webkit-box.html

Steps to reproduce the problem:
1. Load the attached test case or load the url http://res.imtt.qq.com///qqbrowser_x5/talonchen/test-webkit-box.html directly 
2. 
3. 

What is the expected behavior?
<div class="LifeAdLis" style="display:-webkit-box">
        <span id="GSEfOs5RRs"><p>SomeText A</p></span>
        <span id="QA2R9cYoik"><p>SomeText B</p></span>
        <span id="ITe9fSbVMh"><p>SomeText C</p></span>
</div>

The <span> elements should layout inline. 

What went wrong?
The elements under a -webkit-box <div> cannot layout properly.

Does it occur on multiple sites: Yes

Is it a problem with a plugin? No 

Did this work before? Yes 

Does this work in other browsers? Yes

Chrome version: 53.0.2785.123  Channel: n/a
OS Version: 5.1.1
Flash Version: Shockwave Flash 23.0 r0
 
test-webkit-box.html
2.8 KB View Download
Expected.png
2.5 KB View Download
Chrome53.png
2.4 KB View Download
Components: -Blink Blink>Layout
Cc: dgro...@chromium.org
Labels: -Type-Bug Needs-Bisect Type-Bug-Regression
Labels: -Needs-Bisect hasbisect
Owner: msten...@opera.com
You are probably looking for a change made after 395610 (known good), but no later than 395614 (first known bad).
CHANGELOG URL:
  https://chromium.googlesource.com/chromium/src/+log/5f88403bf3e53a955cee48e172269d0ed94f2595..e0d355a173d0bae9c533fe49ef23258f263e9a8b

Probably Morten's https://chromium.googlesource.com/chromium/src/+/e0d355a173d0bae9c533fe49ef23258f263e9a8b ?

In general though, -webkit-box isn't really supported, I would strongly encourage you to use the modern flexbox (display: flex and related properties)

Comment 4 by msten...@opera.com, Oct 17 2016

So we end up with only one flex item wrapped around all the three inlines with blocks inside?

I think this behavior (inline children of flexbox) was undefined in the version of the flex box spec that was used to implement -webkit-box, and it is very likely that my commit above changed the behavior.

In the finished version of the flexbox spec, behavior for this case is well-defined, so if you could switch to using display:flex, that would be great, yes.

Comment 5 Deleted

Comment 6 Deleted

I've verified that it's indeed caused by the commit (https://chromium.googlesource.com/chromium/src/+/e0d355a173d0bae9c533fe49ef23258f263e9a8b).


It's true that the flex item (-webkit-box DIV) has only one child (Anonymous Block) after the commit. And all the inline children are wrapped
by this anonymous-block child. So that three inlines (span Element) cannot layout horizonally.

Make the test case easier, as below: 

    <div id="abc" style="display:-webkit-box">
        <span id="AAA"><p>SomeText A</p></span>
        <span id="BBB"><p>SomeText B</p></span>
        <span id="CCC"><p>SomeText C</p></span>
    </div>


Here is the LayoutObject Tree of the test case, it behaves as expected:

      LayoutDeprecatedFlexibleBox 0x3fb2c000	DIV	0xd9b6dc08 ID="abc" STYLE="display: -webkit-box"
        LayoutBlockFlow (anonymous) 0x3faf8640
          LayoutInline 0x3fae0370 continuation=0x3faf86e0	SPAN	0xd9b6dc68 ID="AAA"
        LayoutBlockFlow (anonymous) 0x3faf86e0 continuation=0x3fae0318
          LayoutBlockFlow 0x3faf8280 	P	0xd9b6dca0
            LayoutText 0x3fa46a20    	#text	0xd9b6dcd8 "SomeText A"
        LayoutBlockFlow (anonymous) 0x3faf8a00
          LayoutInline 0x3fae0318    	SPAN	0xd9b6dc68 ID="AAA"
          LayoutText 0x3fa46a80      	#text	0xd9b6dd00 "\n        "
          LayoutInline 0x3fae0000 continuation=0x3faf8140	SPAN	0xd9b6dd28 ID="BBB"
        LayoutBlockFlow (anonymous) 0x3faf8140 continuation=0x3fae03c8
          LayoutBlockFlow 0x3faf8b40 	P	0xd9b6dd60
            LayoutText 0x3fa46ae0    	#text	0xd9b6dd98 "SomeText B"
        LayoutBlockFlow (anonymous) 0x3faf88c0
          LayoutInline 0x3fae03c8    	SPAN	0xd9b6dd28 ID="BBB"
          LayoutText 0x3fa46240      	#text	0xd9b6ddc0 "\n        "
          LayoutInline 0x3fae00b0 continuation=0x3faf8820	SPAN	0xd9b6dde8 ID="CCC"
        LayoutBlockFlow (anonymous) 0x3faf8820 continuation=0x3fae0058
          LayoutBlockFlow 0x3faf8aa0 	P	0xd9b6de20
            LayoutText 0x3fa462a0    	#text	0xd9b6de58 "SomeText C"
        LayoutBlockFlow (anonymous) 0x3faf8960
          LayoutInline 0x3fae0058    	SPAN	0xd9b6dde8 ID="CCC"
          LayoutText 0x3fa461e0      	#text	0xd9b6de80 "\n    "




However, after the commit, LayoutObject Tree shows as below:

      LayoutDeprecatedFlexibleBox 0x3fb2c000	DIV	0xd9b6dc08 ID="abc" STYLE="display: -webkit-box"
        LayoutBlockFlow (anonymous) 0x3faf8640
          LayoutBlockFlow (anonymous) 0x3faf8780 //<= create a new anonymous block after Morten's commit for making it more strict to re-use an anonymous block
            LayoutInline 0x3fae0370 continuation=0x3faf86e0	SPAN	0xd9b6dc68 ID="AAA"
          LayoutBlockFlow (anonymous) 0x3faf86e0 continuation=0x3fae0318
            LayoutBlockFlow 0x3faf8280 	P	0xd9b6dca0
              LayoutText 0x3fa46a20    	#text	0xd9b6dcd8 "SomeText A"
          LayoutBlockFlow (anonymous) 0x3faf8a00
            LayoutInline 0x3fae0318    	SPAN	0xd9b6dc68 ID="AAA"
            LayoutText 0x3fa46a80      	#text	0xd9b6dd00 "\n        "
            LayoutInline 0x3fae0000 continuation=0x3faf8140	SPAN	0xd9b6dd28 ID="BBB"
          LayoutBlockFlow (anonymous) 0x3faf8140 continuation=0x3fae03c8
            LayoutBlockFlow 0x3faf8b40 	P	0xd9b6dd60
              LayoutText 0x3fa46ae0    	#text	0xd9b6dd98 "SomeText B"
          LayoutBlockFlow (anonymous) 0x3faf88c0
            LayoutInline 0x3fae03c8    	SPAN	0xd9b6dd28 ID="BBB"
            LayoutText 0x3fa46240      	#text	0xd9b6ddc0 "\n        "
            LayoutInline 0x3fae00b0 continuation=0x3faf8820	SPAN	0xd9b6dde8 ID="CCC"
          LayoutBlockFlow (anonymous) 0x3faf8820 continuation=0x3fae0058
            LayoutBlockFlow 0x3faf8aa0 	P	0xd9b6de20
              LayoutText 0x3fa462a0    	#text	0xd9b6de58 "SomeText C"
          LayoutBlockFlow (anonymous) 0x3faf8960
            LayoutInline 0x3fae0058    	SPAN	0xd9b6dde8 ID="CCC"
            LayoutText 0x3fa461e0      	#text	0xd9b6de80 "\n    "


It seems to me that Morten's commit is unmistakable. And it requires another improvement for -webkit-box.
I have an idea for this:


      LayoutDeprecatedFlexibleBox 0x3fb2c000	DIV	0xd9b6dc08 ID="abc" STYLE="display: -webkit-box"
        LayoutBlockFlow (anonymous) 0x3faf8640
          LayoutBlockFlow (anonymous) 0x3faf8780 //<= create a new anonymous block after Morten's commit for making it more strict to re-use an anonymous block
            LayoutInline 0x3fae0370 continuation=0x3faf86e0	SPAN	0xd9b6dc68 ID="AAA"
          LayoutBlockFlow (anonymous) 0x3faf86e0 continuation=0x3fae0318
            LayoutBlockFlow 0x3faf8280 	P	0xd9b6dca0
              LayoutText 0x3fa46a20    	#text	0xd9b6dcd8 "SomeText A"
          LayoutBlockFlow (anonymous) 0x3faf8a00
            LayoutInline 0x3fae0318    	SPAN	0xd9b6dc68 ID="AAA"
            LayoutText 0x3fa46a80      	#text	0xd9b6dd00 "\n        "

        LayoutBlockFlow (anonymous) 0x3fafXXXX  // CREATE a new anonymous for SPAN during the creating of LayoutObject Tree <= [what i'am going to do]
          LayoutBlockFlow (anonymous) 0x3faf8780  // it will be created through Morten;s commit
            LayoutInline 0x3fae0000 continuation=0x3faf8140	SPAN	0xd9b6dd28 ID="BBB"

                     ...
                     ...
                     ...


I would like to know whether the idea is proper, if so, I'm going to work it out.


Comment 8 by msten...@opera.com, Oct 18 2016

Cc: cbiesin...@chromium.org
I think we should be careful with spending time on fixing corner-cases in the deprecated flex box implementation, unless it's really necessary. There may be cans of worms somewhere in there.

What the new flex implementation does (according to the spec) is to turn all inline children into block children, so that they can easily behave as flex items.
Status: WontFix (was: Unconfirmed)
Yeah, we usually wontfix bugs in -webkit-box.

Sign in to add a comment