Skip to content
  • mitz@apple.com's avatar
    WebCore: · 40547b31
    mitz@apple.com authored
    2008-03-17  Dan Bernstein  <mitz@apple.com>
    
            Reviewed by Dave Hyatt.
    
            - allow incremental relayout of blocks that contain floats
    
            Tests: fast/repaint/line-flow-with-floats-[1-9].html
    
            * rendering/RenderBlock.cpp:
            (WebCore::RenderBlock::clearFloatsIfNeeded): Cleaned up by moving most
            of the function body out of an if statement which was replaced with an
            early return.
            (WebCore::RenderBlock::insertFloatingObject): Cleaned up by moving most
            of the function body out of an if statement and moving the ASSERT, which
            is a crash in release builds, to the beginning. Made this function set
            the m_isDescendant flag of floating objects it creates.
            (WebCore::RenderBlock::removeFloatingObject): Added a call to
            markLinesDirtyInVerticalRange() when removing a float from a block with
            inline children.
            (WebCore::RenderBlock::markLinesDirtyInVerticalRange): Added. Marks the
            lines in the given range as dirty.
            (WebCore::RenderBlock::clearFloats): Added code to detect changes to
            the geometry of floats intruding into this block from other blocks and
            mark any lines whose available width has changed as a result as dirty.
    
            * rendering/RenderBlock.h:
            (WebCore::RenderBlock::FloatWithRect::FloatWithRect): Added a structure
            to cache a float with its position and size.
            (WebCore::RenderBlock::FloatingObject::FloatingObject): Added an
            m_isDescendant flag, used by clearFloats() to distinguish between floats
            entering the block from outside and floats internal to the block.
    
            * rendering/RootInlineBox.h:
            (WebCore::RootInlineBox::floats): Added.
            (WebCore::RootInlineBox::floatsPtr): Added.
            (WebCore::RootInlineBox::Overflow::Overflow): Added a data member to
            hold the floats originating on the line.
    
            * rendering/bidi.cpp:
            (WebCore::RenderBlock::layoutInlineChildren): Made the existence of
            floats not force a full layout. Changed to cache the geometry of floats
            in the block and detect changes to it. If a float's size or position
            changes, all lines from that point on are treated as dirty. An exception
            is a change in the dimensions of a float on an otherwise-clean line,
            which only dirties lines potentially affected by the change (see
            determineStartPosition()). Added code to update each RootInlineBox's
            set of floats as lines are laid out. Added code to shift floats
            belonging to clean lines in the end along with the lines.
            (WebCore::RenderBlock::determineStartPosition): Made this function look
            for changes to floats' dimensions and mark lines as dirty accordingly.
            Also look for new floats and if found, cause a full layout. Added code
            to re-add floats belonging to clean lines.
            (WebCore::RenderBlock::matchedEndLine): Added checking that the clean
            lines in the end can be shifted vertically as needed, i.e. that the
            available width along the way is uniform.
    
    LayoutTests:
    
    2008-03-17  Dan Bernstein  <mitz@apple.com>
    
            Reviewed by Dave Hyatt.
    
            - test incremental relayout of blocks that contain floats
    
            * fast/repaint/line-flow-with-floats-1.html: Added.
            * fast/repaint/line-flow-with-floats-2.html: Added.
            * fast/repaint/line-flow-with-floats-3.html: Added.
            * fast/repaint/line-flow-with-floats-4.html: Added.
            * fast/repaint/line-flow-with-floats-5.html: Added.
            * fast/repaint/line-flow-with-floats-6.html: Added.
            * fast/repaint/line-flow-with-floats-7.html: Added.
            * fast/repaint/line-flow-with-floats-8.html: Added.
            * fast/repaint/line-flow-with-floats-9.html: Added.
            * fast/repaint/resources/line-flow-with-floats.html: Added.
            * fast/repaint/resources/line-flow-with-floats.js: Added.
            * platform/mac/fast/repaint/line-flow-with-floats-1-expected.checksum: Added.
            * platform/mac/fast/repaint/line-flow-with-floats-1-expected.png: Added.
            * platform/mac/fast/repaint/line-flow-with-floats-1-expected.txt: Added.
            * platform/mac/fast/repaint/line-flow-with-floats-2-expected.checksum: Added.
            * platform/mac/fast/repaint/line-flow-with-floats-2-expected.png: Added.
            * platform/mac/fast/repaint/line-flow-with-floats-2-expected.txt: Added.
            * platform/mac/fast/repaint/line-flow-with-floats-3-expected.checksum: Added.
            * platform/mac/fast/repaint/line-flow-with-floats-3-expected.png: Added.
            * platform/mac/fast/repaint/line-flow-with-floats-3-expected.txt: Added.
            * platform/mac/fast/repaint/line-flow-with-floats-4-expected.checksum: Added.
            * platform/mac/fast/repaint/line-flow-with-floats-4-expected.png: Added.
            * platform/mac/fast/repaint/line-flow-with-floats-4-expected.txt: Added.
            * platform/mac/fast/repaint/line-flow-with-floats-5-expected.checksum: Added.
            * platform/mac/fast/repaint/line-flow-with-floats-5-expected.png: Added.
            * platform/mac/fast/repaint/line-flow-with-floats-5-expected.txt: Added.
            * platform/mac/fast/repaint/line-flow-with-floats-6-expected.checksum: Added.
            * platform/mac/fast/repaint/line-flow-with-floats-6-expected.png: Added.
            * platform/mac/fast/repaint/line-flow-with-floats-6-expected.txt: Added.
            * platform/mac/fast/repaint/line-flow-with-floats-7-expected.checksum: Added.
            * platform/mac/fast/repaint/line-flow-with-floats-7-expected.png: Added.
            * platform/mac/fast/repaint/line-flow-with-floats-7-expected.txt: Added.
            * platform/mac/fast/repaint/line-flow-with-floats-8-expected.checksum: Added.
            * platform/mac/fast/repaint/line-flow-with-floats-8-expected.png: Added.
            * platform/mac/fast/repaint/line-flow-with-floats-8-expected.txt: Added.
            * platform/mac/fast/repaint/line-flow-with-floats-9-expected.checksum: Added.
            * platform/mac/fast/repaint/line-flow-with-floats-9-expected.png: Added.
            * platform/mac/fast/repaint/line-flow-with-floats-9-expected.txt: Added.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31116 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    40547b31