Changeset 88297 in webkit
- Timestamp:
- Jun 7, 2011 5:30:08 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r88294 r88297 1 2011-06-07 Emil A Eklund <eae@chromium.org> 2 3 Reviewed by Eric Seidel. 4 5 Convert RenderBox::absoluteRects to IntPoint 6 https://bugs.webkit.org/show_bug.cgi?id=62130 7 8 Covered by existing tests. 9 10 * dom/Node.cpp: 11 (WebCore::Node::hasNonEmptyBoundingBox): 12 * rendering/InlineBox.h: 13 (WebCore::InlineBox::size): 14 * rendering/RenderBlock.cpp: 15 (WebCore::RenderBlock::absoluteRects): 16 * rendering/RenderBlock.h: 17 * rendering/RenderBox.cpp: 18 (WebCore::RenderBox::absoluteRects): 19 * rendering/RenderBox.h: 20 * rendering/RenderInline.cpp: 21 (WebCore::RenderInline::absoluteRects): 22 * rendering/RenderInline.h: 23 * rendering/RenderObject.cpp: 24 (WebCore::RenderObject::absoluteBoundingBoxRect): 25 * rendering/RenderObject.h: 26 (WebCore::RenderObject::absoluteRects): 27 * rendering/RenderText.cpp: 28 (WebCore::RenderText::absoluteRects): 29 * rendering/RenderText.h: 30 * rendering/RenderView.cpp: 31 (WebCore::RenderView::absoluteRects): 32 * rendering/RenderView.h: 33 * rendering/svg/RenderSVGBlock.cpp: 34 (WebCore::RenderSVGBlock::absoluteRects): 35 * rendering/svg/RenderSVGBlock.h: 36 * rendering/svg/RenderSVGModelObject.cpp: 37 (WebCore::RenderSVGModelObject::absoluteRects): 38 * rendering/svg/RenderSVGModelObject.h: 39 1 40 2011-06-07 Kent Tamura <tkent@chromium.org> 2 41 -
trunk/Source/WebCore/dom/Node.cpp
r88213 r88297 840 840 Vector<IntRect> rects; 841 841 FloatPoint absPos = renderer()->localToAbsolute(); 842 renderer()->absoluteRects(rects, absPos.x(), absPos.y());842 renderer()->absoluteRects(rects, flooredIntPoint(absPos)); 843 843 size_t n = rects.size(); 844 844 for (size_t i = 0; i < n; ++i) -
trunk/Source/WebCore/rendering/InlineBox.h
r88213 r88297 237 237 float width() const { return isHorizontal() ? logicalWidth() : logicalHeight(); } 238 238 float height() const { return isHorizontal() ? logicalHeight() : logicalWidth(); } 239 FloatSize size() const { return IntSize(width(), height()); } 239 240 float right() const { return left() + width(); } 240 241 float bottom() const { return top() + height(); } -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r88282 r88297 5665 5665 } 5666 5666 5667 void RenderBlock::absoluteRects(Vector<IntRect>& rects, int tx, int ty)5667 void RenderBlock::absoluteRects(Vector<IntRect>& rects, const IntPoint& accumulatedOffset) 5668 5668 { 5669 5669 // For blocks inside inlines, we go ahead and include margins so that we run right up to the … … 5673 5673 // FIXME: This is wrong for block-flows that are horizontal. 5674 5674 // https://bugs.webkit.org/show_bug.cgi?id=46781 5675 rects.append(IntRect( tx, ty- collapsedMarginBefore(),5675 rects.append(IntRect(accumulatedOffset.x(), accumulatedOffset.y() - collapsedMarginBefore(), 5676 5676 width(), height() + collapsedMarginBefore() + collapsedMarginAfter())); 5677 continuation()->absoluteRects(rects, 5678 tx - x() + inlineElementContinuation()->containingBlock()->x(), 5679 ty - y() + inlineElementContinuation()->containingBlock()->y()); 5677 continuation()->absoluteRects(rects, accumulatedOffset - toSize(location() + 5678 inlineElementContinuation()->containingBlock()->location())); 5680 5679 } else 5681 rects.append(IntRect( tx, ty, width(), height()));5680 rects.append(IntRect(accumulatedOffset, size())); 5682 5681 } 5683 5682 -
trunk/Source/WebCore/rendering/RenderBlock.h
r88282 r88297 626 626 int logicalRightSelectionOffset(RenderBlock* rootBlock, int position); 627 627 628 virtual void absoluteRects(Vector<IntRect>&, int tx, int ty);628 virtual void absoluteRects(Vector<IntRect>&, const IntPoint& accumulatedOffset); 629 629 virtual void absoluteQuads(Vector<FloatQuad>&); 630 630 -
trunk/Source/WebCore/rendering/RenderBox.cpp
r88250 r88297 456 456 } 457 457 458 void RenderBox::absoluteRects(Vector<IntRect>& rects, int tx, int ty)459 { 460 rects.append(IntRect( tx, ty, width(), height()));458 void RenderBox::absoluteRects(Vector<IntRect>& rects, const IntPoint& accumulatedOffset) 459 { 460 rects.append(IntRect(accumulatedOffset, size())); 461 461 } 462 462 -
trunk/Source/WebCore/rendering/RenderBox.h
r88250 r88297 231 231 virtual int collapsedMarginAfter() const { return marginAfter(); } 232 232 233 virtual void absoluteRects(Vector<IntRect>&, int tx, int ty);233 virtual void absoluteRects(Vector<IntRect>&, const IntPoint& accumulatedOffset); 234 234 virtual void absoluteQuads(Vector<FloatQuad>&); 235 235 -
trunk/Source/WebCore/rendering/RenderInline.cpp
r88250 r88297 466 466 } 467 467 468 void RenderInline::absoluteRects(Vector<IntRect>& rects, int tx, int ty)468 void RenderInline::absoluteRects(Vector<IntRect>& rects, const IntPoint& accumulatedOffset) 469 469 { 470 470 if (!alwaysCreateLineBoxes()) 471 culledInlineAbsoluteRects(this, rects, IntSize(tx, ty));471 culledInlineAbsoluteRects(this, rects, toSize(accumulatedOffset)); 472 472 else if (InlineFlowBox* curr = firstLineBox()) { 473 473 for (; curr; curr = curr->nextLineBox()) 474 rects.append(enclosingIntRect(FloatRect( tx + curr->x(), ty + curr->y(), curr->width(), curr->height())));474 rects.append(enclosingIntRect(FloatRect(accumulatedOffset + curr->topLeft(), curr->size()))); 475 475 } else 476 rects.append(IntRect( tx, ty, 0, 0));476 rects.append(IntRect(accumulatedOffset, IntSize())); 477 477 478 478 if (continuation()) { 479 479 if (continuation()->isBox()) { 480 480 RenderBox* box = toRenderBox(continuation()); 481 continuation()->absoluteRects(rects, 482 tx - containingBlock()->x() + box->x(), 483 ty - containingBlock()->y() + box->y()); 481 continuation()->absoluteRects(rects, toPoint(accumulatedOffset - containingBlock()->location() + box->size())); 484 482 } else 485 continuation()->absoluteRects(rects, t x - containingBlock()->x(), ty - containingBlock()->y());483 continuation()->absoluteRects(rects, toPoint(accumulatedOffset - containingBlock()->location())); 486 484 } 487 485 } -
trunk/Source/WebCore/rendering/RenderInline.h
r88250 r88297 49 49 virtual int marginEnd() const; 50 50 51 virtual void absoluteRects(Vector<IntRect>&, int tx, int ty);51 virtual void absoluteRects(Vector<IntRect>&, const IntPoint& accumulatedOffset); 52 52 virtual void absoluteQuads(Vector<FloatQuad>&); 53 53 -
trunk/Source/WebCore/rendering/RenderObject.cpp
r88270 r88297 1100 1100 FloatPoint absPos = localToAbsolute(); 1101 1101 Vector<IntRect> rects; 1102 absoluteRects(rects, absPos.x(), absPos.y());1102 absoluteRects(rects, flooredIntPoint(absPos)); 1103 1103 1104 1104 size_t n = rects.size(); -
trunk/Source/WebCore/rendering/RenderObject.h
r88250 r88297 591 591 IntSize offsetFromAncestorContainer(RenderObject*) const; 592 592 593 virtual void absoluteRects(Vector<IntRect>&, int, int) { }593 virtual void absoluteRects(Vector<IntRect>&, const IntPoint&) { } 594 594 // FIXME: useTransforms should go away eventually 595 595 IntRect absoluteBoundingBoxRect(bool useTransforms = false); -
trunk/Source/WebCore/rendering/RenderText.cpp
r88213 r88297 270 270 } 271 271 272 void RenderText::absoluteRects(Vector<IntRect>& rects, int tx, int ty)272 void RenderText::absoluteRects(Vector<IntRect>& rects, const IntPoint& accumulatedOffset) 273 273 { 274 274 for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) 275 rects.append(enclosingIntRect(FloatRect( tx + box->x(), ty + box->y(), box->width(), box->height())));275 rects.append(enclosingIntRect(FloatRect(accumulatedOffset + box->topLeft(), box->size()))); 276 276 } 277 277 -
trunk/Source/WebCore/rendering/RenderText.h
r88250 r88297 57 57 void dirtyLineBoxes(bool fullLayout); 58 58 59 virtual void absoluteRects(Vector<IntRect>&, int tx, int ty);59 virtual void absoluteRects(Vector<IntRect>&, const IntPoint& accumulatedOffset); 60 60 void absoluteRectsForRange(Vector<IntRect>&, unsigned startOffset = 0, unsigned endOffset = UINT_MAX, bool useSelectionHeight = false); 61 61 -
trunk/Source/WebCore/rendering/RenderView.cpp
r88250 r88297 322 322 } 323 323 324 void RenderView::absoluteRects(Vector<IntRect>& rects, int tx, int ty)325 { 326 rects.append(IntRect( IntPoint(tx, ty), m_layer->size()));324 void RenderView::absoluteRects(Vector<IntRect>& rects, const IntPoint& accumulatedOffset) 325 { 326 rects.append(IntRect(accumulatedOffset, m_layer->size())); 327 327 } 328 328 -
trunk/Source/WebCore/rendering/RenderView.h
r88250 r88297 83 83 bool printing() const; 84 84 85 virtual void absoluteRects(Vector<IntRect>&, int tx, int ty);85 virtual void absoluteRects(Vector<IntRect>&, const IntPoint& accumulatedOffset); 86 86 virtual void absoluteQuads(Vector<FloatQuad>&); 87 87 -
trunk/Source/WebCore/rendering/svg/RenderSVGBlock.cpp
r75351 r88297 69 69 } 70 70 71 void RenderSVGBlock::absoluteRects(Vector<IntRect>&, int, int)71 void RenderSVGBlock::absoluteRects(Vector<IntRect>&, const IntPoint&) 72 72 { 73 73 // This code path should never be taken for SVG, as we're assuming useTransforms=true everywhere, absoluteQuads should be used. -
trunk/Source/WebCore/rendering/svg/RenderSVGBlock.h
r75350 r88297 37 37 virtual void updateBoxModelInfoFromStyle(); 38 38 39 virtual void absoluteRects(Vector<IntRect>&, int tx, int ty);39 virtual void absoluteRects(Vector<IntRect>&, const IntPoint& accumulatedOffset); 40 40 41 41 virtual void destroy(); -
trunk/Source/WebCore/rendering/svg/RenderSVGModelObject.cpp
r86705 r88297 71 71 } 72 72 73 void RenderSVGModelObject::absoluteRects(Vector<IntRect>&, int, int)73 void RenderSVGModelObject::absoluteRects(Vector<IntRect>&, const IntPoint&) 74 74 { 75 75 // This code path should never be taken for SVG, as we're assuming useTransforms=true everywhere, absoluteQuads should be used. -
trunk/Source/WebCore/rendering/svg/RenderSVGModelObject.h
r86705 r88297 56 56 virtual IntRect outlineBoundsForRepaint(RenderBoxModelObject* repaintContainer, IntPoint*) const; 57 57 58 virtual void absoluteRects(Vector<IntRect>&, int tx, int ty);58 virtual void absoluteRects(Vector<IntRect>&, const IntPoint& accumulatedOffset); 59 59 virtual void absoluteQuads(Vector<FloatQuad>&); 60 60
Note: See TracChangeset
for help on using the changeset viewer.