Changeset 87467 in webkit
- Timestamp:
- May 26, 2011 9:53:46 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r87466 r87467 1 2011-05-26 Emil A Eklund <eae@chromium.org> 2 3 Reviewed by Eric Seidel. 4 5 Replace RenderLayer::x/y/width/height with location/size 6 https://bugs.webkit.org/show_bug.cgi?id=61414 7 8 Covered by existing tests. 9 10 * dom/MouseRelatedEvent.cpp: 11 (WebCore::MouseRelatedEvent::computeRelativePosition): 12 * rendering/RenderBox.cpp: 13 (WebCore::RenderBox::computeRectForRepaint): 14 * rendering/RenderBox.h: 15 (WebCore::RenderBox::maxLayoutOverflow): 16 * rendering/RenderInline.cpp: 17 (WebCore::RenderInline::clippedOverflowRectForRepaint): 18 (WebCore::RenderInline::computeRectForRepaint): 19 * rendering/RenderLayer.cpp: 20 (WebCore::RenderLayer::updateLayerPosition): 21 (WebCore::RenderLayer::convertToLayerCoords): 22 (WebCore::RenderLayer::offsetFromResizeCorner): 23 (WebCore::RenderLayer::calculateRects): 24 * rendering/RenderLayer.h: 25 (WebCore::RenderLayer::location): 26 (WebCore::RenderLayer::setSize): 27 * rendering/RenderObject.cpp: 28 (WebCore::RenderObject::computeRectForRepaint): 29 * rendering/RenderTreeAsText.cpp: 30 (WebCore::write): 31 (WebCore::writeLayers): 32 (WebCore::externalRepresentation): 33 * rendering/RenderView.cpp: 34 (WebCore::RenderView::absoluteRects): 35 (WebCore::RenderView::absoluteQuads): 36 1 37 2011-05-26 Annie Sullivan <sullivan@chromium.org> 2 38 -
trunk/Source/WebCore/dom/MouseRelatedEvent.cpp
r82584 r87467 205 205 layer->updateLayerPosition(); 206 206 for (; layer; layer = layer->parent()) { 207 m_layerX -= layer->x(); 208 m_layerY -= layer->y(); 207 const IntPoint& location = layer->location(); 208 m_layerX -= location.x(); 209 m_layerY -= location.y(); 209 210 } 210 211 } -
trunk/Source/WebCore/rendering/RenderBox.cpp
r87443 r87467 1507 1507 1508 1508 IntRect repaintRect(topLeft, rect.size()); 1509 IntRect boxRect( 0, 0, containerBox->layer()->width(), containerBox->layer()->height());1509 IntRect boxRect(IntPoint(), containerBox->layer()->size()); 1510 1510 rect = intersection(repaintRect, boxRect); 1511 1511 if (rect.isEmpty()) -
trunk/Source/WebCore/rendering/RenderBox.h
r87443 r87467 145 145 int minXLayoutOverflow() const { return m_overflow ? m_overflow->minXLayoutOverflow() : borderLeft(); } 146 146 int maxXLayoutOverflow() const { return m_overflow ? m_overflow->maxXLayoutOverflow() : borderLeft() + clientWidth(); } 147 IntSize maxLayoutOverflow() const { return IntSize(maxXLayoutOverflow(), maxYLayoutOverflow()); } 147 148 int logicalLeftLayoutOverflow() const { return style()->isHorizontalWritingMode() ? minXLayoutOverflow() : minYLayoutOverflow(); } 148 149 int logicalRightLayoutOverflow() const { return style()->isHorizontalWritingMode() ? maxXLayoutOverflow() : maxYLayoutOverflow(); } -
trunk/Source/WebCore/rendering/RenderInline.cpp
r87387 r87467 990 990 repaintRect.move(-cb->layer()->scrolledContentOffset()); // For overflow:auto/scroll/hidden. 991 991 992 IntRect boxRect( 0, 0, cb->layer()->width(), cb->layer()->height());992 IntRect boxRect(IntPoint(), cb->layer()->size()); 993 993 r = intersection(repaintRect, boxRect); 994 994 } … … 1080 1080 1081 1081 IntRect repaintRect(topLeft, rect.size()); 1082 IntRect boxRect( 0, 0, containerBox->layer()->width(), containerBox->layer()->height());1082 IntRect boxRect(IntPoint(), containerBox->layer()->size()); 1083 1083 rect = intersection(repaintRect, boxRect); 1084 1084 if (rect.isEmpty()) -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r87437 r87467 652 652 RenderInline* inlineFlow = toRenderInline(renderer()); 653 653 IntRect lineBox = inlineFlow->linesBoundingBox(); 654 setWidth(lineBox.width()); 655 setHeight(lineBox.height()); 656 inlineBoundingBoxOffset = IntSize(lineBox.x(), lineBox.y()); 654 setSize(lineBox.size()); 655 inlineBoundingBoxOffset = toSize(lineBox.location()); 657 656 localPoint += inlineBoundingBoxOffset; 658 657 } else if (RenderBox* box = renderBox()) { 659 setWidth(box->width()); 660 setHeight(box->height()); 658 setSize(box->size()); 661 659 localPoint += box->locationOffsetIncludingFlipping(); 662 660 } … … 1205 1203 1206 1204 parentLayer->convertToLayerCoords(ancestorLayer, xPos, yPos); 1207 1208 xPos += x();1209 yPos += y();1205 1206 xPos += m_topLeft.x(); 1207 yPos += m_topLeft.y(); 1210 1208 } 1211 1209 … … 2007 2005 { 2008 2006 // Currently the resize corner is always the bottom right corner 2009 IntPoint bottomRight(width(), height()); 2007 // FIXME: This assumes the location is 0, 0. Is this guaranteed to always be the case? 2008 IntPoint bottomRight = toPoint(size()); 2010 2009 IntPoint localPoint = absoluteToContents(absolutePoint); 2011 2010 return localPoint - bottomRight; … … 3452 3451 int y = 0; 3453 3452 convertToLayerCoords(rootLayer, x, y); 3454 layerBounds = IntRect( x, y, width(), height());3453 layerBounds = IntRect(IntPoint(x, y), size()); 3455 3454 3456 3455 // Update the clip rects that will be passed to child layers. -
trunk/Source/WebCore/rendering/RenderLayer.h
r87437 r87467 212 212 } 213 213 214 int x() const { return m_topLeft.x(); } 215 int y() const { return m_topLeft.y(); } 216 void setLocation(int x, int y) 217 { 218 m_topLeft = IntPoint(x, y); 219 } 220 221 int width() const { return m_layerSize.width(); } 222 int height() const { return m_layerSize.height(); } 214 const IntPoint& location() const { return m_topLeft; } 215 void setLocation(int x, int y) { m_topLeft = IntPoint(x, y); } 216 223 217 const IntSize& size() const { return m_layerSize; } 224 225 void setWidth(int w) { m_layerSize.setWidth(w); } 226 void setHeight(int h) { m_layerSize.setHeight(h); }218 void setSize(const IntSize& size) { m_layerSize = size; } 219 220 IntRect rect() const { return IntRect(location(), size()); } 227 221 228 222 int scrollWidth(); -
trunk/Source/WebCore/rendering/RenderObject.cpp
r87302 r87467 1388 1388 repaintRect.move(-boxParent->layer()->scrolledContentOffset()); // For overflow:auto/scroll/hidden. 1389 1389 1390 IntRect boxRect( 0, 0, boxParent->layer()->width(), boxParent->layer()->height());1390 IntRect boxRect(IntPoint(), boxParent->layer()->size()); 1391 1391 rect = intersection(repaintRect, boxRect); 1392 1392 if (rect.isEmpty()) -
trunk/Source/WebCore/rendering/RenderTreeAsText.cpp
r85864 r87467 581 581 RenderLayer* l = root->layer(); 582 582 if (l) 583 writeLayers(ts, l, l, IntRect(l->x(), l->y(), l->width(), l->height()), indent + 1, behavior);583 writeLayers(ts, l, l, l->rect(), indent + 1, behavior); 584 584 } 585 585 } … … 654 654 paintDirtyRect.setWidth(max(paintDirtyRect.width(), rootLayer->renderBox()->maxXLayoutOverflow())); 655 655 paintDirtyRect.setHeight(max(paintDirtyRect.height(), rootLayer->renderBox()->maxYLayoutOverflow())); 656 l->setWidth(max(l->width(), l->renderBox()->maxXLayoutOverflow())); 657 l->setHeight(max(l->height(), l->renderBox()->maxYLayoutOverflow())); 656 l->setSize(l->size().expandedTo(l->renderBox()->maxLayoutOverflow())); 658 657 } 659 658 … … 777 776 if (o->hasLayer()) { 778 777 RenderLayer* l = toRenderBox(o)->layer(); 779 writeLayers(ts, l, l, IntRect(l->x(), l->y(), l->width(), l->height()), 0, behavior);778 writeLayers(ts, l, l, l->rect(), 0, behavior); 780 779 writeSelection(ts, o); 781 780 } -
trunk/Source/WebCore/rendering/RenderView.cpp
r87303 r87467 324 324 void RenderView::absoluteRects(Vector<IntRect>& rects, int tx, int ty) 325 325 { 326 rects.append(IntRect( tx, ty, m_layer->width(), m_layer->height()));326 rects.append(IntRect(IntPoint(tx, ty), m_layer->size())); 327 327 } 328 328 329 329 void RenderView::absoluteQuads(Vector<FloatQuad>& quads) 330 330 { 331 quads.append(FloatRect( 0, 0, m_layer->width(), m_layer->height()));331 quads.append(FloatRect(FloatPoint(), m_layer->size())); 332 332 } 333 333
Note: See TracChangeset
for help on using the changeset viewer.