Changeset 90530 in webkit


Ignore:
Timestamp:
Jul 6, 2011 8:48:15 PM (13 years ago)
Author:
eae@chromium.org
Message:

2011-07-06 Emil A Eklund <eae@chromium.org>

Switch absoluteRects to to new layout types
https://bugs.webkit.org/show_bug.cgi?id=64035

Reviewed by Eric Seidel.

Move absoluteRects over to new layout unit abstraction.
Add flooredLayoutPoint, mapped to flooredIntPoint.

No new tests, no functionality changes.

  • rendering/LayoutTypes.h: (WebCore::flooredLayoutPoint):
  • rendering/RenderBlock.cpp: (WebCore::RenderBlock::absoluteRects):
  • rendering/RenderBlock.h:
  • rendering/RenderBox.cpp: (WebCore::RenderBox::absoluteRects):
  • rendering/RenderInline.cpp: (WebCore::RenderInline::absoluteRects):
  • rendering/RenderInline.h:
  • rendering/RenderObject.cpp: (WebCore::RenderObject::absoluteBoundingBoxRect):
  • rendering/RenderObject.h: (WebCore::RenderObject::absoluteRects):
  • rendering/RenderText.cpp: (WebCore::RenderText::absoluteRects):
  • rendering/RenderText.h:
  • rendering/RenderView.cpp: (WebCore::RenderView::absoluteRects):
  • rendering/RenderView.h:
  • rendering/svg/RenderSVGBlock.cpp: (WebCore::RenderSVGBlock::absoluteRects):
  • rendering/svg/RenderSVGBlock.h:
  • rendering/svg/RenderSVGModelObject.cpp: (WebCore::RenderSVGModelObject::absoluteRects):
  • rendering/svg/RenderSVGModelObject.h:
