⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 175922 in webkit


Ignore:
Timestamp:
Nov 11, 2014, 7:16:28 AM (12 years ago)
Author:
Carlos Garcia Campos
Message:

Merge r175345 - Remove invalid float from RootInlineBox.
https://bugs.webkit.org/show_bug.cgi?id=137707

Reviewed by Antti Koivisto.

In certain cases, floating boxes get attached to the last (root) inline box.
When this particular floating box gets destroyed, it also needs to be detached
from the last inline box.
Source/WebCore:

  1. Introduce RootInlineBox::removeFloat() (vs. RootInlineBox::appendFloat())
  2. Ensure that it is called when the floating box is being destroyed.

Test: fast/inline/crash-when-inline-box-has-invalid-float.html

  • rendering/RenderBlockFlow.cpp:

(WebCore::RenderBlockFlow::removeFloatingObject):
(WebCore::RenderBlockFlow::markAllDescendantsWithFloatsForLayout): During style recalc, while
tearing down the render tree, we can get to a state where a block element has both inline and block children.
It happens when the style change on an element makes sibling anonymous block wrappers detached.
In that case the markAllDescendantsWithFloatsForLayout() call does not get propagated down on the
block child elements as we return early at the childrenInline() check.

  • rendering/RootInlineBox.h:

(WebCore::RootInlineBox::removeFloat):

LayoutTests:

  • fast/inline/crash-when-inline-box-has-invalid-float-expected.txt: Added.
  • fast/inline/crash-when-inline-box-has-invalid-float.html: Added.
Location:
releases/WebKitGTK/webkit-2.6
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • releases/WebKitGTK/webkit-2.6/LayoutTests/ChangeLog

    r175918 r175922  
     12014-10-29  Zalan Bujtas  <zalan@apple.com>
     2
     3        Remove invalid float from RootInlineBox.
     4        https://bugs.webkit.org/show_bug.cgi?id=137707
     5
     6        Reviewed by Antti Koivisto.
     7
     8        In certain cases, floating boxes get attached to the last (root) inline box.
     9        When this particular floating box gets destroyed, it also needs to be detached
     10        from the last inline box.
     11
     12        * fast/inline/crash-when-inline-box-has-invalid-float-expected.txt: Added.
     13        * fast/inline/crash-when-inline-box-has-invalid-float.html: Added.
     14
    1152014-10-27  Mark Lam  <mark.lam@apple.com>
    216
  • releases/WebKitGTK/webkit-2.6/Source/WebCore/ChangeLog

    r175919 r175922  
     12014-10-29  Zalan Bujtas  <zalan@apple.com>
     2
     3        Remove invalid float from RootInlineBox.
     4        https://bugs.webkit.org/show_bug.cgi?id=137707
     5
     6        Reviewed by Antti Koivisto.
     7
     8        In certain cases, floating boxes get attached to the last (root) inline box.
     9        When this particular floating box gets destroyed, it also needs to be detached
     10        from the last inline box.
     11        1. Introduce RootInlineBox::removeFloat() (vs. RootInlineBox::appendFloat())
     12        2. Ensure that it is called when the floating box is being destroyed.
     13
     14        Test: fast/inline/crash-when-inline-box-has-invalid-float.html
     15
     16        * rendering/RenderBlockFlow.cpp:
     17        (WebCore::RenderBlockFlow::removeFloatingObject):
     18        (WebCore::RenderBlockFlow::markAllDescendantsWithFloatsForLayout): During style recalc, while
     19        tearing down the render tree, we can get to a state where a block element has both inline and block children.
     20        It happens when the style change on an element makes sibling anonymous block wrappers detached.
     21        In that case the markAllDescendantsWithFloatsForLayout() call does not get propagated down on the
     22        block child elements as we return early at the childrenInline() check.
     23        * rendering/RootInlineBox.h:
     24        (WebCore::RootInlineBox::removeFloat):
     25
    1262014-10-24  Jeffrey Pfau  <jpfau@apple.com>
    227
  • releases/WebKitGTK/webkit-2.6/Source/WebCore/rendering/RenderBlockFlow.cpp

    r175890 r175922  
    22382238                }
    22392239                if (floatingObject->originatingLine()) {
     2240                    floatingObject->originatingLine()->removeFloat(floatBox);
    22402241                    if (!selfNeedsLayout()) {
    22412242                        ASSERT(&floatingObject->originatingLine()->renderer() == this);
     
    26952696        removeFloatingObject(*floatToRemove);
    26962697
    2697     if (childrenInline())
    2698         return;
    2699 
    2700     // Iterate over our children and mark them as needed.
     2698    // Iterate over our block children and mark them as needed.
    27012699    for (auto& block : childrenOfType<RenderBlock>(*this)) {
    27022700        if (!floatToRemove && block.isFloatingOrOutOfFlowPositioned())
  • releases/WebKitGTK/webkit-2.6/Source/WebCore/rendering/RootInlineBox.h

    r173217 r175922  
    146146    }
    147147
     148    void removeFloat(RenderBox& floatingBox)
     149    {
     150        ASSERT(m_floats);
     151        ASSERT(m_floats->contains(&floatingBox));
     152        m_floats->remove(m_floats->find(&floatingBox));
     153    }
     154
    148155    Vector<RenderBox*>* floatsPtr() { ASSERT(!isDirty()); return m_floats.get(); }
    149156
Note: See TracChangeset for help on using the changeset viewer.