Make borderBoxRect sub-pixel precise and add a pixel snapped version
authorleviw@chromium.org <leviw@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Apr 2012 23:24:15 +0000 (23:24 +0000)
committerleviw@chromium.org <leviw@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Apr 2012 23:24:15 +0000 (23:24 +0000)
commitd4f48ea957c33d5eb1988706cf3a6a3e08d26e60
tree463b8093f6b5cbbf0d8695868899e58e66035461
parentc3fee3ac44f3429ed8ead6ea320de5976d7193cf
Make borderBoxRect sub-pixel precise and add a pixel snapped version
https://bugs.webkit.org/show_bug.cgi?id=84063

Reviewed by Eric Seidel.

In an effort to prevent misuse, we previously decided to have borderBoxRect return a
pixel-snapped IntRect. This is because borderBoxRect returns a rect that's positioned
at (0,0), and therefore won't snap to the same size as the element it's covering.

There are a couple uses of borderBoxRect that don't pixel snap the values and require
sub-pixel precision. This patch adds a pixelSnappedBorderBoxRect that makes the snapping
explicit, and moves uses that would otherwise pixel snap the rect to this version to
avoid producing a rect of the incorrect size. For details about pixel snapping with
LayoutUnits, please see https://trac.webkit.org/wiki/LayoutUnit

No new tests. No change in behavior.

* html/shadow/TextControlInnerElements.cpp:
(WebCore::SpinButtonElement::defaultEventHandler):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::addVisualOverflowFromTheme):
* rendering/RenderBox.h:
(WebCore::RenderBox::borderBoxRect):
(WebCore::RenderBox::pixelSnappedBorderBoxRect):
(WebCore::RenderBox::borderBoundingBox):
(WebCore::RenderBox::hasVisualOverflow):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollCornerRect):
(WebCore::RenderLayer::scrollCornerAndResizerRect):
(WebCore::RenderLayer::horizontalScrollbarStart):
(WebCore::RenderLayer::positionOverflowControls):
(WebCore::RenderLayer::paintResizer):
(WebCore::RenderLayer::hitTestOverflowControls):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):
(WebCore::RenderLayerBacking::startAnimation):
(WebCore::RenderLayerBacking::startTransition):
* rendering/RenderTable.cpp:
(WebCore::RenderTable::addOverflowFromChildren):
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::paintSearchFieldCancelButton):
(WebCore::RenderThemeMac::paintSearchFieldResultsDecoration):
(WebCore::RenderThemeMac::paintSearchFieldResultsButton):
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::paintReplaced):
(WebCore::RenderSVGRoot::computeFloatRectForRepaint):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@114315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/html/shadow/TextControlInnerElements.cpp
Source/WebCore/rendering/RenderBlock.cpp
Source/WebCore/rendering/RenderBox.h
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderLayerBacking.cpp
Source/WebCore/rendering/RenderTable.cpp
Source/WebCore/rendering/RenderThemeMac.mm
Source/WebCore/rendering/svg/RenderSVGRoot.cpp