Changeset 112756 in webkit


Ignore:
Timestamp:
Mar 30, 2012 5:52:52 PM (12 years ago)
Author:
eae@chromium.org
Message:

Fix return type for virtual borderBoundingBox method
https://bugs.webkit.org/show_bug.cgi?id=82561

Reviewed by Eric Seidel.

No new tests, no change in functionality.

  • editing/DeleteButtonController.cpp:

(WebCore::isDeletableElement):

  • rendering/RenderBox.h:

(WebCore::RenderBox::borderBoxRect):
Rename pixelSnappedBorderBoxRect to borderBoxRect and remove LayoutRect
version of same as we always want to use the pixel snapped version to
ensure proper rounding and alignment to device pixels.
(The way this rect is pixel snapped, using the m_frameRect location,
makes it hard for calling code to take the subpixel rect and correctly
snap it).

(WebCore::RenderBox::borderBoundingBox):

  • rendering/RenderBoxModelObject.h:

Change pure virtual definition of borderBoundingBox to return an IntRect
to match implementation in RenderBox.

(RenderBoxModelObject):

  • rendering/RenderInline.h:

(WebCore::RenderInline::borderBoundingBox):
Change overloaded method to IntRect to match RenderBox implementation.

Location:
trunk/Source/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r112755 r112756  
     12012-03-30  Emil A Eklund  <eae@chromium.org>
     2
     3        Fix return type for virtual borderBoundingBox method
     4        https://bugs.webkit.org/show_bug.cgi?id=82561
     5
     6        Reviewed by Eric Seidel.
     7
     8        No new tests, no change in functionality.
     9
     10        * editing/DeleteButtonController.cpp:
     11        (WebCore::isDeletableElement):
     12        * rendering/RenderBox.h:
     13        (WebCore::RenderBox::borderBoxRect):
     14        Rename pixelSnappedBorderBoxRect to borderBoxRect and remove LayoutRect
     15        version of same as we always want to use the pixel snapped version to
     16        ensure proper rounding and alignment to device pixels.
     17        (The way this rect is pixel snapped, using the m_frameRect location,
     18        makes it hard for calling code to take the subpixel rect and correctly
     19        snap it).
     20
     21        (WebCore::RenderBox::borderBoundingBox):
     22        * rendering/RenderBoxModelObject.h:
     23        Change pure virtual definition of borderBoundingBox to return an IntRect
     24        to match implementation in RenderBox.
     25       
     26        (RenderBoxModelObject):
     27        * rendering/RenderInline.h:
     28        (WebCore::RenderInline::borderBoundingBox):
     29        Change overloaded method to IntRect to match RenderBox implementation.
     30
    1312012-03-30  Bear Travis  <betravis@adobe.com>
    232
  • trunk/Source/WebCore/editing/DeleteButtonController.cpp

    r107899 r112756  
    9393
    9494    RenderBox* box = toRenderBox(renderer);
    95     LayoutRect borderBoundingBox = box->borderBoundingBox();
     95    IntRect borderBoundingBox = box->borderBoundingBox();
    9696    if (borderBoundingBox.width() < minimumWidth || borderBoundingBox.height() < minimumHeight)
    9797        return false;
  • trunk/Source/WebCore/rendering/RenderBox.h

    r111279 r112756  
    133133    void setFrameRect(const LayoutRect& rect) { m_frameRect = rect; }
    134134
    135     // FIXME: We shouldn't be returning this as a LayoutRect, since it loses its position and won't properly pixel snap.
    136     LayoutRect borderBoxRect() const { return LayoutRect(LayoutPoint(), size()); }
    137     IntRect pixelSnappedBorderBoxRect() const { return IntRect(IntPoint(), IntSize(m_frameRect.pixelSnappedWidth(), m_frameRect.pixelSnappedHeight())); }
    138     virtual IntRect borderBoundingBox() const { return pixelSnappedBorderBoxRect(); }
     135    IntRect borderBoxRect() const { return IntRect(IntPoint(), IntSize(m_frameRect.pixelSnappedWidth(), m_frameRect.pixelSnappedHeight())); }
     136    virtual IntRect borderBoundingBox() const { return borderBoxRect(); }
    139137
    140138    // The content area of the box (excludes padding and border).
  • trunk/Source/WebCore/rendering/RenderBoxModelObject.h

    r110769 r112756  
    7878
    7979    // This will work on inlines to return the bounding box of all of the lines' border boxes.
    80     virtual LayoutRect borderBoundingBox() const = 0;
     80    virtual IntRect borderBoundingBox() const = 0;
    8181
    8282    // Virtual since table cells override
  • trunk/Source/WebCore/rendering/RenderInline.h

    r112237 r112756  
    135135    virtual VisiblePosition positionForPoint(const LayoutPoint&);
    136136
    137     virtual LayoutRect borderBoundingBox() const
     137    virtual IntRect borderBoundingBox() const
    138138    {
    139         LayoutRect boundingBox = linesBoundingBox();
    140         return LayoutRect(0, 0, boundingBox.width(), boundingBox.height());
     139        IntRect boundingBox = linesBoundingBox();
     140        return IntRect(0, 0, boundingBox.width(), boundingBox.height());
    141141    }
    142142
Note: See TracChangeset for help on using the changeset viewer.