Changeset 90590 in webkit


Ignore:
Timestamp:
Jul 7, 2011 2:16:15 PM (13 years ago)
Author:
eae@chromium.org
Message:

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

Reviewed by Eric Seidel.

No new tests, no functionality changes.

  • rendering/LayoutTypes.h:

(WebCore::flooredLayoutPoint):

  • rendering/RenderBlock.cpp:

(WebCore::RenderBlock::addFocusRingRects):

  • rendering/RenderBlock.h:
  • rendering/RenderBox.cpp:

(WebCore::RenderBox::addFocusRingRects):

  • rendering/RenderBox.h:
  • rendering/RenderInline.cpp:

(WebCore::RenderInline::addFocusRingRects):

  • rendering/RenderInline.h:
  • rendering/RenderListBox.cpp:

(WebCore::RenderListBox::addFocusRingRects):

  • rendering/RenderListBox.h:
  • rendering/RenderObject.h:

(WebCore::RenderObject::addFocusRingRects):

  • rendering/RenderTextControl.cpp:

(WebCore::RenderTextControl::addFocusRingRects):

  • rendering/RenderTextControl.h:
  • rendering/svg/RenderSVGContainer.cpp:

(WebCore::RenderSVGContainer::addFocusRingRects):

  • rendering/svg/RenderSVGContainer.h:
  • rendering/svg/RenderSVGImage.cpp:

(WebCore::RenderSVGImage::addFocusRingRects):

  • rendering/svg/RenderSVGImage.h:
  • rendering/svg/RenderSVGPath.cpp:

(WebCore::RenderSVGPath::addFocusRingRects):

  • rendering/svg/RenderSVGPath.h:
