Changeset 117497 in webkit


Ignore:
Timestamp:
May 17, 2012 2:31:10 PM (12 years ago)
Author:
jchaffraix@webkit.org
Message:

Kill RenderLayer::relativePositionOffset(LayoutUnit& relX, LayoutUnit& relY) and cleanup RenderInline::clippedOverflowRectForRepaint
https://bugs.webkit.org/show_bug.cgi?id=86551

Reviewed by Abhishek Arya.

No test since there is no expected change in behavior.

  • rendering/RenderInline.cpp:

(WebCore::RenderInline::clippedOverflowRectForRepaint):
Changed the function to use LayoutRect arithmetics instead of calculating
top / left manually. While at it, improved the naming, removed some local
variables and removed an unneeded style() NULL-check.

  • rendering/RenderLayer.h: Removed the function.
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r117494 r117497  
     12012-05-17  Julien Chaffraix  <jchaffraix@webkit.org>
     2
     3        Kill RenderLayer::relativePositionOffset(LayoutUnit& relX, LayoutUnit& relY) and cleanup RenderInline::clippedOverflowRectForRepaint
     4        https://bugs.webkit.org/show_bug.cgi?id=86551
     5
     6        Reviewed by Abhishek Arya.
     7
     8        No test since there is no expected change in behavior.
     9
     10        * rendering/RenderInline.cpp:
     11        (WebCore::RenderInline::clippedOverflowRectForRepaint):
     12        Changed the function to use LayoutRect arithmetics instead of calculating
     13        top / left manually. While at it, improved the naming, removed some local
     14        variables and removed an unneeded style() NULL-check.
     15
     16        * rendering/RenderLayer.h: Removed the function.
     17
    1182012-05-17  Rob Buis  <rwlbuis@webkit.org>
    219
  • trunk/Source/WebCore/rendering/RenderInline.cpp

    r116718 r117497  
    933933        return LayoutRect();
    934934
    935     // Find our leftmost position.
    936     LayoutRect boundingBox(linesVisualOverflowBoundingBox());
    937     LayoutUnit left = boundingBox.x();
    938     LayoutUnit top = boundingBox.y();
    939 
    940     // Now invalidate a rectangle.
    941     LayoutUnit ow = style() ? style()->outlineSize() : 0;
    942 
     935    LayoutRect repaintRect(linesVisualOverflowBoundingBox());
    943936    bool hitRepaintContainer = false;
    944937
     
    953946        }
    954947        if (inlineFlow->style()->position() == RelativePosition && inlineFlow->hasLayer())
    955             toRenderInline(inlineFlow)->layer()->relativePositionOffset(left, top);
    956     }
    957 
    958     LayoutRect r(-ow + left, -ow + top, boundingBox.width() + ow * 2, boundingBox.height() + ow * 2);
     948            repaintRect.move(toRenderInline(inlineFlow)->layer()->relativePositionOffset());
     949    }
     950
     951    LayoutUnit outlineSize = style()->outlineSize();
     952    repaintRect.inflate(outlineSize);
    959953
    960954    if (hitRepaintContainer || !cb)
    961         return r;
     955        return repaintRect;
    962956
    963957    if (cb->hasColumns())
    964         cb->adjustRectForColumns(r);
     958        cb->adjustRectForColumns(repaintRect);
    965959
    966960    if (cb->hasOverflowClip()) {
     
    968962        // layer's size instead.  Even if the layer's size is wrong, the layer itself will repaint
    969963        // anyway if its size does change.
    970         LayoutRect repaintRect(r);
    971964        repaintRect.move(-cb->scrolledContentOffset()); // For overflow:auto/scroll/hidden.
    972965
    973966        LayoutRect boxRect(LayoutPoint(), cb->cachedSizeForOverflowClip());
    974         r = intersection(repaintRect, boxRect);
    975     }
    976 
    977     cb->computeRectForRepaint(repaintContainer, r);
    978 
    979     if (ow) {
     967        repaintRect.intersect(boxRect);
     968    }
     969
     970    cb->computeRectForRepaint(repaintContainer, repaintRect);
     971
     972    if (outlineSize) {
    980973        for (RenderObject* curr = firstChild(); curr; curr = curr->nextSibling()) {
    981             if (!curr->isText()) {
    982                 LayoutRect childRect = curr->rectWithOutlineForRepaint(repaintContainer, ow);
    983                 r.unite(childRect);
    984             }
    985         }
    986 
    987         if (continuation() && !continuation()->isInline() && continuation()->parent()) {
    988             LayoutRect contRect = continuation()->rectWithOutlineForRepaint(repaintContainer, ow);
    989             r.unite(contRect);
    990         }
    991     }
    992 
    993     return r;
     974            if (!curr->isText())
     975                repaintRect.unite(curr->rectWithOutlineForRepaint(repaintContainer, outlineSize));
     976        }
     977
     978        if (continuation() && !continuation()->isInline() && continuation()->parent())
     979            repaintRect.unite(continuation()->rectWithOutlineForRepaint(repaintContainer, outlineSize));
     980    }
     981
     982    return repaintRect;
    994983}
    995984
  • trunk/Source/WebCore/rendering/RenderLayer.h

    r117162 r117497  
    370370    void updateTransform();
    371371
    372     void relativePositionOffset(LayoutUnit& relX, LayoutUnit& relY) const { relX += m_relativeOffset.width(); relY += m_relativeOffset.height(); }
    373372    const LayoutSize& relativePositionOffset() const { return m_relativeOffset; }
    374373
Note: See TracChangeset for help on using the changeset viewer.