Changeset 90530 in webkit
- Timestamp:
- Jul 6, 2011 8:48:15 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r90525 r90530 1 2011-07-06 Emil A Eklund <eae@chromium.org> 2 3 Switch absoluteRects to to new layout types 4 https://bugs.webkit.org/show_bug.cgi?id=64035 5 6 Reviewed by Eric Seidel. 7 8 Move absoluteRects over to new layout unit abstraction. 9 Add flooredLayoutPoint, mapped to flooredIntPoint. 10 11 No new tests, no functionality changes. 12 13 * rendering/LayoutTypes.h: 14 (WebCore::flooredLayoutPoint): 15 * rendering/RenderBlock.cpp: 16 (WebCore::RenderBlock::absoluteRects): 17 * rendering/RenderBlock.h: 18 * rendering/RenderBox.cpp: 19 (WebCore::RenderBox::absoluteRects): 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-07-06 Emil A Eklund <eae@chromium.org> 2 41 -
trunk/Source/WebCore/rendering/LayoutTypes.h
r90525 r90530 58 58 } 59 59 60 inline LayoutPoint flooredLayoutPoint(const FloatPoint& p) 61 { 62 return flooredIntPoint(p); 63 } 64 60 65 inline LayoutUnit roundedLayoutUnit(float value) 61 66 { -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r90515 r90530 5714 5714 } 5715 5715 5716 void RenderBlock::absoluteRects(Vector< IntRect>& rects, const IntPoint& accumulatedOffset)5716 void RenderBlock::absoluteRects(Vector<LayoutRect>& rects, const LayoutPoint& accumulatedOffset) 5717 5717 { 5718 5718 // For blocks inside inlines, we go ahead and include margins so that we run right up to the … … 5722 5722 // FIXME: This is wrong for block-flows that are horizontal. 5723 5723 // https://bugs.webkit.org/show_bug.cgi?id=46781 5724 rects.append( IntRect(accumulatedOffset.x(), accumulatedOffset.y() - collapsedMarginBefore(),5725 width(), height() + collapsedMarginBefore() + collapsedMarginAfter()));5726 continuation()->absoluteRects(rects, accumulatedOffset - to Size(location() +5724 rects.append(LayoutRect(accumulatedOffset.x(), accumulatedOffset.y() - collapsedMarginBefore(), 5725 width(), height() + collapsedMarginBefore() + collapsedMarginAfter())); 5726 continuation()->absoluteRects(rects, accumulatedOffset - toLayoutSize(location() + 5727 5727 inlineElementContinuation()->containingBlock()->location())); 5728 5728 } else 5729 rects.append( IntRect(accumulatedOffset, size()));5729 rects.append(LayoutRect(accumulatedOffset, size())); 5730 5730 } 5731 5731 -
trunk/Source/WebCore/rendering/RenderBlock.h
r90517 r90530 630 630 int logicalRightSelectionOffset(RenderBlock* rootBlock, int position); 631 631 632 virtual void absoluteRects(Vector< IntRect>&, const IntPoint& accumulatedOffset);632 virtual void absoluteRects(Vector<LayoutRect>&, const LayoutPoint& accumulatedOffset); 633 633 virtual void absoluteQuads(Vector<FloatQuad>&); 634 634 -
trunk/Source/WebCore/rendering/RenderBox.cpp
r90525 r90530 460 460 } 461 461 462 void RenderBox::absoluteRects(Vector< IntRect>& rects, const IntPoint& accumulatedOffset)463 { 464 rects.append( IntRect(accumulatedOffset, size()));462 void RenderBox::absoluteRects(Vector<LayoutRect>& rects, const LayoutPoint& accumulatedOffset) 463 { 464 rects.append(LayoutRect(accumulatedOffset, size())); 465 465 } 466 466 -
trunk/Source/WebCore/rendering/RenderInline.cpp
r90525 r90530 466 466 } 467 467 468 void RenderInline::absoluteRects(Vector< IntRect>& rects, const IntPoint& accumulatedOffset)468 void RenderInline::absoluteRects(Vector<LayoutRect>& rects, const LayoutPoint& accumulatedOffset) 469 469 { 470 470 if (!alwaysCreateLineBoxes()) 471 culledInlineAbsoluteRects(this, rects, to Size(accumulatedOffset));471 culledInlineAbsoluteRects(this, rects, toLayoutSize(accumulatedOffset)); 472 472 else if (InlineFlowBox* curr = firstLineBox()) { 473 473 for (; curr; curr = curr->nextLineBox()) 474 rects.append(enclosing IntRect(FloatRect(accumulatedOffset + curr->topLeft(), curr->size())));474 rects.append(enclosingLayoutRect(FloatRect(accumulatedOffset + curr->topLeft(), curr->size()))); 475 475 } else 476 rects.append( IntRect(accumulatedOffset, IntSize()));476 rects.append(LayoutRect(accumulatedOffset, LayoutSize())); 477 477 478 478 if (continuation()) { 479 479 if (continuation()->isBox()) { 480 480 RenderBox* box = toRenderBox(continuation()); 481 continuation()->absoluteRects(rects, to Point(accumulatedOffset - containingBlock()->location() + box->size()));481 continuation()->absoluteRects(rects, toLayoutPoint(accumulatedOffset - containingBlock()->location() + box->size())); 482 482 } else 483 continuation()->absoluteRects(rects, to Point(accumulatedOffset - containingBlock()->location()));483 continuation()->absoluteRects(rects, toLayoutPoint(accumulatedOffset - containingBlock()->location())); 484 484 } 485 485 } -
trunk/Source/WebCore/rendering/RenderInline.h
r90525 r90530 49 49 virtual LayoutUnit marginEnd() const; 50 50 51 virtual void absoluteRects(Vector< IntRect>&, const IntPoint& accumulatedOffset);51 virtual void absoluteRects(Vector<LayoutRect>&, const LayoutPoint& accumulatedOffset); 52 52 virtual void absoluteQuads(Vector<FloatQuad>&); 53 53 -
trunk/Source/WebCore/rendering/RenderObject.cpp
r90525 r90530 1108 1108 FloatPoint absPos = localToAbsolute(); 1109 1109 Vector<IntRect> rects; 1110 absoluteRects(rects, floored IntPoint(absPos));1110 absoluteRects(rects, flooredLayoutPoint(absPos)); 1111 1111 1112 1112 size_t n = rects.size(); -
trunk/Source/WebCore/rendering/RenderObject.h
r90525 r90530 593 593 LayoutSize offsetFromAncestorContainer(RenderObject*) const; 594 594 595 virtual void absoluteRects(Vector< IntRect>&, const IntPoint&) { }595 virtual void absoluteRects(Vector<LayoutRect>&, const LayoutPoint&) { } 596 596 // FIXME: useTransforms should go away eventually 597 597 IntRect absoluteBoundingBoxRect(bool useTransforms = false); -
trunk/Source/WebCore/rendering/RenderText.cpp
r90250 r90530 270 270 } 271 271 272 void RenderText::absoluteRects(Vector< IntRect>& rects, const IntPoint& accumulatedOffset)272 void RenderText::absoluteRects(Vector<LayoutRect>& rects, const LayoutPoint& accumulatedOffset) 273 273 { 274 274 for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) 275 rects.append(enclosing IntRect(FloatRect(accumulatedOffset + box->topLeft(), box->size())));275 rects.append(enclosingLayoutRect(FloatRect(accumulatedOffset + box->topLeft(), box->size()))); 276 276 } 277 277 -
trunk/Source/WebCore/rendering/RenderText.h
r90515 r90530 57 57 void dirtyLineBoxes(bool fullLayout); 58 58 59 virtual void absoluteRects(Vector< IntRect>&, const IntPoint& accumulatedOffset);59 virtual void absoluteRects(Vector<LayoutRect>&, const LayoutPoint& 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
r90302 r90530 323 323 } 324 324 325 void RenderView::absoluteRects(Vector< IntRect>& rects, const IntPoint& accumulatedOffset)326 { 327 rects.append( IntRect(accumulatedOffset, m_layer->size()));325 void RenderView::absoluteRects(Vector<LayoutRect>& rects, const LayoutPoint& accumulatedOffset) 326 { 327 rects.append(LayoutRect(accumulatedOffset, m_layer->size())); 328 328 } 329 329 -
trunk/Source/WebCore/rendering/RenderView.h
r90302 r90530 83 83 bool printing() const; 84 84 85 virtual void absoluteRects(Vector< IntRect>&, const IntPoint& accumulatedOffset);85 virtual void absoluteRects(Vector<LayoutRect>&, const LayoutPoint& accumulatedOffset); 86 86 virtual void absoluteQuads(Vector<FloatQuad>&); 87 87 -
trunk/Source/WebCore/rendering/svg/RenderSVGBlock.cpp
r88297 r90530 69 69 } 70 70 71 void RenderSVGBlock::absoluteRects(Vector< IntRect>&, const IntPoint&)71 void RenderSVGBlock::absoluteRects(Vector<LayoutRect>&, const LayoutPoint&) 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
r88297 r90530 37 37 virtual void updateBoxModelInfoFromStyle(); 38 38 39 virtual void absoluteRects(Vector< IntRect>&, const IntPoint& accumulatedOffset);39 virtual void absoluteRects(Vector<LayoutRect>&, const LayoutPoint& accumulatedOffset); 40 40 41 41 virtual void destroy(); -
trunk/Source/WebCore/rendering/svg/RenderSVGModelObject.cpp
r90515 r90530 71 71 } 72 72 73 void RenderSVGModelObject::absoluteRects(Vector< IntRect>&, const IntPoint&)73 void RenderSVGModelObject::absoluteRects(Vector<LayoutRect>&, const LayoutPoint&) 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
r90515 r90530 56 56 virtual IntRect outlineBoundsForRepaint(RenderBoxModelObject* repaintContainer, IntPoint*) const; 57 57 58 virtual void absoluteRects(Vector< IntRect>&, const IntPoint& accumulatedOffset);58 virtual void absoluteRects(Vector<LayoutRect>&, const LayoutPoint& accumulatedOffset); 59 59 virtual void absoluteQuads(Vector<FloatQuad>&); 60 60
Note: See TracChangeset
for help on using the changeset viewer.