Changeset 99303 in webkit


Ignore:
Timestamp:
Nov 4, 2011 11:27:35 AM (12 years ago)
Author:
leviw@chromium.org
Message:

Correct usage of LayoutUnits in RenderImage and SVGImage
https://bugs.webkit.org/show_bug.cgi?id=71525

Reviewed by Darin Adler.

Correcting incorrect usage of LayoutUnits for image sizes that should be integers and fixing overloaded functions that
should be using LayoutUnits.

No new tests -- no change in behavior.

  • rendering/RenderImage.cpp:

(WebCore::RenderImage::imageDimensionsChanged):
(WebCore::RenderImage::paintIntoRect):
(WebCore::RenderImage::nodeAtPoint):
(WebCore::RenderImage::computeReplacedLogicalWidth):

  • rendering/RenderImage.h:
  • svg/graphics/SVGImage.cpp:

(WebCore::SVGImageChromeClient::invalidateContentsAndWindow):

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r99301 r99303  
     12011-11-04  Levi Weintraub  <leviw@chromium.org>
     2
     3        Correct usage of LayoutUnits in RenderImage and SVGImage
     4        https://bugs.webkit.org/show_bug.cgi?id=71525
     5
     6        Reviewed by Darin Adler.
     7
     8        Correcting incorrect usage of LayoutUnits for image sizes that should be integers and fixing overloaded functions that
     9        should be using LayoutUnits.
     10
     11        No new tests -- no change in behavior.
     12
     13        * rendering/RenderImage.cpp:
     14        (WebCore::RenderImage::imageDimensionsChanged):
     15        (WebCore::RenderImage::paintIntoRect):
     16        (WebCore::RenderImage::nodeAtPoint):
     17        (WebCore::RenderImage::computeReplacedLogicalWidth):
     18        * rendering/RenderImage.h:
     19        * svg/graphics/SVGImage.cpp:
     20        (WebCore::SVGImageChromeClient::invalidateContentsAndWindow):
     21
    1222011-11-04  Adam Barth  <abarth@webkit.org>
    223
  • trunk/Source/WebCore/rendering/RenderImage.cpp

    r98895 r99303  
    213213
    214214    if (shouldRepaint) {
    215         IntRect repaintRect;
     215        LayoutRect repaintRect;
    216216        if (rect) {
    217217            // The image changed rect is in source image coordinates (pre-zooming),
     
    395395}
    396396
    397 void RenderImage::paintIntoRect(GraphicsContext* context, const IntRect& rect)
     397void RenderImage::paintIntoRect(GraphicsContext* context, const LayoutRect& rect)
    398398{
    399399    if (!m_imageResource->hasImage() || m_imageResource->errorOccurred() || rect.width() <= 0 || rect.height() <= 0)
     
    455455    if (tempResult.innerNode() && node()) {
    456456        if (HTMLMapElement* map = imageMap()) {
    457             IntRect contentBox = contentBoxRect();
     457            LayoutRect contentBox = contentBoxRect();
    458458            float scaleFactor = 1 / style()->effectiveZoom();
    459459            LayoutPoint mapLocation(pointInContainer.x() - accumulatedOffset.x() - this->x() - contentBox.x(), pointInContainer.y() - accumulatedOffset.y() - this->y() - contentBox.y());
     
    496496    bool hasRelativeHeight = contentRenderer ? contentRenderer->style()->height().isPercent() : m_imageResource->imageHasRelativeHeight();
    497497
    498     LayoutSize containerSize;
     498    IntSize containerSize;
    499499    if (hasRelativeWidth || hasRelativeHeight) {
    500500        // Propagate the containing block size to the image resource, otherwhise we can't compute our own intrinsic size, if it's relative.
     
    502502        if (containingBlock->isBox()) {
    503503            RenderBox* box = toRenderBox(containingBlock);
    504             containerSize = LayoutSize(box->availableWidth(), box->availableHeight()); // Already contains zooming information.
     504            containerSize = IntSize(box->availableWidth(), box->availableHeight()); // Already contains zooming information.
    505505        }
    506506    } else {
  • trunk/Source/WebCore/rendering/RenderImage.h

    r98852 r99303  
    6363    virtual void imageChanged(WrappedImagePtr, const IntRect* = 0);
    6464
    65     virtual void paintIntoRect(GraphicsContext*, const IntRect&);
     65    virtual void paintIntoRect(GraphicsContext*, const LayoutRect&);
    6666    virtual void paint(PaintInfo&, const LayoutPoint&);
    6767
     
    7878    virtual bool isRenderImage() const { return true; }
    7979
    80     virtual void paintReplaced(PaintInfo&, const IntPoint&);
     80    virtual void paintReplaced(PaintInfo&, const LayoutPoint&);
    8181
    8282    virtual bool backgroundIsObscured() const;
  • trunk/Source/WebCore/svg/graphics/SVGImage.cpp

    r99228 r99303  
    7474    }
    7575
    76     virtual void invalidateContentsAndWindow(const LayoutRect& r, bool)
     76    virtual void invalidateContentsAndWindow(const IntRect& r, bool)
    7777    {
    7878        if (m_image && m_image->imageObserver())
Note: See TracChangeset for help on using the changeset viewer.