Location:
trunk/Source/WebCore
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r90589 r90590  
     12011-07-07  Emil A Eklund  <eae@chromium.org>
     2
     3        Switch addFocusRingRects to to new layout types
     4        https://bugs.webkit.org/show_bug.cgi?id=64114
     5
     6        Reviewed by Eric Seidel.
     7
     8        No new tests, no functionality changes.
     9
     10        * rendering/LayoutTypes.h:
     11        (WebCore::flooredLayoutPoint):
     12        * rendering/RenderBlock.cpp:
     13        (WebCore::RenderBlock::addFocusRingRects):
     14        * rendering/RenderBlock.h:
     15        * rendering/RenderBox.cpp:
     16        (WebCore::RenderBox::addFocusRingRects):
     17        * rendering/RenderBox.h:
     18        * rendering/RenderInline.cpp:
     19        (WebCore::RenderInline::addFocusRingRects):
     20        * rendering/RenderInline.h:
     21        * rendering/RenderListBox.cpp:
     22        (WebCore::RenderListBox::addFocusRingRects):
     23        * rendering/RenderListBox.h:
     24        * rendering/RenderObject.h:
     25        (WebCore::RenderObject::addFocusRingRects):
     26        * rendering/RenderTextControl.cpp:
     27        (WebCore::RenderTextControl::addFocusRingRects):
     28        * rendering/RenderTextControl.h:
     29        * rendering/svg/RenderSVGContainer.cpp:
     30        (WebCore::RenderSVGContainer::addFocusRingRects):
     31        * rendering/svg/RenderSVGContainer.h:
     32        * rendering/svg/RenderSVGImage.cpp:
     33        (WebCore::RenderSVGImage::addFocusRingRects):
     34        * rendering/svg/RenderSVGImage.h:
     35        * rendering/svg/RenderSVGPath.cpp:
     36        (WebCore::RenderSVGPath::addFocusRingRects):
     37        * rendering/svg/RenderSVGPath.h:
     38
    1392011-07-06  Adrienne Walker  <enne@google.com>
    240
  • trunk/Source/WebCore/rendering/LayoutTypes.h

    r90530 r90590  
    6363}
    6464
     65inline LayoutPoint flooredLayoutPoint(const FloatSize& s)
     66{
     67    return flooredIntPoint(s);
     68}
     69
    6570inline LayoutUnit roundedLayoutUnit(float value)
    6671{
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r90573 r90590  
    58855885}
    58865886
    5887 void RenderBlock::addFocusRingRects(Vector<IntRect>& rects, const IntPoint& additionalOffset)
     5887void RenderBlock::addFocusRingRects(Vector<LayoutRect>& rects, const LayoutPoint& additionalOffset)
    58885888{
    58895889    // For blocks inside inlines, we go ahead and include margins so that we run right up to the
     
    58975897        // https://bugs.webkit.org/show_bug.cgi?id=46781
    58985898        bool prevInlineHasLineBox = toRenderInline(inlineElementContinuation()->node()->renderer())->firstLineBox();
    5899         int topMargin = prevInlineHasLineBox ? collapsedMarginBefore() : 0;
    5900         int bottomMargin = nextInlineHasLineBox ? collapsedMarginAfter() : 0;
    5901         IntRect rect(additionalOffset.x(), additionalOffset.y() - topMargin, width(), height() + topMargin + bottomMargin);
     5899        float topMargin = prevInlineHasLineBox ? collapsedMarginBefore() : static_cast<LayoutUnit>(0);
     5900        float bottomMargin = nextInlineHasLineBox ? collapsedMarginAfter() : static_cast<LayoutUnit>(0);
     5901        LayoutRect rect(additionalOffset.x(), additionalOffset.y() - topMargin, width(), height() + topMargin + bottomMargin);
    59025902        if (!rect.isEmpty())
    59035903            rects.append(rect);
    59045904    } else if (width() && height())
    5905         rects.append(IntRect(additionalOffset, size()));
     5905        rects.append(LayoutRect(additionalOffset, size()));
    59065906
    59075907    if (!hasOverflowClip() && !hasControlClip()) {
    59085908        for (RootInlineBox* curr = firstRootBox(); curr; curr = curr->nextRootBox()) {
    5909             int top = max(curr->lineTop(), curr->logicalTop());
    5910             int bottom = min(curr->lineBottom(), curr->logicalTop() + curr->logicalHeight());
    5911             IntRect rect(additionalOffset.x() + curr->x(), additionalOffset.y() + top, curr->logicalWidth(), bottom - top);
     5909            LayoutUnit top = max(curr->lineTop(), curr->logicalTop());
     5910            LayoutUnit bottom = min(curr->lineBottom(), curr->logicalTop() + curr->logicalHeight());
     5911            LayoutRect rect(additionalOffset.x() + curr->x(), additionalOffset.y() + top, curr->logicalWidth(), bottom - top);
    59125912            if (!rect.isEmpty())
    59135913                rects.append(rect);
     
    59295929
    59305930    if (inlineElementContinuation())
    5931         inlineElementContinuation()->addFocusRingRects(rects, flooredIntPoint(additionalOffset + inlineElementContinuation()->containingBlock()->location() - location()));
     5931        inlineElementContinuation()->addFocusRingRects(rects, flooredLayoutPoint(additionalOffset + inlineElementContinuation()->containingBlock()->location() - location()));
    59325932}
    59335933
  • trunk/Source/WebCore/rendering/RenderBlock.h

    r90530 r90590  
    337337    void addOverflowFromInlineChildren();
    338338
    339     virtual void addFocusRingRects(Vector<IntRect>&, const IntPoint&);
     339    virtual void addFocusRingRects(Vector<LayoutRect>&, const LayoutPoint&);
    340340
    341341#if ENABLE(SVG)
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r90530 r90590  
    511511}
    512512
    513 void RenderBox::addFocusRingRects(Vector<IntRect>& rects, const IntPoint& additionalOffset)
     513void RenderBox::addFocusRingRects(Vector<LayoutRect>& rects, const LayoutPoint& additionalOffset)
    514514{
    515515    if (!size().isEmpty())
    516         rects.append(IntRect(additionalOffset, size()));
     516        rects.append(LayoutRect(additionalOffset, size()));
    517517}
    518518
  • trunk/Source/WebCore/rendering/RenderBox.h

    r90525 r90590  
    129129    // Bounds of the outline box in absolute coords. Respects transforms
    130130    virtual IntRect outlineBoundsForRepaint(RenderBoxModelObject* /*repaintContainer*/, IntPoint* cachedOffsetToRepaintContainer) const;
    131     virtual void addFocusRingRects(Vector<IntRect>&, const IntPoint&);
     131    virtual void addFocusRingRects(Vector<LayoutRect>&, const LayoutPoint&);
    132132
    133133    // Use this with caution! No type checking is done!
  • trunk/Source/WebCore/rendering/RenderInline.cpp

    r90530 r90590  
    13351335}
    13361336
    1337 void RenderInline::addFocusRingRects(Vector<IntRect>& rects, const IntPoint& additionalOffset)
     1337void RenderInline::addFocusRingRects(Vector<LayoutRect>& rects, const LayoutPoint& additionalOffset)
    13381338{
    13391339    if (!alwaysCreateLineBoxes())
    1340         culledInlineAbsoluteRects(this, rects, toSize(additionalOffset));
     1340        culledInlineAbsoluteRects(this, rects, toLayoutSize(additionalOffset));
    13411341    else {
    13421342        for (InlineFlowBox* curr = firstLineBox(); curr; curr = curr->nextLineBox())
    1343             rects.append(enclosingIntRect(FloatRect(additionalOffset.x() + curr->x(), additionalOffset.y() + curr->y(), curr->width(), curr->height())));
     1343            rects.append(enclosingLayoutRect(FloatRect(additionalOffset.x() + curr->x(), additionalOffset.y() + curr->y(), curr->width(), curr->height())));
    13441344    }
    13451345
     
    13581358    if (continuation()) {
    13591359        if (continuation()->isInline())
    1360             continuation()->addFocusRingRects(rects, flooredIntPoint(additionalOffset + continuation()->containingBlock()->location() - containingBlock()->location()));
     1360            continuation()->addFocusRingRects(rects, flooredLayoutPoint(additionalOffset + continuation()->containingBlock()->location() - containingBlock()->location()));
    13611361        else
    1362             continuation()->addFocusRingRects(rects, flooredIntPoint(additionalOffset + toRenderBox(continuation())->location() - containingBlock()->location()));
     1362            continuation()->addFocusRingRects(rects, flooredLayoutPoint(additionalOffset + toRenderBox(continuation())->location() - containingBlock()->location()));
    13631363    }
    13641364}
  • trunk/Source/WebCore/rendering/RenderInline.h

    r90530 r90590  
    7676    LayoutSize relativePositionedInlineOffset(const RenderBox* child) const;
    7777
    78     virtual void addFocusRingRects(Vector<IntRect>&, const IntPoint&);
     78    virtual void addFocusRingRects(Vector<LayoutRect>&, const LayoutPoint&);
    7979    void paintOutline(GraphicsContext*, const IntPoint&);
    8080
  • trunk/Source/WebCore/rendering/RenderListBox.cpp

    r90515 r90590  
    305305}
    306306
    307 void RenderListBox::addFocusRingRects(Vector<IntRect>& rects, const IntPoint& additionalOffset)
     307void RenderListBox::addFocusRingRects(Vector<LayoutRect>& rects, const LayoutPoint& additionalOffset)
    308308{
    309309    if (!isSpatialNavigationEnabled(frame()))
  • trunk/Source/WebCore/rendering/RenderListBox.h

    r90515 r90590  
    8080    virtual void layout();
    8181
    82     virtual void addFocusRingRects(Vector<IntRect>&, const IntPoint&);
     82    virtual void addFocusRingRects(Vector<LayoutRect>&, const LayoutPoint&);
    8383
    8484    virtual bool canBeProgramaticallyScrolled() const { return true; }
  • trunk/Source/WebCore/rendering/RenderObject.h

    r90530 r90590  
    778778    void getTransformFromContainer(const RenderObject* container, const IntSize& offsetInContainer, TransformationMatrix&) const;
    779779   
    780     virtual void addFocusRingRects(Vector<IntRect>&, const IntPoint&) { };
     780    virtual void addFocusRingRects(Vector<LayoutRect>&, const LayoutPoint&) { };
    781781
    782782    IntRect absoluteOutlineBounds() const
  • trunk/Source/WebCore/rendering/RenderTextControl.cpp

    r90069 r90590  
    584584}
    585585
    586 void RenderTextControl::addFocusRingRects(Vector<IntRect>& rects, const IntPoint& additionalOffset)
     586void RenderTextControl::addFocusRingRects(Vector<LayoutRect>& rects, const LayoutPoint& additionalOffset)
    587587{
    588588    if (!size().isEmpty())
    589         rects.append(IntRect(additionalOffset, size()));
     589        rects.append(LayoutRect(additionalOffset, size()));
    590590}
    591591
  • trunk/Source/WebCore/rendering/RenderTextControl.h

    r89983 r90590  
    9393    virtual void paintObject(PaintInfo&, const LayoutPoint&);
    9494   
    95     virtual void addFocusRingRects(Vector<IntRect>&, const IntPoint&);
     95    virtual void addFocusRingRects(Vector<LayoutRect>&, const LayoutPoint&);
    9696
    9797    virtual bool canBeProgramaticallyScrolled() const { return true; }
  • trunk/Source/WebCore/rendering/svg/RenderSVGContainer.cpp

    r88250 r90590  
    140140
    141141// addFocusRingRects is called from paintOutline and needs to be in the same coordinates as the paintOuline call
    142 void RenderSVGContainer::addFocusRingRects(Vector<IntRect>& rects, const IntPoint&)
     142void RenderSVGContainer::addFocusRingRects(Vector<LayoutRect>& rects, const LayoutPoint&)
    143143{
    144     IntRect paintRectInParent = enclosingIntRect(localToParentTransform().mapRect(repaintRectInLocalCoordinates()));
     144    LayoutRect paintRectInParent = enclosingLayoutRect(localToParentTransform().mapRect(repaintRectInLocalCoordinates()));
    145145    if (!paintRectInParent.isEmpty())
    146146        rects.append(paintRectInParent);
  • trunk/Source/WebCore/rendering/svg/RenderSVGContainer.h

    r90048 r90590  
    5252    virtual void layout();
    5353
    54     virtual void addFocusRingRects(Vector<IntRect>&, const IntPoint&);
     54    virtual void addFocusRingRects(Vector<LayoutRect>&, const LayoutPoint&);
    5555
    5656    virtual FloatRect objectBoundingBox() const { return m_objectBoundingBox; }
  • trunk/Source/WebCore/rendering/svg/RenderSVGImage.cpp

    r88250 r90590  
    180180}
    181181
    182 void RenderSVGImage::addFocusRingRects(Vector<IntRect>& rects, const IntPoint&)
     182void RenderSVGImage::addFocusRingRects(Vector<LayoutRect>& rects, const LayoutPoint&)
    183183{
    184184    // this is called from paint() after the localTransform has already been applied
    185     IntRect contentRect = enclosingIntRect(repaintRectInLocalCoordinates());
     185    LayoutRect contentRect = enclosingLayoutRect(repaintRectInLocalCoordinates());
    186186    if (!contentRect.isEmpty())
    187187        rects.append(contentRect);
  • trunk/Source/WebCore/rendering/svg/RenderSVGImage.h

    r90048 r90590  
    5858    virtual FloatRect repaintRectInLocalCoordinates() const { return m_repaintBoundingBox; }
    5959
    60     virtual void addFocusRingRects(Vector<IntRect>&, const IntPoint&);
     60    virtual void addFocusRingRects(Vector<LayoutRect>&, const LayoutPoint&);
    6161
    6262    virtual void imageChanged(WrappedImagePtr, const IntRect* = 0);
  • trunk/Source/WebCore/rendering/svg/RenderSVGPath.cpp

    r88250 r90590  
    237237// This method is called from inside paintOutline() since we call paintOutline()
    238238// while transformed to our coord system, return local coords
    239 void RenderSVGPath::addFocusRingRects(Vector<IntRect>& rects, const IntPoint&)
    240 {
    241     IntRect rect = enclosingIntRect(repaintRectInLocalCoordinates());
     239void RenderSVGPath::addFocusRingRects(Vector<LayoutRect>& rects, const LayoutPoint&)
     240{
     241    LayoutRect rect = enclosingLayoutRect(repaintRectInLocalCoordinates());
    242242    if (!rect.isEmpty())
    243243        rects.append(rect);
  • trunk/Source/WebCore/rendering/svg/RenderSVGPath.h

    r90048 r90590  
    6262    virtual void layout();
    6363    virtual void paint(PaintInfo&, const LayoutPoint&);
    64     virtual void addFocusRingRects(Vector<IntRect>&, const IntPoint&);
     64    virtual void addFocusRingRects(Vector<LayoutRect>&, const LayoutPoint&);
    6565
    6666    virtual bool nodeAtFloatPoint(const HitTestRequest&, HitTestResult&, const FloatPoint& pointInParent, HitTestAction);
Note: See TracChangeset for help on using the changeset viewer.