<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[177301] trunk/Source</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/177301">177301</a></dd>
<dt>Author</dt> <dd>mmaxfield@apple.com</dd>
<dt>Date</dt> <dd>2014-12-15 12:15:05 -0800 (Mon, 15 Dec 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Addressing post-review comments in <a href="http://trac.webkit.org/projects/webkit/changeset/177035">r177035</a>
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.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCoreexpin">trunk/Source/WebCore/WebCore.exp.in</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilitySlidercpp">trunk/Source/WebCore/accessibility/AccessibilitySlider.cpp</a></li>
<li><a href="#trunkSourceWebCoredomContainerNodecpp">trunk/Source/WebCore/dom/ContainerNode.cpp</a></li>
<li><a href="#trunkSourceWebCoredomContainerNodeh">trunk/Source/WebCore/dom/ContainerNode.h</a></li>
<li><a href="#trunkSourceWebCoredomNodecpp">trunk/Source/WebCore/dom/Node.cpp</a></li>
<li><a href="#trunkSourceWebCoredomNodeh">trunk/Source/WebCore/dom/Node.h</a></li>
<li><a href="#trunkSourceWebCorehtmlColorInputTypecpp">trunk/Source/WebCore/html/ColorInputType.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLInputElementcpp">trunk/Source/WebCore/html/HTMLInputElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlValidationMessagecpp">trunk/Source/WebCore/html/ValidationMessage.cpp</a></li>
<li><a href="#trunkSourceWebCorepageFrameViewcpp">trunk/Source/WebCore/page/FrameView.cpp</a></li>
<li><a href="#trunkSourceWebCorepageSpatialNavigationcpp">trunk/Source/WebCore/page/SpatialNavigation.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderElementh">trunk/Source/WebCore/rendering/RenderElement.h</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebActionMenuControllermm">trunk/Source/WebKit/mac/WebView/WebActionMenuController.mm</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2SharedWebHitTestResultcpp">trunk/Source/WebKit2/Shared/WebHitTestResult.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageCoordinatedGraphicsWebPageCoordinatedGraphicscpp">trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/WebPageCoordinatedGraphics.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (177300 => 177301)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-12-15 19:49:24 UTC (rev 177300)
+++ trunk/Source/WebCore/ChangeLog        2014-12-15 20:15:05 UTC (rev 177301)
</span><span class="lines">@@ -1,5 +1,41 @@
</span><span class="cx"> 2014-12-15 Myles C. Maxfield <mmaxfield@apple.com>
</span><span class="cx">
</span><ins>+ Addressing post-review comments in r177035
+ https://bugs.webkit.org/show_bug.cgi?id=139557
+
+ Reviewed by Darin Adler.
+
+ 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:
+
+2014-12-15 Myles C. Maxfield <mmaxfield@apple.com>
+
</ins><span class="cx"> Delete Notation because we don't use it
</span><span class="cx"> https://bugs.webkit.org/show_bug.cgi?id=139171
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.exp.in (177300 => 177301)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.exp.in        2014-12-15 19:49:24 UTC (rev 177300)
+++ trunk/Source/WebCore/WebCore.exp.in        2014-12-15 20:15:05 UTC (rev 177301)
</span><span class="lines">@@ -867,7 +867,6 @@
</span><span class="cx"> __ZN7WebCore19enclosingLayoutRectERKNS_9FloatRectE
</span><span class="cx"> __ZN7WebCore19floatValueForLengthERKNS_6LengthEf
</span><span class="cx"> __ZN7WebCore19getFileCreationTimeERKN3WTF6StringERl
</span><del>-__ZN7WebCore19rendererBoundingBoxERKNS_4NodeE
</del><span class="cx"> __ZN7WebCore19toInt32EnforceRangeEPN3JSC9ExecStateENS0_7JSValueE
</span><span class="cx"> __ZN7WebCore20ApplicationCacheHost17maybeLoadResourceEPNS_14ResourceLoaderERKNS_15ResourceRequestERKNS_3URLE
</span><span class="cx"> __ZN7WebCore20ApplicationCacheHost25maybeLoadFallbackForErrorEPNS_14ResourceLoaderERKNS_13ResourceErrorE
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilitySlidercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilitySlider.cpp (177300 => 177301)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilitySlider.cpp        2014-12-15 19:49:24 UTC (rev 177300)
+++ trunk/Source/WebCore/accessibility/AccessibilitySlider.cpp        2014-12-15 20:15:05 UTC (rev 177301)
</span><span class="lines">@@ -159,7 +159,9 @@
</span><span class="cx"> RenderObject* sliderRenderer = m_parent->renderer();
</span><span class="cx"> if (!sliderRenderer || !sliderRenderer->isSlider())
</span><span class="cx"> return LayoutRect();
</span><del>- return rendererBoundingBox(*downcast<HTMLInputElement>(sliderRenderer->node())->sliderThumbElement());
</del><ins>+ if (RenderElement* thumbRenderer = downcast<HTMLInputElement>(sliderRenderer->node())->sliderThumbElement()->renderer())
+ return thumbRenderer->absoluteBoundingBoxRect();
+ return LayoutRect();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool AccessibilitySliderThumb::computeAccessibilityIsIgnored() const
</span></span></pre></div>
<a id="trunkSourceWebCoredomContainerNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ContainerNode.cpp (177300 => 177301)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ContainerNode.cpp        2014-12-15 19:49:24 UTC (rev 177300)
+++ trunk/Source/WebCore/dom/ContainerNode.cpp        2014-12-15 20:15:05 UTC (rev 177301)
</span><span class="lines">@@ -910,11 +910,4 @@
</span><span class="cx"> return ensureRareData().ensureNodeLists().addCacheWithAtomicName<RadioNodeList>(*this, name);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-LayoutRect rendererAnchorRect(const ContainerNode& node)
-{
- if (RenderElement* renderer = node.renderer())
- return renderer->anchorRect();
- return LayoutRect();
-}
-
</del><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoredomContainerNodeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ContainerNode.h (177300 => 177301)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ContainerNode.h        2014-12-15 19:49:24 UTC (rev 177300)
+++ trunk/Source/WebCore/dom/ContainerNode.h        2014-12-15 20:15:05 UTC (rev 177301)
</span><span class="lines">@@ -304,8 +304,6 @@
</span><span class="cx"> ChildNodesLazySnapshot* m_nextSnapshot;
</span><span class="cx"> };
</span><span class="cx">
</span><del>-LayoutRect rendererAnchorRect(const ContainerNode&);
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span><span class="cx"> SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::ContainerNode)
</span></span></pre></div>
<a id="trunkSourceWebCoredomNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Node.cpp (177300 => 177301)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Node.cpp        2014-12-15 19:49:24 UTC (rev 177300)
+++ trunk/Source/WebCore/dom/Node.cpp        2014-12-15 20:15:05 UTC (rev 177301)
</span><span class="lines">@@ -2248,13 +2248,6 @@
</span><span class="cx"> return inDocument() && document().hasLivingRenderTree();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-IntRect rendererBoundingBox(const Node& node)
-{
- if (RenderObject* renderer = node.renderer())
- return renderer->absoluteBoundingBoxRect();
- return IntRect();
-}
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span><span class="cx"> #ifndef NDEBUG
</span></span></pre></div>
<a id="trunkSourceWebCoredomNodeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Node.h (177300 => 177301)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Node.h        2014-12-15 19:49:24 UTC (rev 177300)
+++ trunk/Source/WebCore/dom/Node.h        2014-12-15 20:15:05 UTC (rev 177301)
</span><span class="lines">@@ -739,8 +739,6 @@
</span><span class="cx"> return parentNode();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-WEBCORE_EXPORT IntRect rendererBoundingBox(const Node&);
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span><span class="cx"> #ifndef NDEBUG
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlColorInputTypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/ColorInputType.cpp (177300 => 177301)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/ColorInputType.cpp        2014-12-15 19:49:24 UTC (rev 177300)
+++ trunk/Source/WebCore/html/ColorInputType.cpp        2014-12-15 20:15:05 UTC (rev 177301)
</span><span class="lines">@@ -204,7 +204,9 @@
</span><span class="cx">
</span><span class="cx"> IntRect ColorInputType::elementRectRelativeToRootView() const
</span><span class="cx"> {
</span><del>- return element().document().view()->contentsToRootView(rendererBoundingBox(element()));
</del><ins>+ if (!element().renderer())
+ return IntRect();
+ element().document().view()->contentsToRootView(element().renderer()->absoluteBoundingBoxRect());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> Color ColorInputType::currentColor()
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLInputElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLInputElement.cpp (177300 => 177301)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLInputElement.cpp        2014-12-15 19:49:24 UTC (rev 177300)
+++ trunk/Source/WebCore/html/HTMLInputElement.cpp        2014-12-15 20:15:05 UTC (rev 177301)
</span><span class="lines">@@ -1877,7 +1877,10 @@
</span><span class="cx"> parameters.stepBase = 0;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- parameters.anchorRectInRootView = document().view()->contentsToRootView(rendererBoundingBox(*this));
</del><ins>+ if (RenderObject* renderer = this->renderer())
+ parameters.anchorRectInRootView = document().view()->contentsToRootView(renderer->absoluteBoundingBoxRect());
+ else
+ parameters.anchorRectInRootView = IntRect();
</ins><span class="cx"> parameters.currentValue = value();
</span><span class="cx"> parameters.isAnchorElementRTL = computedStyle()->direction() == RTL;
</span><span class="cx"> #if ENABLE(DATALIST_ELEMENT)
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlValidationMessagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/ValidationMessage.cpp (177300 => 177301)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/ValidationMessage.cpp        2014-12-15 19:49:24 UTC (rev 177300)
+++ trunk/Source/WebCore/html/ValidationMessage.cpp        2014-12-15 20:15:05 UTC (rev 177301)
</span><span class="lines">@@ -168,6 +168,10 @@
</span><span class="cx"> void ValidationMessage::buildBubbleTree()
</span><span class="cx"> {
</span><span class="cx"> ASSERT(!validationMessageClient());
</span><ins>+
+ if (!m_element->renderer())
+ return;
+
</ins><span class="cx"> ShadowRoot& shadowRoot = m_element->ensureUserAgentShadowRoot();
</span><span class="cx">
</span><span class="cx"> Document& document = m_element->document();
</span><span class="lines">@@ -178,7 +182,7 @@
</span><span class="cx"> m_bubble->setInlineStyleProperty(CSSPropertyPosition, CSSValueAbsolute);
</span><span class="cx"> shadowRoot.appendChild(m_bubble.get(), ASSERT_NO_EXCEPTION);
</span><span class="cx"> document.updateLayout();
</span><del>- adjustBubblePosition(rendererBoundingBox(*m_element), m_bubble.get());
</del><ins>+ adjustBubblePosition(m_element->renderer()->absoluteBoundingBoxRect(), m_bubble.get());
</ins><span class="cx">
</span><span class="cx"> RefPtr<HTMLDivElement> clipper = HTMLDivElement::create(document);
</span><span class="cx"> clipper->setPseudo(AtomicString("-webkit-validation-bubble-arrow-clipper", AtomicString::ConstructFromLiteral));
</span></span></pre></div>
<a id="trunkSourceWebCorepageFrameViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/FrameView.cpp (177300 => 177301)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/FrameView.cpp        2014-12-15 19:49:24 UTC (rev 177300)
+++ trunk/Source/WebCore/page/FrameView.cpp        2014-12-15 20:15:05 UTC (rev 177301)
</span><span class="lines">@@ -2018,7 +2018,9 @@
</span><span class="cx"> {
</span><span class="cx"> frame().document()->updateLayoutIgnorePendingStylesheets();
</span><span class="cx">
</span><del>- LayoutRect bounds = rendererAnchorRect(*element);
</del><ins>+ LayoutRect bounds;
+ if (RenderElement* renderer = element->renderer())
+ bounds = renderer->anchorRect();
</ins><span class="cx"> int centeringOffsetX = (rect.width() - bounds.width()) / 2;
</span><span class="cx"> int centeringOffsetY = (rect.height() - bounds.height()) / 2;
</span><span class="cx"> setScrollPosition(IntPoint(bounds.x() - centeringOffsetX - rect.x(), bounds.y() - centeringOffsetY - rect.y()));
</span><span class="lines">@@ -2787,8 +2789,8 @@
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> LayoutRect rect;
</span><del>- if (anchorNode != frame().document())
- rect = rendererAnchorRect(*anchorNode.get());
</del><ins>+ if (anchorNode != frame().document() && anchorNode->renderer())
+ rect = anchorNode->renderer()->anchorRect();
</ins><span class="cx">
</span><span class="cx"> // Scroll nested layers and frames to reveal the anchor.
</span><span class="cx"> // Align to the top and to the closest side (this matches other browsers).
</span></span></pre></div>
<a id="trunkSourceWebCorepageSpatialNavigationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/SpatialNavigation.cpp (177300 => 177301)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/SpatialNavigation.cpp        2014-12-15 19:49:24 UTC (rev 177300)
+++ trunk/Source/WebCore/page/SpatialNavigation.cpp        2014-12-15 20:15:05 UTC (rev 177301)
</span><span class="lines">@@ -523,7 +523,9 @@
</span><span class="cx"> if (is<Document>(*node))
</span><span class="cx"> return frameRectInAbsoluteCoordinates(downcast<Document>(*node).frame());
</span><span class="cx">
</span><del>- LayoutRect rect = rectToAbsoluteCoordinates(node->document().frame(), rendererBoundingBox(*node));
</del><ins>+ LayoutRect rect;
+ if (RenderObject* renderer = node->renderer())
+ rect = rectToAbsoluteCoordinates(node->document().frame(), renderer->absoluteBoundingBoxRect());
</ins><span class="cx">
</span><span class="cx"> // For authors that use border instead of outline in their CSS, we compensate by ignoring the border when calculating
</span><span class="cx"> // the rect of the focused element.
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderElement.h (177300 => 177301)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderElement.h        2014-12-15 19:49:24 UTC (rev 177300)
+++ trunk/Source/WebCore/rendering/RenderElement.h        2014-12-15 20:15:05 UTC (rev 177301)
</span><span class="lines">@@ -151,7 +151,8 @@
</span><span class="cx"> bool hasHiddenBackface() const { return style().backfaceVisibility() == BackfaceVisibilityHidden; }
</span><span class="cx">
</span><span class="cx"> // anchorRect() is conceptually similar to absoluteBoundingBoxRect(), but is intended for scrolling to an anchor.
</span><del>- // It works differently than absoluteBoundingBoxRect() for inline renderers.
</del><ins>+ // For inline renderers, this gets the logical top left of the first leaf child and the logical bottom right of the
+ // last leaf child, converts them to absolute coordinates, and makes a box out of them.
</ins><span class="cx"> LayoutRect anchorRect() const;
</span><span class="cx">
</span><span class="cx"> bool hasFilter() const { return style().hasFilter(); }
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (177300 => 177301)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2014-12-15 19:49:24 UTC (rev 177300)
+++ trunk/Source/WebKit/mac/ChangeLog        2014-12-15 20:15:05 UTC (rev 177301)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2014-12-15 Myles C. Maxfield <mmaxfield@apple.com>
+
+ Addressing post-review comments in r177035
+ https://bugs.webkit.org/show_bug.cgi?id=139557
+
+ Reviewed by Darin Adler.
+
+ * WebView/WebActionMenuController.mm:
+ (elementBoundingBoxInWindowCoordinatesFromNode): Migrate off rendererBoundingBox().
+
</ins><span class="cx"> 2014-12-15 Timothy Horton <timothy_horton@apple.com>
</span><span class="cx">
</span><span class="cx"> Implement Data Detectors immediate actions for Legacy WebKit
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebActionMenuControllermm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebActionMenuController.mm (177300 => 177301)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebActionMenuController.mm        2014-12-15 19:49:24 UTC (rev 177300)
+++ trunk/Source/WebKit/mac/WebView/WebActionMenuController.mm        2014-12-15 20:15:05 UTC (rev 177301)
</span><span class="lines">@@ -256,7 +256,11 @@
</span><span class="cx"> if (!view)
</span><span class="cx"> return IntRect();
</span><span class="cx">
</span><del>- return view->contentsToWindow(rendererBoundingBox(*node));
</del><ins>+ RenderObject* renderer = node->renderer();
+ if (!renderer)
+ return IntRect();
+
+ return view->contentsToWindow(renderer->absoluteBoundingBoxRect());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (NSArray *)_defaultMenuItemsForLink
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (177300 => 177301)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-12-15 19:49:24 UTC (rev 177300)
+++ trunk/Source/WebKit2/ChangeLog        2014-12-15 20:15:05 UTC (rev 177301)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2014-12-15 Myles C. Maxfield <mmaxfield@apple.com>
+
+ Addressing post-review comments in r177035
+ https://bugs.webkit.org/show_bug.cgi?id=139557
+
+ Reviewed by Darin Adler.
+
+ * Shared/WebHitTestResult.cpp:
+ (WebKit::WebHitTestResult::Data::elementBoundingBoxInWindowCoordinates): Migrate off rendererBoundingBox().
+ * WebProcess/WebPage/CoordinatedGraphics/WebPageCoordinatedGraphics.cpp:
+ (WebKit::WebPage::findZoomableAreaForPoint): Ditto.
+
</ins><span class="cx"> 2014-12-15 Timothy Horton <timothy_horton@apple.com>
</span><span class="cx">
</span><span class="cx"> Implement Data Detectors immediate actions for WebKit2
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedWebHitTestResultcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/WebHitTestResult.cpp (177300 => 177301)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebHitTestResult.cpp        2014-12-15 19:49:24 UTC (rev 177300)
+++ trunk/Source/WebKit2/Shared/WebHitTestResult.cpp        2014-12-15 20:15:05 UTC (rev 177301)
</span><span class="lines">@@ -118,7 +118,11 @@
</span><span class="cx"> if (!view)
</span><span class="cx"> return IntRect();
</span><span class="cx">
</span><del>- return view->contentsToWindow(rendererBoundingBox(*node));
</del><ins>+ RenderObject* renderer = node->renderer();
+ if (!renderer)
+ return IntRect();
+
+ return view->contentsToWindow(renderer->absoluteBoundingBoxRect());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> } // WebKit
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageCoordinatedGraphicsWebPageCoordinatedGraphicscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/WebPageCoordinatedGraphics.cpp (177300 => 177301)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/WebPageCoordinatedGraphics.cpp        2014-12-15 19:49:24 UTC (rev 177300)
+++ trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/WebPageCoordinatedGraphics.cpp        2014-12-15 20:15:05 UTC (rev 177301)
</span><span class="lines">@@ -55,7 +55,9 @@
</span><span class="cx"> if (!node)
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- IntRect zoomableArea = rendererBoundingBox(*node);
</del><ins>+ IntRect zoomableArea;
+ if (RenderObject* renderer = node->renderer())
+ zoomableArea = renderer->absoluteBoundingBoxRect();
</ins><span class="cx">
</span><span class="cx"> while (true) {
</span><span class="cx"> bool found = !node->isTextNode() && !node->isShadowRoot();
</span><span class="lines">@@ -71,7 +73,8 @@
</span><span class="cx"> break;
</span><span class="cx">
</span><span class="cx"> node = node->parentNode();
</span><del>- zoomableArea.unite(rendererBoundingBox(*node));
</del><ins>+ if (RenderObject* renderer = node.renderer())
+ zoomableArea.unite(renderer->absoluteBoundingBoxRect());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (node->document().frame() && node->document().frame()->view()) {
</span></span></pre>
</div>
</div>
</body>
</html>