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

Issue 611015 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner: ----
Closed: May 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Absolutely positioned child sometimes fails to become flex item if next to text

Reported by msten...@opera.com, May 11 2016

Issue description

The reason can be found in LayoutBlock::addChild(), which was probably "written" with block containers (LayoutBlockFlow) in mind. The rules for creating anonymous blocks inside block containers and flex boxes are not the same, so we may need to consider adding a LayoutFlexibleBox::addChild() override.

I'm in the process of moving out LayoutBlockFlow-specific stuff from LayoutBlock, which is how I discovered this.

Please let me know if you think the attached test is completely invalid. :)
 
tc.html
604 bytes View Download
Sorry, I'm a little confused right now, what is the code in addChild() that does this? What is happening in your testcase? Thanks!
Components: Blink>Layout

Comment 3 by msten...@opera.com, May 11 2016

    } else if (!childrenInline() && (newChild->isFloatingOrOutOfFlowPositioned() || newChild->isInline())) {
        // If we're inserting an inline child but all of our children are blocks, then we have to make sure
        // it is put into an anomyous block box. We try to use an existing anonymous box if possible, otherwise
        // a new one is created and inserted into our list of children in the appropriate position.

You won't believe what happens next! :)

If we have an anonymous block that was initially created to hold a text flex item, and then re-use it and put an abspos inside it... that can't be right? The abspos should end up as a sibling of said anonymous block, not a child. We want two flex items, one for the text and one for the abspos - right?

My test case has flexboxes, each with three items (or at least that's what I think would be the correct behavior). The middle item is absolutely positioned. The first and last item is either an anonymous block with text inside, or a DIV with text inside.
Hmm, I see. Isn't it weird that out-of-flow is treated the same as inline here? I'm not sure what case that is supposed to cover?

Comment 5 by msten...@opera.com, May 11 2016

It's not so weird for block container layout (LayoutBlockFlow). Out-of-flow objects and floats can be both block and inline children, but if there's an adjacent anonymous block for inline children at the insertion point, reparent into that one, for the sake of consistency.

It's a long story, and I don't even know if I'm able to tell it right. :)

For flexbox, however, I shouldn't think this makes any sense at all.
OK, I see. Yeah... this might need an !isFlexibleBox() check but then this gets even more complicated :(

Comment 7 by msten...@opera.com, May 11 2016

Yes, but I'm planning on moving everything there that actually is specific to LayoutBlockFlow down to LayoutBlock, which will leave a complexity-vacuum in LayoutBlock::addChild(). :)

Another option is to override addChild() in LayoutFlexibleBox. It should be fairly easy to do when I'm done with the moving-around.
Looking forward to it!

Can't have a complexity vacuum here ;)

Comment 9 by e...@chromium.org, May 11 2016

Cc: msten...@opera.com
Status: Available (was: Untriaged)

Comment 10 by msten...@opera.com, May 18 2016

Mild complexity vacuum detected in LayoutBlock::addChild(). ;)

https://codereview.chromium.org/1974753002/

Seriously, though, if you want to fix this, maybe add a LayoutFlexibleBox::addChild() override instead?
Components: -Blink>Layout Blink>Layout>Flexbox
Yeah, that seems like a good idea. I'll keep it as a low-priority item.
Project Member

Comment 12 by sheriffbot@chromium.org, May 24 2017

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available. If you change it back, also remove the "Hotlist-Recharge-Cold" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Status: Available (was: Untriaged)
Project Member

Comment 14 by sheriffbot@chromium.org, May 24 2018

Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 15 by e...@chromium.org, May 25 2018

Status: Fixed (was: Untriaged)
This now works as expected.

Sign in to add a comment