Title: [99303] trunk/Source/WebCore
- Revision
- 99303
- Author
- [email protected]
- Date
- 2011-11-04 11:27:35 -0700 (Fri, 04 Nov 2011)
Log 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):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (99302 => 99303)
--- trunk/Source/WebCore/ChangeLog 2011-11-04 18:20:11 UTC (rev 99302)
+++ trunk/Source/WebCore/ChangeLog 2011-11-04 18:27:35 UTC (rev 99303)
@@ -1,3 +1,24 @@
+2011-11-04 Levi Weintraub <[email protected]>
+
+ 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):
+
2011-11-04 Adam Barth <[email protected]>
Implement allow-popups for iframe@sandbox
Modified: trunk/Source/WebCore/rendering/RenderImage.cpp (99302 => 99303)
--- trunk/Source/WebCore/rendering/RenderImage.cpp 2011-11-04 18:20:11 UTC (rev 99302)
+++ trunk/Source/WebCore/rendering/RenderImage.cpp 2011-11-04 18:27:35 UTC (rev 99303)
@@ -212,7 +212,7 @@
}
if (shouldRepaint) {
- IntRect repaintRect;
+ LayoutRect repaintRect;
if (rect) {
// The image changed rect is in source image coordinates (pre-zooming),
// so map from the bounds of the image to the contentsBox.
@@ -394,7 +394,7 @@
repaint();
}
-void RenderImage::paintIntoRect(GraphicsContext* context, const IntRect& rect)
+void RenderImage::paintIntoRect(GraphicsContext* context, const LayoutRect& rect)
{
if (!m_imageResource->hasImage() || m_imageResource->errorOccurred() || rect.width() <= 0 || rect.height() <= 0)
return;
@@ -454,7 +454,7 @@
if (tempResult.innerNode() && node()) {
if (HTMLMapElement* map = imageMap()) {
- IntRect contentBox = contentBoxRect();
+ LayoutRect contentBox = contentBoxRect();
float scaleFactor = 1 / style()->effectiveZoom();
LayoutPoint mapLocation(pointInContainer.x() - accumulatedOffset.x() - this->x() - contentBox.x(), pointInContainer.y() - accumulatedOffset.y() - this->y() - contentBox.y());
mapLocation.scale(scaleFactor, scaleFactor);
@@ -495,13 +495,13 @@
bool hasRelativeWidth = contentRenderer ? contentRenderer->style()->width().isPercent() : m_imageResource->imageHasRelativeWidth();
bool hasRelativeHeight = contentRenderer ? contentRenderer->style()->height().isPercent() : m_imageResource->imageHasRelativeHeight();
- LayoutSize containerSize;
+ IntSize containerSize;
if (hasRelativeWidth || hasRelativeHeight) {
// Propagate the containing block size to the image resource, otherwhise we can't compute our own intrinsic size, if it's relative.
RenderObject* containingBlock = isPositioned() ? container() : this->containingBlock();
if (containingBlock->isBox()) {
RenderBox* box = toRenderBox(containingBlock);
- containerSize = LayoutSize(box->availableWidth(), box->availableHeight()); // Already contains zooming information.
+ containerSize = IntSize(box->availableWidth(), box->availableHeight()); // Already contains zooming information.
}
} else {
// Propagate the current zoomed image size to the image resource, otherwhise the image size will remain the same on-screen.
Modified: trunk/Source/WebCore/rendering/RenderImage.h (99302 => 99303)
--- trunk/Source/WebCore/rendering/RenderImage.h 2011-11-04 18:20:11 UTC (rev 99302)
+++ trunk/Source/WebCore/rendering/RenderImage.h 2011-11-04 18:27:35 UTC (rev 99303)
@@ -62,7 +62,7 @@
virtual void imageChanged(WrappedImagePtr, const IntRect* = 0);
- virtual void paintIntoRect(GraphicsContext*, const IntRect&);
+ virtual void paintIntoRect(GraphicsContext*, const LayoutRect&);
virtual void paint(PaintInfo&, const LayoutPoint&);
virtual void intrinsicSizeChanged()
@@ -77,7 +77,7 @@
virtual bool isImage() const { return true; }
virtual bool isRenderImage() const { return true; }
- virtual void paintReplaced(PaintInfo&, const IntPoint&);
+ virtual void paintReplaced(PaintInfo&, const LayoutPoint&);
virtual bool backgroundIsObscured() const;
Modified: trunk/Source/WebCore/svg/graphics/SVGImage.cpp (99302 => 99303)
--- trunk/Source/WebCore/svg/graphics/SVGImage.cpp 2011-11-04 18:20:11 UTC (rev 99302)
+++ trunk/Source/WebCore/svg/graphics/SVGImage.cpp 2011-11-04 18:27:35 UTC (rev 99303)
@@ -73,7 +73,7 @@
m_image = 0;
}
- virtual void invalidateContentsAndWindow(const LayoutRect& r, bool)
+ virtual void invalidateContentsAndWindow(const IntRect& r, bool)
{
if (m_image && m_image->imageObserver())
m_image->imageObserver()->changedInRect(m_image, r);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes