Bug 78562
Summary: | New flexboxes don't split into columns | ||
---|---|---|---|
Product: | WebKit | Reporter: | Ojan Vafai <ojan> |
Component: | Layout and Rendering | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Normal | CC: | hyatt, tony |
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Bug Depends on: | |||
Bug Blocks: | 62048 |
Ojan Vafai
RenderBlock* RenderBlock::createAnonymousBlockWithSameTypeAs(RenderBlock* otherAnonymousBlock) const
{
if (otherAnonymousBlock->isAnonymousColumnsBlock())
return createAnonymousColumnsBlock();
if (otherAnonymousBlock->isAnonymousColumnSpanBlock())
return createAnonymousColumnSpanBlock();
return createAnonymousBlock(otherAnonymousBlock->style()->display() == BOX);
}
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Ojan Vafai
As well as:
RenderBlock* RenderBlock::createAnonymousBlock(bool isFlexibleBox) const
{
RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyle(style());
RenderBlock* newBox = 0;
if (isFlexibleBox) {
newStyle->setDisplay(BOX);
newBox = new (renderArena()) RenderDeprecatedFlexibleBox(document() /* anonymous box */);
} else {
newStyle->setDisplay(BLOCK);
newBox = new (renderArena()) RenderBlock(document() /* anonymous box */);
}
newBox->setStyle(newStyle.release());
return newBox;
}
Ojan Vafai
And to round out the trio, RenderObject.h:
bool isAnonymousBlock() const
{
// This function is kept in sync with anonymous block creation conditions in
// RenderBlock::createAnonymousBlock(). This includes creating an anonymous
// RenderBlock having a BLOCK or BOX display. Other classes such as RenderTextFragment
// are not RenderBlocks and will return false. See https://bugs.webkit.org/show_bug.cgi?id=56709.
return isAnonymous() && (style()->display() == BLOCK || style()->display() == BOX) && style()->styleType() == NOPSEUDO && isRenderBlock() && !isListMarker()
#if ENABLE(FULLSCREEN_API)
&& !isRenderFullScreen()
&& !isRenderFullScreenPlaceholder()
#endif
;
}
Ojan Vafai
We need createAnonymousBlock to create a RenderFlexibleBox when splitting flexboxes. This will get new flexboxes to match the old ones. Old flexboxes are all sorts of buggy in multi-column though.