Changeset 19848 in webkit
- Timestamp:
- Feb 25, 2007, 5:29:46 PM (18 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r19847 r19848 1 2007-02-25 David Hyatt <hyatt@apple.com> 2 3 Fix for regression caused by changing the containing block of positioned elements with no positioned ancestor 4 to be the initial containing block (represented in our tree by the RenderView). Rework RenderView's layout 5 to have very few special cases. Now it will just relayout its children when the width/height of the 6 view actually changes. Positioned elements no longer get a special additional layout, since width/height 7 adjustments are caught by the base class already anyway. 8 9 Reviewed by mjs, darin 10 11 * rendering/RenderBlock.cpp: 12 (WebCore::RenderBlock::layoutBlock): 13 * rendering/RenderFlexibleBox.cpp: 14 (WebCore::RenderFlexibleBox::layoutBlock): 15 (WebCore::RenderFlexibleBox::layoutVerticalBox): 16 * rendering/RenderView.cpp: 17 (WebCore::RenderView::RenderView): 18 (WebCore::RenderView::layout): 19 * rendering/RenderView.h: 20 1 21 2007-02-25 Maciej Stachowiak <mjs@apple.com> 2 22 -
trunk/WebCore/rendering/RenderBlock.cpp
r19785 r19848 575 575 // Update our scroll information if we're overflow:auto/scroll/hidden now that we know if 576 576 // we overflow or not. 577 RenderObject* flexbox = view()->flexBoxInFirstLayout(); 578 if (hasOverflowClip() && !(flexbox && flexbox != this && isDescendantOf(flexbox))) 577 if (hasOverflowClip()) 579 578 m_layer->updateScrollInfoAfterLayout(); 580 579 -
trunk/WebCore/rendering/RenderFlexibleBox.cpp
r19784 r19848 325 325 // Update our scrollbars if we're overflow:auto/scroll/hidden now that we know if 326 326 // we overflow or not. 327 RenderObject* flexbox = view()->flexBoxInFirstLayout(); 328 if (hasOverflowClip() && !(flexbox && flexbox != this && isDescendantOf(flexbox))) 327 if (hasOverflowClip()) 329 328 m_layer->updateScrollInfoAfterLayout(); 330 329 … … 806 805 // out within the box. 807 806 do { 808 809 if (view()->flexBoxInFirstLayout() == this)810 view()->setFlexBoxInFirstLayout(0);811 else if (!view()->flexBoxInFirstLayout())812 view()->setFlexBoxInFirstLayout(this);813 814 807 m_height = borderTop() + paddingTop(); 815 808 int minHeight = m_height + toAdd; -
trunk/WebCore/rendering/RenderView.cpp
r19828 r19848 41 41 , m_printImages(true) 42 42 , m_maximalOutlineSize(0) 43 , m_flexBoxInFirstLayout(0)44 43 { 45 44 // Clear our anonymous bit, set because RenderObject assumes … … 96 95 m_minWidth = m_width; 97 96 98 // FIXME: This is all just a terrible workaround for bugs in layout when the view height changes. 99 // Find a better way to detect view height changes. We're guessing that if we don't need layout that the reason 100 // we were called is because of a FrameView bounds change. 101 if (!needsLayout()) { 97 bool relayoutChildren = !printing() && (!m_frameView || m_width != m_frameView->visibleWidth() || m_height != m_frameView->visibleHeight()); 98 if (relayoutChildren) 102 99 setChildNeedsLayout(true, false); 103 setMinMaxKnown(false);104 for (RenderObject* c = firstChild(); c; c = c->nextSibling())105 c->setChildNeedsLayout(true, false);106 }107 100 108 101 if (recalcMinMax()) 109 102 recalcMinMaxWidths(); 110 111 RenderBlock::layout(); 112 113 int docw = docWidth(); 114 int doch = docHeight(); 115 116 if (!printing()) { 117 setWidth(m_frameView->visibleWidth()); 118 setHeight(m_frameView->visibleHeight()); 119 } 120 121 // FIXME: we could maybe do the call below better and only pass true if the docsize changed. 122 layoutPositionedObjects(true); 123 124 layer()->setHeight(max(doch, m_height)); 125 layer()->setWidth(max(docw, m_width)); 103 104 if (needsLayout()) 105 RenderBlock::layout(); 106 107 setOverflowWidth(max(docWidth(), m_width)); 108 setOverflowHeight(max(docHeight(), m_height)); 126 109 127 110 setNeedsLayout(false); -
trunk/WebCore/rendering/RenderView.h
r19492 r19848 91 91 void removeWidget(RenderObject*); 92 92 93 void setFlexBoxInFirstLayout(RenderObject* r) { m_flexBoxInFirstLayout = r; }94 RenderObject* flexBoxInFirstLayout() { return m_flexBoxInFirstLayout; }95 96 93 const IntSize& layoutDelta() const { return m_layoutDelta; } 97 94 void addLayoutDelta(const IntSize& delta) { m_layoutDelta += delta; } … … 116 113 RenderObjectSet m_widgets; 117 114 118 RenderObject* m_flexBoxInFirstLayout;119 120 115 private: 121 116 int m_bestTruncatedAt;
Note:
See TracChangeset
for help on using the changeset viewer.