Location:
trunk/Source/WebCore
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r90525 r90530  
     12011-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
    1402011-07-06  Emil A Eklund  <eae@chromium.org>
    241
  • trunk/Source/WebCore/rendering/LayoutTypes.h

    r90525 r90530  
    5858}
    5959
     60inline LayoutPoint flooredLayoutPoint(const FloatPoint& p)
     61{
     62    return flooredIntPoint(p);
     63}
     64
    6065inline LayoutUnit roundedLayoutUnit(float value)
    6166{
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r90515 r90530  
    57145714}
    57155715
    5716 void RenderBlock::absoluteRects(Vector<IntRect>& rects, const IntPoint& accumulatedOffset)
     5716void RenderBlock::absoluteRects(Vector<LayoutRect>& rects, const LayoutPoint& accumulatedOffset)
    57175717{
    57185718    // For blocks inside inlines, we go ahead and include margins so that we run right up to the
     
    57225722        // FIXME: This is wrong for block-flows that are horizontal.
    57235723        // 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 - toSize(location() +
     5724        rects.append(LayoutRect(accumulatedOffset.x(), accumulatedOffset.y() - collapsedMarginBefore(),
     5725                                width(), height() + collapsedMarginBefore() + collapsedMarginAfter()));
     5726        continuation()->absoluteRects(rects, accumulatedOffset - toLayoutSize(location() +
    57275727                inlineElementContinuation()->containingBlock()->location()));
    57285728    } else
    5729         rects.append(IntRect(accumulatedOffset, size()));
     5729        rects.append(LayoutRect(accumulatedOffset, size()));
    57305730}
    57315731
  • trunk/Source/WebCore/rendering/RenderBlock.h

    r90517 r90530  
    630630    int logicalRightSelectionOffset(RenderBlock* rootBlock, int position);
    631631   
    632     virtual void absoluteRects(Vector<IntRect>&, const IntPoint& accumulatedOffset);
     632    virtual void absoluteRects(Vector<LayoutRect>&, const LayoutPoint& accumulatedOffset);
    633633    virtual void absoluteQuads(Vector<FloatQuad>&);
    634634
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r90525 r90530  
    460460}
    461461
    462 void RenderBox::absoluteRects(Vector<IntRect>& rects, const IntPoint& accumulatedOffset)
    463 {
    464     rects.append(IntRect(accumulatedOffset, size()));
     462void RenderBox::absoluteRects(Vector<LayoutRect>& rects, const LayoutPoint& accumulatedOffset)
     463{
     464    rects.append(LayoutRect(accumulatedOffset, size()));
    465465}
    466466
  • trunk/Source/WebCore/rendering/RenderInline.cpp

    r90525 r90530  
    466466}
    467467
    468 void RenderInline::absoluteRects(Vector<IntRect>& rects, const IntPoint& accumulatedOffset)
     468void RenderInline::absoluteRects(Vector<LayoutRect>& rects, const LayoutPoint& accumulatedOffset)
    469469{
    470470    if (!alwaysCreateLineBoxes())
    471         culledInlineAbsoluteRects(this, rects, toSize(accumulatedOffset));
     471        culledInlineAbsoluteRects(this, rects, toLayoutSize(accumulatedOffset));
    472472    else if (InlineFlowBox* curr = firstLineBox()) {
    473473        for (; curr; curr = curr->nextLineBox())
    474             rects.append(enclosingIntRect(FloatRect(accumulatedOffset + curr->topLeft(), curr->size())));
     474            rects.append(enclosingLayoutRect(FloatRect(accumulatedOffset + curr->topLeft(), curr->size())));
    475475    } else
    476         rects.append(IntRect(accumulatedOffset, IntSize()));
     476        rects.append(LayoutRect(accumulatedOffset, LayoutSize()));
    477477
    478478    if (continuation()) {
    479479        if (continuation()->isBox()) {
    480480            RenderBox* box = toRenderBox(continuation());
    481             continuation()->absoluteRects(rects, toPoint(accumulatedOffset - containingBlock()->location() + box->size()));
     481            continuation()->absoluteRects(rects, toLayoutPoint(accumulatedOffset - containingBlock()->location() + box->size()));
    482482        } else
    483             continuation()->absoluteRects(rects, toPoint(accumulatedOffset - containingBlock()->location()));
     483            continuation()->absoluteRects(rects, toLayoutPoint(accumulatedOffset - containingBlock()->location()));
    484484    }
    485485}
  • trunk/Source/WebCore/rendering/RenderInline.h

    r90525 r90530  
    4949    virtual LayoutUnit marginEnd() const;
    5050
    51     virtual void absoluteRects(Vector<IntRect>&, const IntPoint& accumulatedOffset);
     51    virtual void absoluteRects(Vector<LayoutRect>&, const LayoutPoint& accumulatedOffset);
    5252    virtual void absoluteQuads(Vector<FloatQuad>&);
    5353
  • trunk/Source/WebCore/rendering/RenderObject.cpp

    r90525 r90530  
    11081108    FloatPoint absPos = localToAbsolute();
    11091109    Vector<IntRect> rects;
    1110     absoluteRects(rects, flooredIntPoint(absPos));
     1110    absoluteRects(rects, flooredLayoutPoint(absPos));
    11111111
    11121112    size_t n = rects.size();
  • trunk/Source/WebCore/rendering/RenderObject.h

    r90525 r90530  
    593593    LayoutSize offsetFromAncestorContainer(RenderObject*) const;
    594594   
    595     virtual void absoluteRects(Vector<IntRect>&, const IntPoint&) { }
     595    virtual void absoluteRects(Vector<LayoutRect>&, const LayoutPoint&) { }
    596596    // FIXME: useTransforms should go away eventually
    597597    IntRect absoluteBoundingBoxRect(bool useTransforms = false);
  • trunk/Source/WebCore/rendering/RenderText.cpp

    r90250 r90530  
    270270}
    271271
    272 void RenderText::absoluteRects(Vector<IntRect>& rects, const IntPoint& accumulatedOffset)
     272void RenderText::absoluteRects(Vector<LayoutRect>& rects, const LayoutPoint& accumulatedOffset)
    273273{
    274274    for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox())
    275         rects.append(enclosingIntRect(FloatRect(accumulatedOffset + box->topLeft(), box->size())));
     275        rects.append(enclosingLayoutRect(FloatRect(accumulatedOffset + box->topLeft(), box->size())));
    276276}
    277277
  • trunk/Source/WebCore/rendering/RenderText.h

    r90515 r90530  
    5757    void dirtyLineBoxes(bool fullLayout);
    5858
    59     virtual void absoluteRects(Vector<IntRect>&, const IntPoint& accumulatedOffset);
     59    virtual void absoluteRects(Vector<LayoutRect>&, const LayoutPoint& accumulatedOffset);
    6060    void absoluteRectsForRange(Vector<IntRect>&, unsigned startOffset = 0, unsigned endOffset = UINT_MAX, bool useSelectionHeight = false);
    6161
  • trunk/Source/WebCore/rendering/RenderView.cpp

    r90302 r90530  
    323323}
    324324
    325 void RenderView::absoluteRects(Vector<IntRect>& rects, const IntPoint& accumulatedOffset)
    326 {
    327     rects.append(IntRect(accumulatedOffset, m_layer->size()));
     325void RenderView::absoluteRects(Vector<LayoutRect>& rects, const LayoutPoint& accumulatedOffset)
     326{
     327    rects.append(LayoutRect(accumulatedOffset, m_layer->size()));
    328328}
    329329
  • trunk/Source/WebCore/rendering/RenderView.h

    r90302 r90530  
    8383    bool printing() const;
    8484
    85     virtual void absoluteRects(Vector<IntRect>&, const IntPoint& accumulatedOffset);
     85    virtual void absoluteRects(Vector<LayoutRect>&, const LayoutPoint& accumulatedOffset);
    8686    virtual void absoluteQuads(Vector<FloatQuad>&);
    8787
  • trunk/Source/WebCore/rendering/svg/RenderSVGBlock.cpp

    r88297 r90530  
    6969}
    7070
    71 void RenderSVGBlock::absoluteRects(Vector<IntRect>&, const IntPoint&)
     71void RenderSVGBlock::absoluteRects(Vector<LayoutRect>&, const LayoutPoint&)
    7272{
    7373    // 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  
    3737    virtual void updateBoxModelInfoFromStyle();
    3838
    39     virtual void absoluteRects(Vector<IntRect>&, const IntPoint& accumulatedOffset);
     39    virtual void absoluteRects(Vector<LayoutRect>&, const LayoutPoint& accumulatedOffset);
    4040
    4141    virtual void destroy();
  • trunk/Source/WebCore/rendering/svg/RenderSVGModelObject.cpp

    r90515 r90530  
    7171}
    7272
    73 void RenderSVGModelObject::absoluteRects(Vector<IntRect>&, const IntPoint&)
     73void RenderSVGModelObject::absoluteRects(Vector<LayoutRect>&, const LayoutPoint&)
    7474{
    7575    // 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  
    5656    virtual IntRect outlineBoundsForRepaint(RenderBoxModelObject* repaintContainer, IntPoint*) const;
    5757
    58     virtual void absoluteRects(Vector<IntRect>&, const IntPoint& accumulatedOffset);
     58    virtual void absoluteRects(Vector<LayoutRect>&, const LayoutPoint& accumulatedOffset);
    5959    virtual void absoluteQuads(Vector<FloatQuad>&);
    6060
Note: See TracChangeset for help on using the changeset viewer.