Changeset 109157 in webkit
- Timestamp:
- Feb 28, 2012 3:09:06 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r109155 r109157 1 2012-02-28 Julien Chaffraix <jchaffraix@webkit.org> 2 3 Move RenderLayer::size() calls to a common function 4 https://bugs.webkit.org/show_bug.cgi?id=76972 5 6 Reviewed by Simon Fraser. 7 8 Refactoring only. 9 10 This change introduces RenderBox::cachedSizeForOverflowClip() that handles all the cached size 11 requests that currently goes through the RenderLayer. This indirection helps to decouple the need 12 for a RenderLayer so that we can lazily allocate RenderLayers as part of bug 75568. 13 14 * rendering/RenderBox.cpp: 15 (WebCore::RenderBox::cachedSizeForOverflowClip): 16 Added this function to handle the calls to RenderLayer's size(). Unfortunately a lot of the 17 code calls RenderLayer::size() directly so I could not make it private. 18 19 * rendering/LayoutState.cpp: 20 (WebCore::LayoutState::LayoutState): 21 * rendering/RenderBox.cpp: 22 (WebCore::RenderBox::computeRectForRepaint): 23 * rendering/RenderBox.h: 24 (RenderBox): 25 * rendering/RenderInline.cpp: 26 (WebCore::RenderInline::clippedOverflowRectForRepaint): 27 (WebCore::RenderInline::computeRectForRepaint): 28 * rendering/RenderObject.cpp: 29 (WebCore::RenderObject::computeRectForRepaint): 30 Fixed the call sites above. 31 1 32 2012-02-28 Tim Dresser <tdresser@chromium.org> 2 33 -
trunk/Source/WebCore/rendering/LayoutState.cpp
r108382 r109157 71 71 72 72 if (renderer->hasOverflowClip()) { 73 RenderLayer* layer = renderer->layer(); 74 LayoutRect clipRect(toPoint(m_paintOffset) + renderer->view()->layoutDelta(), layer->size()); 73 LayoutRect clipRect(toPoint(m_paintOffset) + renderer->view()->layoutDelta(), renderer->cachedSizeForOverflowClip()); 75 74 if (m_clipped) 76 75 m_clipRect.intersect(clipRect); … … 157 156 158 157 if (container->hasOverflowClip()) { 158 m_clipped = true; 159 159 RenderBox* containerBox = toRenderBox(container); 160 RenderLayer* layer = containerBox->layer(); 161 m_clipped = true; 162 m_clipRect = LayoutRect(toPoint(m_paintOffset), layer->size()); 160 m_clipRect = LayoutRect(toPoint(m_paintOffset), containerBox->cachedSizeForOverflowClip()); 163 161 m_paintOffset -= containerBox->scrolledContentOffset(); 164 162 } -
trunk/Source/WebCore/rendering/RenderBox.cpp
r109104 r109157 754 754 } 755 755 756 IntSize RenderBox::cachedSizeForOverflowClip() const 757 { 758 ASSERT(hasOverflowClip()); 759 ASSERT(hasLayer()); 760 761 return layer()->size(); 762 } 763 756 764 LayoutUnit RenderBox::minPreferredLogicalWidth() const 757 765 { … … 1643 1651 1644 1652 LayoutRect repaintRect(topLeft, rect.size()); 1645 LayoutRect boxRect(LayoutPoint(), containerBox-> layer()->size());1653 LayoutRect boxRect(LayoutPoint(), containerBox->cachedSizeForOverflowClip()); 1646 1654 rect = intersection(repaintRect, boxRect); 1647 1655 if (rect.isEmpty()) -
trunk/Source/WebCore/rendering/RenderBox.h
r109104 r109157 449 449 450 450 IntSize scrolledContentOffset() const; 451 IntSize cachedSizeForOverflowClip() const; 451 452 452 453 virtual bool hasRelativeDimensions() const; -
trunk/Source/WebCore/rendering/RenderInline.cpp
r108719 r109157 1034 1034 repaintRect.move(-cb->scrolledContentOffset()); // For overflow:auto/scroll/hidden. 1035 1035 1036 LayoutRect boxRect(LayoutPoint(), cb-> layer()->size());1036 LayoutRect boxRect(LayoutPoint(), cb->cachedSizeForOverflowClip()); 1037 1037 r = intersection(repaintRect, boxRect); 1038 1038 } … … 1136 1136 1137 1137 LayoutRect repaintRect(topLeft, rect.size()); 1138 LayoutRect boxRect(LayoutPoint(), containerBox-> layer()->size());1138 LayoutRect boxRect(LayoutPoint(), containerBox->cachedSizeForOverflowClip()); 1139 1139 rect = intersection(repaintRect, boxRect); 1140 1140 if (rect.isEmpty()) -
trunk/Source/WebCore/rendering/RenderObject.cpp
r109060 r109157 1521 1521 repaintRect.move(-boxParent->scrolledContentOffset()); // For overflow:auto/scroll/hidden. 1522 1522 1523 LayoutRect boxRect(LayoutPoint(), boxParent-> layer()->size());1523 LayoutRect boxRect(LayoutPoint(), boxParent->cachedSizeForOverflowClip()); 1524 1524 rect = intersection(repaintRect, boxRect); 1525 1525 if (rect.isEmpty())
Note: See TracChangeset
for help on using the changeset viewer.