Update LayoutUnit usage in descendants of RenderReplaced
authorleviw@chromium.org <leviw@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Mar 2012 09:32:01 +0000 (09:32 +0000)
committerleviw@chromium.org <leviw@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Mar 2012 09:32:01 +0000 (09:32 +0000)
commitef6d3fb6d04d8e2780708131e0b019289bf02d80
treee0bcd7febbba63ce357e8408e7bb856c5b98a628
parent4843fa1bec2aa57d996f52cb09aa020dc1c60e16
Update LayoutUnit usage in descendants of RenderReplaced
https://bugs.webkit.org/show_bug.cgi?id=80918

Reviewed by Eric Seidel.

Replaced elements have to flow in the new sub-pixel Render Tree, but since the rendering of these
often takes place outside of WebCore (or in cases such as foreign objects, in WebCore after
passing through platform code), care must be taken to determine the final rendered size and
location before render time. This patch brings these classes up to the latest and greatest in the
subpixellayout branch.

See https://trac.webkit.org/wiki/LayoutUnit for more information.

No new tests. No change in behavior.

* rendering/RenderFrameBase.cpp:
(WebCore::RenderFrameBase::layoutWithFlattening): Build Fix.
* rendering/RenderFullScreen.cpp:
(RenderFullScreen::createPlaceholder): Ditto.
* rendering/RenderFullScreen.h:
(RenderFullScreen): Ditto.
* rendering/RenderHTMLCanvas.cpp:
(WebCore::RenderHTMLCanvas::canvasSizeChanged): Ditto.
* rendering/RenderIFrame.cpp:
(WebCore::RenderIFrame::computeLogicalHeight): Ditto.
(WebCore::RenderIFrame::computeLogicalWidth): Ditto.
* rendering/RenderImage.cpp:
(WebCore::RenderImage::updateIntrinsicSizeIfNeeded): Intrinsic sizes are always integers, since they
originate outside of WebCore.
(WebCore::RenderImage::paintIntoRect): Use pixel snapping to paint into an arbitrary rect.
(WebCore::RenderImage::computeReplacedLogicalWidth): Intrinsic size is always integral -- rounding
values to integers.
* rendering/RenderImage.h:
(RenderImage):
* rendering/RenderVideo.cpp:
(WebCore::RenderVideo::videoBox):
(WebCore::RenderVideo::paintReplaced): Painting at integer boundaries.
* rendering/RenderWidget.cpp:
(WebCore):
(WebCore::roundedIntRect): Widgets are rendered outside of WebCore, so we always align them to
integer boundaries. This means we can actually round the size of our ultimate content box. This
function is implemented here specifically to prevent its misuse if we put it elsewhere.
(WebCore::RenderWidget::setWidgetGeometry): We simplify layout by taking a LayoutRect and rounding
it to its final location within this function.
(WebCore::RenderWidget::updateWidgetGeometry): We keep things in LayoutUnits until handing off to
setWidgetGeometry.
(WebCore::RenderWidget::paint): Rounding the paint location before handing painting off to the
widget itself.
* rendering/RenderWidget.h:
(RenderWidget):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@111515 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderFrameBase.cpp
Source/WebCore/rendering/RenderFullScreen.cpp
Source/WebCore/rendering/RenderFullScreen.h
Source/WebCore/rendering/RenderHTMLCanvas.cpp
Source/WebCore/rendering/RenderIFrame.cpp
Source/WebCore/rendering/RenderImage.cpp
Source/WebCore/rendering/RenderImage.h
Source/WebCore/rendering/RenderVideo.cpp
Source/WebCore/rendering/RenderWidget.cpp
Source/WebCore/rendering/RenderWidget.h