Changeset 88202 in webkit
- Timestamp:
- Jun 6, 2011 4:45:22 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r88200 r88202 1 2011-06-06 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/RenderBlock.cpp: 13 (WebCore::RenderBlock::absoluteRects): 14 * rendering/RenderBlock.h: 15 * rendering/RenderBox.cpp: 16 (WebCore::RenderBox::absoluteRects): 17 * rendering/RenderBox.h: 18 * rendering/RenderInline.cpp: 19 (WebCore::RenderInline::absoluteRects): 20 * rendering/RenderInline.h: 21 * rendering/RenderObject.cpp: 22 (WebCore::RenderObject::absoluteBoundingBoxRect): 23 * rendering/RenderObject.h: 24 (WebCore::RenderObject::absoluteRects): 25 * rendering/RenderText.cpp: 26 (WebCore::RenderText::absoluteRects): 27 * rendering/RenderText.h: 28 * rendering/RenderView.cpp: 29 (WebCore::RenderView::absoluteRects): 30 * rendering/RenderView.h: 31 1 32 2011-06-06 Levi Weintraub <leviw@chromium.org> 2 33 -
trunk/Source/WebCore/dom/Node.cpp
r87991 r88202 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
r87964 r88202 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
r88198 r88202 5666 5666 } 5667 5667 5668 void RenderBlock::absoluteRects(Vector<IntRect>& rects, int tx, int ty)5668 void RenderBlock::absoluteRects(Vector<IntRect>& rects, const IntPoint& accumulatedOffset) 5669 5669 { 5670 5670 // For blocks inside inlines, we go ahead and include margins so that we run right up to the … … 5674 5674 // FIXME: This is wrong for block-flows that are horizontal. 5675 5675 // https://bugs.webkit.org/show_bug.cgi?id=46781 5676 rects.append(IntRect( tx, ty- collapsedMarginBefore(),5676 rects.append(IntRect(accumulatedOffset.x(), accumulatedOffset.y() - collapsedMarginBefore(), 5677 5677 width(), height() + collapsedMarginBefore() + collapsedMarginAfter())); 5678 continuation()->absoluteRects(rects, 5679 tx - x() + inlineElementContinuation()->containingBlock()->x(), 5680 ty - y() + inlineElementContinuation()->containingBlock()->y()); 5678 continuation()->absoluteRects(rects, accumulatedOffset - toSize(location() + 5679 inlineElementContinuation()->containingBlock()->location())); 5681 5680 } else 5682 rects.append(IntRect( tx, ty, width(), height()));5681 rects.append(IntRect(accumulatedOffset, size())); 5683 5682 } 5684 5683 -
trunk/Source/WebCore/rendering/RenderBlock.h
r88190 r88202 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
r88198 r88202 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
r88198 r88202 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
r88195 r88202 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
r88190 r88202 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
r88195 r88202 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
r88195 r88202 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
r88188 r88202 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
r86708 r88202 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
r88087 r88202 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
r88033 r88202 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
Note: See TracChangeset
for help on using the changeset viewer.