Addressing post-review comments in r177035
https://bugs.webkit.org/show_bug.cgi?id=139557
Patch by Myles C. Maxfield <mmaxfield@apple.com> on 2014-12-15
Reviewed by Darin Adler.
Source/WebCore:
This patch deletes the helper functions rendererBoundingBox() and rendererAnchorRect() and
migrates callers to using renderers directly.
It also improves the comment in RenderElement.h regarding RenderElement::anchorRect().
No new tests because this is simply refactoring.
* WebCore.exp.in: Delete exported symbol for rendererBoundingBox()
* accessibility/AccessibilitySlider.cpp:
(WebCore::AccessibilitySliderThumb::elementRect): Migrate off rendererBoundingBox()
* dom/ContainerNode.cpp:
(WebCore::rendererAnchorRect): Deleted.
* dom/ContainerNode.h:
* dom/Node.cpp:
(WebCore::rendererBoundingBox): Deleted.
* dom/Node.h:
* html/ColorInputType.cpp:
(WebCore::ColorInputType::elementRectRelativeToRootView): Migrate off rendererBoundingBox().
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::setupDateTimeChooserParameters): Ditto.
* html/ValidationMessage.cpp:
(WebCore::ValidationMessage::buildBubbleTree): Ditto.
* page/FrameView.cpp:
(WebCore::FrameView::scrollElementToRect): Migrate off rendererAnchorRect().
(WebCore::FrameView::scrollToAnchor): Ditto.
* page/SpatialNavigation.cpp:
(WebCore::nodeRectInAbsoluteCoordinates): Migrate off rendererBoundingBox().
* rendering/RenderElement.h:
Source/WebKit/mac:
* WebView/WebActionMenuController.mm:
(elementBoundingBoxInWindowCoordinatesFromNode): Migrate off rendererBoundingBox().
Source/WebKit2:
* Shared/WebHitTestResult.cpp:
(WebKit::WebHitTestResult::Data::elementBoundingBoxInWindowCoordinates): Migrate off rendererBoundingBox().
* WebProcess/WebPage/CoordinatedGraphics/WebPageCoordinatedGraphics.cpp:
(WebKit::WebPage::findZoomableAreaForPoint): Ditto.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@177301 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/page/SpatialNavigation.cpp b/Source/WebCore/page/SpatialNavigation.cpp
index fd0f8fe..a4817b5 100644
--- a/Source/WebCore/page/SpatialNavigation.cpp
+++ b/Source/WebCore/page/SpatialNavigation.cpp
@@ -523,7 +523,9 @@
if (is<Document>(*node))
return frameRectInAbsoluteCoordinates(downcast<Document>(*node).frame());
- LayoutRect rect = rectToAbsoluteCoordinates(node->document().frame(), rendererBoundingBox(*node));
+ LayoutRect rect;
+ if (RenderObject* renderer = node->renderer())
+ rect = rectToAbsoluteCoordinates(node->document().frame(), renderer->absoluteBoundingBoxRect());
// For authors that use border instead of outline in their CSS, we compensate by ignoring the border when calculating
// the rect of the focused element.