Changeset 194645 in webkit


Ignore:
Timestamp:
Jan 6, 2016 10:34:02 AM (8 years ago)
Author:
Alan Bujtas
Message:

Float with media query positioned incorrectly after window resize.
https://bugs.webkit.org/show_bug.cgi?id=152558

Reviewed by Simon Fraser and David Hyatt.

This patch ensures that when a renderer becomes floated, it is moved
to the right containing block.
When this floated renderer's previous sibling is an anonymous block, it needs
to be reparented so that the float is positioned as if there was no anonymous block at all.

Source/WebCore:

Test: fast/block/float/float-with-anonymous-previous-sibling.html

  • rendering/RenderElement.cpp:

(WebCore::RenderElement::styleDidChange):

LayoutTests:

  • fast/block/float/float-with-anonymous-previous-sibling-expected.html: Added.
  • fast/block/float/float-with-anonymous-previous-sibling.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r194642 r194645  
     12016-01-06  Zalan Bujtas  <zalan@apple.com>
     2
     3        Float with media query positioned incorrectly after window resize.
     4        https://bugs.webkit.org/show_bug.cgi?id=152558
     5
     6        Reviewed by Simon Fraser and David Hyatt.
     7
     8        This patch ensures that when a renderer becomes floated, it is moved
     9        to the right containing block.
     10        When this floated renderer's previous sibling is an anonymous block, it needs
     11        to be reparented so that the float is positioned as if there was no anonymous block at all.
     12
     13        * fast/block/float/float-with-anonymous-previous-sibling-expected.html: Added.
     14        * fast/block/float/float-with-anonymous-previous-sibling.html: Added.
     15
    1162016-01-06  Ryan Haddad  <ryanhaddad@apple.com>
    217
  • trunk/Source/WebCore/ChangeLog

    r194638 r194645  
     12016-01-06  Zalan Bujtas  <zalan@apple.com>
     2
     3        Float with media query positioned incorrectly after window resize.
     4        https://bugs.webkit.org/show_bug.cgi?id=152558
     5
     6        Reviewed by Simon Fraser and David Hyatt.
     7
     8        This patch ensures that when a renderer becomes floated, it is moved
     9        to the right containing block.
     10        When this floated renderer's previous sibling is an anonymous block, it needs
     11        to be reparented so that the float is positioned as if there was no anonymous block at all.
     12
     13        Test: fast/block/float/float-with-anonymous-previous-sibling.html
     14
     15        * rendering/RenderElement.cpp:
     16        (WebCore::RenderElement::styleDidChange):
     17
    1182016-01-06  Zalan Bujtas  <zalan@apple.com>
    219
  • trunk/Source/WebCore/rendering/RenderElement.cpp

    r194496 r194645  
    997997        handleDynamicFloatPositionChange();
    998998
    999     if (s_noLongerAffectsParentBlock)
     999    if (s_noLongerAffectsParentBlock) {
    10001000        removeAnonymousWrappersForInlinesIfNecessary();
     1001        // Fresh floats need to be reparented if they actually belong to the previous anonymous block.
     1002        // It copies the logic of RenderBlock::addChildIgnoringContinuation
     1003        if (style().isFloating() && previousSibling() && previousSibling()->isAnonymousBlock())
     1004            downcast<RenderBoxModelObject>(*parent()).moveChildTo(&downcast<RenderBoxModelObject>(*previousSibling()), this);
     1005    }
    10011006
    10021007    SVGRenderSupport::styleChanged(*this, oldStyle);
Note: See TracChangeset for help on using the changeset viewer.