[Webkit-unassigned] [Bug 152558] float with media query positioned incorrectly after window resize

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Dec 26 21:59:40 PST 2015


https://bugs.webkit.org/show_bug.cgi?id=152558

--- Comment #7 from zalan <zalan at apple.com> ---
RenderBlock::addChildIgnoringContinuation says:
"// If we're inserting an inline (or floated) 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."
However when we are transforming an existing block renderer to floated, we don't follow this rule and the floated renderer ends up with the wrong parent.
The fix is to apply the same logic when this style change happens.
Something like this (but probably with a bit more limited scope)
+    // This renderer might need a new parent.
+    if (m_style->isFloating() && previousSibling() && previousSibling()->isAnonymousBlock())
+        downcast<RenderBoxModelObject>(*parent()).moveChildTo(&downcast<RenderBoxModelObject>(*previousSibling()), this);
right after calling RenderElement::removeAnonymousWrappersForInlinesIfNecessary() in RenderElement::styleDidChange() when s_noLongerAffectsParentBlock is true. 
This puts the floated renderer on the correct line (other "out of flow" style changes should probably trigger the same logic, though they don't impact rendering the same way float does).

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20151227/66593ea4/attachment.html>


More information about the webkit-unassigned mailing list