[subpixel] Change intrinsicSize to LayoutUnit
authoreae@chromium.org <eae@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Nov 2012 15:00:26 +0000 (15:00 +0000)
committereae@chromium.org <eae@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Nov 2012 15:00:26 +0000 (15:00 +0000)
commit6ee8aef8221c94fcafc97d1936eb050620a6e5f7
tree692ed3484ed64b1fd0e6fe1fedb38d107a95d9e0
parenta17e16ab7f8d4a738bc7433c038a2d089fb534f3
[subpixel] Change intrinsicSize to LayoutUnit
https://bugs.webkit.org/show_bug.cgi?id=99104

Reviewed by Levi Weintraub.

Source/WebCore:

Change RenderReplaced and intrinsicSize to LayoutUnit to avoid
rounding problems when zooming/scaling. Also change imageSize to
LayoutUnit as it can return a scaled size.

Test: fast/sub-pixel/tiled-canvas-elements.html

* html/ImageDocument.cpp:
(WebCore::ImageDocumentParser::finish):
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::imageSizeForRenderer):
* loader/cache/CachedImage.h:
(CachedImage):
* platform/graphics/FractionalLayoutSize.h:
(FractionalLayoutSize):
(WebCore::FractionalLayoutSize::scale):
(WebCore::FractionalLayoutSize::clampToMinimumSize):
* rendering/RenderBox.h:
(WebCore::RenderBox::intrinsicSize):
* rendering/RenderHTMLCanvas.cpp:
(WebCore::RenderHTMLCanvas::canvasSizeChanged):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::imageChanged):
(WebCore::RenderImage::updateIntrinsicSizeIfNeeded):
(WebCore::RenderImage::paintReplaced):
(WebCore::RenderImage::minimumReplacedHeight):
* rendering/RenderImage.h:
(RenderImage):
* rendering/RenderImageResource.h:
(WebCore::RenderImageResource::imageSize):
* rendering/RenderImageResourceStyleImage.h:
* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::RenderReplaced):
(WebCore::RenderReplaced::computeAspectRatioInformationForRenderBox):
(WebCore::RenderReplaced::computeReplacedLogicalWidth):
(WebCore::RenderReplaced::computeReplacedLogicalHeight):
* rendering/RenderReplaced.h:
(RenderReplaced):
(WebCore::RenderReplaced::minimumReplacedHeight):
(WebCore::RenderReplaced::setIntrinsicSize):
* rendering/RenderVideo.cpp:
(WebCore::RenderVideo::updateIntrinsicSize):
(WebCore::RenderVideo::calculateIntrinsicSize):
(WebCore::RenderVideo::videoBox):
(WebCore::RenderVideo::minimumReplacedHeight):
* rendering/RenderVideo.h:
(RenderVideo):
* rendering/style/StyleCachedImage.cpp:
(WebCore::StyleCachedImage::imageSize):
* rendering/style/StyleCachedImage.h:
(StyleCachedImage):
* rendering/style/StyleCachedImageSet.cpp:
(WebCore::StyleCachedImageSet::imageSize):
* rendering/style/StyleCachedImageSet.h:
(StyleCachedImageSet):
* rendering/style/StyleGeneratedImage.cpp:
(WebCore::StyleGeneratedImage::imageSize):
(WebCore::StyleGeneratedImage::computeIntrinsicDimensions):
* rendering/style/StyleGeneratedImage.h:
(StyleGeneratedImage):
* rendering/style/StyleImage.h:
(StyleImage):
* rendering/style/StylePendingImage.h:

LayoutTests:

Add test for tiled replaced elements and update existing expectations as needed.

* fast/sub-pixel/tiled-canvas-elements-expected.txt: Added.
* fast/sub-pixel/tiled-canvas-elements.html: Added.
* platform/chromium-linux/compositing/overflow/overflow-compositing-descendant-expected.png:
* platform/chromium-linux/compositing/overflow/scroll-ancestor-update-expected.png:
* platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-absolute-size-2-expected.png:
* platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-absolute-size-2-expected.txt:
* platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-absolute-size-expected.txt:
* platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-auto-size-expected.png:
* platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-percentage-size-expected.png:
* platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-percentage-size-expected.txt:
* platform/chromium-win/svg/as-image/svg-non-integer-scaled-image-expected.png:
* platform/chromium-win/svg/zoom/page/zoom-svg-through-object-with-auto-size-expected.txt:
* platform/chromium/fast/reflections/reflection-with-zoom-expected.txt:
* platform/chromium/svg/as-image/svg-non-integer-scaled-image-expected.txt:
* platform/chromium/svg/zoom/page/zoom-svg-as-image-expected.txt:
* platform/chromium/svg/zoom/page/zoom-svg-as-relative-image-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@133172 268f45cc-cd09-0410-ab3c-d52691b4dbfc
40 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/sub-pixel/tiled-canvas-elements-expected.txt [new file with mode: 0644]
LayoutTests/fast/sub-pixel/tiled-canvas-elements.html [new file with mode: 0644]
LayoutTests/platform/chromium-linux/compositing/overflow/overflow-compositing-descendant-expected.png
LayoutTests/platform/chromium-linux/compositing/overflow/scroll-ancestor-update-expected.png
LayoutTests/platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-absolute-size-2-expected.png
LayoutTests/platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-absolute-size-2-expected.txt
LayoutTests/platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-absolute-size-expected.txt
LayoutTests/platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-auto-size-expected.png
LayoutTests/platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-percentage-size-expected.png
LayoutTests/platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-percentage-size-expected.txt
LayoutTests/platform/chromium-win/svg/as-image/svg-non-integer-scaled-image-expected.png
LayoutTests/platform/chromium-win/svg/zoom/page/zoom-svg-through-object-with-auto-size-expected.txt
LayoutTests/platform/chromium/fast/reflections/reflection-with-zoom-expected.txt
LayoutTests/platform/chromium/svg/as-image/svg-non-integer-scaled-image-expected.txt
LayoutTests/platform/chromium/svg/zoom/page/zoom-svg-as-image-expected.txt
LayoutTests/platform/chromium/svg/zoom/page/zoom-svg-as-relative-image-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/html/ImageDocument.cpp
Source/WebCore/loader/cache/CachedImage.cpp
Source/WebCore/loader/cache/CachedImage.h
Source/WebCore/platform/graphics/FractionalLayoutSize.h
Source/WebCore/rendering/RenderBox.h
Source/WebCore/rendering/RenderHTMLCanvas.cpp
Source/WebCore/rendering/RenderImage.cpp
Source/WebCore/rendering/RenderImage.h
Source/WebCore/rendering/RenderImageResource.h
Source/WebCore/rendering/RenderImageResourceStyleImage.h
Source/WebCore/rendering/RenderReplaced.cpp
Source/WebCore/rendering/RenderReplaced.h
Source/WebCore/rendering/RenderVideo.cpp
Source/WebCore/rendering/RenderVideo.h
Source/WebCore/rendering/style/StyleCachedImage.cpp
Source/WebCore/rendering/style/StyleCachedImage.h
Source/WebCore/rendering/style/StyleCachedImageSet.cpp
Source/WebCore/rendering/style/StyleCachedImageSet.h
Source/WebCore/rendering/style/StyleGeneratedImage.cpp
Source/WebCore/rendering/style/StyleGeneratedImage.h
Source/WebCore/rendering/style/StyleImage.h
Source/WebCore/rendering/style/StylePendingImage.h