<!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>[177035] trunk</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/177035">177035</a></dd>
<dt>Author</dt> <dd>mmaxfield@apple.com</dd>
<dt>Date</dt> <dd>2014-12-09 13:03:54 -0800 (Tue, 09 Dec 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Delete Node::boundingBox()
https://bugs.webkit.org/show_bug.cgi?id=139333

Source/WebCore:

Conceptually, boundingBox() should be on RenderInline. In addition,
Node::boundingBox() is completely broken for inline elements: it
makes a rect from the top left of the first inline child to the
bottom right of the last inline child, disregarding the intermediate
inline children. This breaks with vertical text and with line
breaks.

What makes this problem worse is that some functions actually rely
on this bad behavior. These functions are functions that use the
Node's so-called &quot;bounding box&quot; to scroll to an anchor tag.

This patch goes through all the call sites of Node::boundingBox(),
and segregates them into calls that expect the true bounding box
and calls that need this false bounding box. This patch then moves
this false bounding box into RenderElement, using the name
anchorRect(). Callers what want the correct bounding box have been
updated to use RenderElement::absoluteBoundingBoxRect().

Reviewed by Zalan Bujtas.

No new tests because there should be no behavior change.

* accessibility/AccessibilitySlider.cpp:
(WebCore::AccessibilitySliderThumb::elementRect): Use
RenderObject::absoluteBoundingBoxRect()
* dom/ContainerNode.cpp:
(WebCore::ContainerNode::getUpperLeftCorner): Deleted.
(WebCore::ContainerNode::getLowerRightCorner): Deleted.
(WebCore::ContainerNode::boundingBox): Deleted.
* dom/ContainerNode.h:
* dom/Element.cpp:
(WebCore::Element::scrollIntoView): Use RenderElement::anchorRect().
(WebCore::Element::scrollIntoViewIfNeeded): Ditto.
(WebCore::Element::updateFocusAppearance): Ditto.
* dom/Node.cpp:
(WebCore::Node::boundingBox): Deleted.
* dom/Node.h:
(WebCore::Node::pixelSnappedBoundingBox): Deleted.
* html/ColorInputType.cpp:
(WebCore::ColorInputType::elementRectRelativeToRootView): Use
RenderObject::absoluteBoundingBoxRect()
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::setupDateTimeChooserParameters): Ditto.
* html/ValidationMessage.cpp:
(WebCore::ValidationMessage::buildBubbleTree): Ditto.
* page/FrameView.cpp:
(WebCore::FrameView::scrollElementToRect): Use
RenderElement::anchorRect().
(WebCore::FrameView::scrollToAnchor): Ditto.
* page/SpatialNavigation.cpp:
(WebCore::nodeRectInAbsoluteCoordinates): Use
RenderObject::absoluteBoundingBoxRect()
* rendering/RenderElement.cpp:
(WebCore::RenderElement::getUpperLeftCorner): Moved from ContainerNode.
(WebCore::RenderElement::getLowerRightCorner): Moved from
ContainerNode.
(WebCore::RenderElement::anchorRect): Moved from ContainerNode.
* rendering/RenderObject.h:
* rendering/RenderText.cpp:
(WebCore::RenderText::topOfFirstText): Helper for
RenderElement::anchorRect()
* rendering/RenderText.h:

Source/WebKit/mac:

Reviewed by Zalan Bujtas.

* WebView/WebActionMenuController.mm:
(elementBoundingBoxInWindowCoordinatesFromNode): Use
RenderObject::absoluteBoundingBoxRect().

Source/WebKit2:

Reviewed by Zalan Bujtas.

* Shared/WebHitTestResult.cpp:
(WebKit::WebHitTestResult::Data::elementBoundingBoxInWindowCoordinates):
Use RenderObject::absoluteBoundingBoxRect().
* WebProcess/WebPage/CoordinatedGraphics/WebPageCoordinatedGraphics.cpp:
(WebKit::WebPage::findZoomableAreaForPoint): Use
RenderObject::absoluteBoundingBoxRect().</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastspatialnavigationsnavcontainerwhitespaceexpectedtxt">trunk/LayoutTests/fast/spatial-navigation/snav-container-white-space-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastspatialnavigationsnavcontainerwhitespacehtml">trunk/LayoutTests/fast/spatial-navigation/snav-container-white-space.html</a></li>
<li><a href="#trunkLayoutTestsfastspatialnavigationsnavimagemapoverlappedareasexpectedtxt">trunk/LayoutTests/fast/spatial-navigation/snav-imagemap-overlapped-areas-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastspatialnavigationsnavimagemapoverlappedareashtml">trunk/LayoutTests/fast/spatial-navigation/snav-imagemap-overlapped-areas.html</a></li>
<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="#trunkSourceWebCoredomElementcpp">trunk/Source/WebCore/dom/Element.cpp</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="#trunkSourceWebCoreloaderFrameLoadercpp">trunk/Source/WebCore/loader/FrameLoader.cpp</a></li>
<li><a href="#trunkSourceWebCorepageFrameViewcpp">trunk/Source/WebCore/page/FrameView.cpp</a></li>
<li><a href="#trunkSourceWebCorepageFrameViewh">trunk/Source/WebCore/page/FrameView.h</a></li>
<li><a href="#trunkSourceWebCorepageSpatialNavigationcpp">trunk/Source/WebCore/page/SpatialNavigation.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderElementcpp">trunk/Source/WebCore/rendering/RenderElement.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderElementh">trunk/Source/WebCore/rendering/RenderElement.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderTextcpp">trunk/Source/WebCore/rendering/RenderText.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderTexth">trunk/Source/WebCore/rendering/RenderText.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="trunkLayoutTestsfastspatialnavigationsnavcontainerwhitespaceexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/spatial-navigation/snav-container-white-space-expected.txt (177034 => 177035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/spatial-navigation/snav-container-white-space-expected.txt        2014-12-09 20:50:16 UTC (rev 177034)
+++ trunk/LayoutTests/fast/spatial-navigation/snav-container-white-space-expected.txt        2014-12-09 21:03:54 UTC (rev 177035)
</span><span class="lines">@@ -1,5 +1,6 @@
</span><span class="cx"> This is an element
</span><span class="cx">  
</span><ins>+
</ins><span class="cx"> This is an element
</span><span class="cx"> This is an element
</span><span class="cx">   
</span></span></pre></div>
<a id="trunkLayoutTestsfastspatialnavigationsnavcontainerwhitespacehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/spatial-navigation/snav-container-white-space.html (177034 => 177035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/spatial-navigation/snav-container-white-space.html        2014-12-09 20:50:16 UTC (rev 177034)
+++ trunk/LayoutTests/fast/spatial-navigation/snav-container-white-space.html        2014-12-09 21:03:54 UTC (rev 177035)
</span><span class="lines">@@ -72,7 +72,7 @@
</span><span class="cx">         &lt;img src=&quot;resources/green.png&quot; height=&quot;42&quot; width=&quot;76&quot;  border=&quot;0&quot;/&gt;
</span><span class="cx">       &lt;/a&gt;
</span><span class="cx">     &lt;/div&gt;
</span><del>-
</del><ins>+    &lt;br/&gt;
</ins><span class="cx">     &lt;div&gt;
</span><span class="cx">       &lt;a href=&quot;#&quot; id=&quot;2&quot;&gt;This is an element&lt;/a&gt;&lt;br&gt;
</span><span class="cx">     &lt;/div&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsfastspatialnavigationsnavimagemapoverlappedareasexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/spatial-navigation/snav-imagemap-overlapped-areas-expected.txt (177034 => 177035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/spatial-navigation/snav-imagemap-overlapped-areas-expected.txt        2014-12-09 20:50:16 UTC (rev 177034)
+++ trunk/LayoutTests/fast/spatial-navigation/snav-imagemap-overlapped-areas-expected.txt        2014-12-09 21:03:54 UTC (rev 177035)
</span><span class="lines">@@ -1,4 +1,4 @@
</span><del>- 
</del><ins>+  
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> PASS gFocusedDocument.activeElement.getAttribute(&quot;id&quot;) is &quot;4&quot;
</span></span></pre></div>
<a id="trunkLayoutTestsfastspatialnavigationsnavimagemapoverlappedareashtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/spatial-navigation/snav-imagemap-overlapped-areas.html (177034 => 177035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/spatial-navigation/snav-imagemap-overlapped-areas.html        2014-12-09 20:50:16 UTC (rev 177034)
+++ trunk/LayoutTests/fast/spatial-navigation/snav-imagemap-overlapped-areas.html        2014-12-09 21:03:54 UTC (rev 177035)
</span><span class="lines">@@ -57,6 +57,7 @@
</span><span class="cx">   &lt;/map&gt;
</span><span class="cx"> 
</span><span class="cx">     &lt;a id=&quot;start&quot; href=&quot;a&quot;&gt;&lt;img src=&quot;resources/green.png&quot; width=50px height=50px&gt;&lt;/a&gt;
</span><ins>+    &lt;br&gt;
</ins><span class="cx">     &lt;div&gt;
</span><span class="cx">       &lt;img src=&quot;resources/green.png&quot; width=200px height=200px usemap=&quot;#map&quot;&gt;
</span><span class="cx">     &lt;/div&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (177034 => 177035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-12-09 20:50:16 UTC (rev 177034)
+++ trunk/Source/WebCore/ChangeLog        2014-12-09 21:03:54 UTC (rev 177035)
</span><span class="lines">@@ -1,3 +1,71 @@
</span><ins>+2014-12-09  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
+
+        Delete Node::boundingBox()
+        https://bugs.webkit.org/show_bug.cgi?id=139333
+
+        Conceptually, boundingBox() should be on RenderInline. In addition,
+        Node::boundingBox() is completely broken for inline elements: it
+        makes a rect from the top left of the first inline child to the
+        bottom right of the last inline child, disregarding the intermediate
+        inline children. This breaks with vertical text and with line
+        breaks.
+
+        What makes this problem worse is that some functions actually rely
+        on this bad behavior. These functions are functions that use the
+        Node's so-called &quot;bounding box&quot; to scroll to an anchor tag.
+
+        This patch goes through all the call sites of Node::boundingBox(),
+        and segregates them into calls that expect the true bounding box
+        and calls that need this false bounding box. This patch then moves
+        this false bounding box into RenderElement, using the name
+        anchorRect(). Callers what want the correct bounding box have been
+        updated to use RenderElement::absoluteBoundingBoxRect().
+
+        Reviewed by Zalan Bujtas.
+
+        No new tests because there should be no behavior change.
+
+        * accessibility/AccessibilitySlider.cpp:
+        (WebCore::AccessibilitySliderThumb::elementRect): Use
+        RenderObject::absoluteBoundingBoxRect()
+        * dom/ContainerNode.cpp:
+        (WebCore::ContainerNode::getUpperLeftCorner): Deleted.
+        (WebCore::ContainerNode::getLowerRightCorner): Deleted.
+        (WebCore::ContainerNode::boundingBox): Deleted.
+        * dom/ContainerNode.h:
+        * dom/Element.cpp:
+        (WebCore::Element::scrollIntoView): Use RenderElement::anchorRect().
+        (WebCore::Element::scrollIntoViewIfNeeded): Ditto.
+        (WebCore::Element::updateFocusAppearance): Ditto.
+        * dom/Node.cpp:
+        (WebCore::Node::boundingBox): Deleted.
+        * dom/Node.h:
+        (WebCore::Node::pixelSnappedBoundingBox): Deleted.
+        * html/ColorInputType.cpp:
+        (WebCore::ColorInputType::elementRectRelativeToRootView): Use
+        RenderObject::absoluteBoundingBoxRect()
+        * html/HTMLInputElement.cpp:
+        (WebCore::HTMLInputElement::setupDateTimeChooserParameters): Ditto.
+        * html/ValidationMessage.cpp:
+        (WebCore::ValidationMessage::buildBubbleTree): Ditto.
+        * page/FrameView.cpp:
+        (WebCore::FrameView::scrollElementToRect): Use
+        RenderElement::anchorRect().
+        (WebCore::FrameView::scrollToAnchor): Ditto.
+        * page/SpatialNavigation.cpp:
+        (WebCore::nodeRectInAbsoluteCoordinates): Use
+        RenderObject::absoluteBoundingBoxRect()
+        * rendering/RenderElement.cpp:
+        (WebCore::RenderElement::getUpperLeftCorner): Moved from ContainerNode.
+        (WebCore::RenderElement::getLowerRightCorner): Moved from
+        ContainerNode.
+        (WebCore::RenderElement::anchorRect): Moved from ContainerNode.
+        * rendering/RenderObject.h:
+        * rendering/RenderText.cpp:
+        (WebCore::RenderText::topOfFirstText): Helper for
+        RenderElement::anchorRect()
+        * rendering/RenderText.h:
+
</ins><span class="cx"> 2014-12-09  Antti Koivisto  &lt;antti@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         REGRESSION (r173272): When open PDF from Safari in iBooks, title is replaced to “QuickLookPDF-s72DbgAU-1”
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.exp.in (177034 => 177035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.exp.in        2014-12-09 20:50:16 UTC (rev 177034)
+++ trunk/Source/WebCore/WebCore.exp.in        2014-12-09 21:03:54 UTC (rev 177035)
</span><span class="lines">@@ -2320,6 +2320,7 @@
</span><span class="cx"> __ZN7WebCore19TextIndicatorWindowC1EP6NSView
</span><span class="cx"> __ZN7WebCore19TextIndicatorWindowD1Ev
</span><span class="cx"> __ZN7WebCore19applicationIsSafariEv
</span><ins>+__ZN7WebCore19rendererBoundingBoxERKNS_4NodeE
</ins><span class="cx"> __ZN7WebCore20PlatformEventFactory24createPlatformMouseEventEP7NSEventP6NSView
</span><span class="cx"> __ZN7WebCore20PlatformEventFactory27createPlatformKeyboardEventEP7NSEvent
</span><span class="cx"> __ZN7WebCore20ResourceHandleClient22willCacheResponseAsyncEPNS_14ResourceHandleEP19NSCachedURLResponse
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilitySlidercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilitySlider.cpp (177034 => 177035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilitySlider.cpp        2014-12-09 20:50:16 UTC (rev 177034)
+++ trunk/Source/WebCore/accessibility/AccessibilitySlider.cpp        2014-12-09 21:03:54 UTC (rev 177035)
</span><span class="lines">@@ -159,7 +159,7 @@
</span><span class="cx">     RenderObject* sliderRenderer = m_parent-&gt;renderer();
</span><span class="cx">     if (!sliderRenderer || !sliderRenderer-&gt;isSlider())
</span><span class="cx">         return LayoutRect();
</span><del>-    return downcast&lt;HTMLInputElement&gt;(sliderRenderer-&gt;node())-&gt;sliderThumbElement()-&gt;boundingBox();
</del><ins>+    return rendererBoundingBox(*downcast&lt;HTMLInputElement&gt;(sliderRenderer-&gt;node())-&gt;sliderThumbElement());
</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 (177034 => 177035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ContainerNode.cpp        2014-12-09 20:50:16 UTC (rev 177034)
+++ trunk/Source/WebCore/dom/ContainerNode.cpp        2014-12-09 21:03:54 UTC (rev 177035)
</span><span class="lines">@@ -777,126 +777,6 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool ContainerNode::getUpperLeftCorner(FloatPoint&amp; point) const
-{
-    if (!renderer())
-        return false;
-    // What is this code really trying to do?
-    RenderObject* o = renderer();
-    if (!o-&gt;isInline() || o-&gt;isReplaced()) {
-        point = o-&gt;localToAbsolute(FloatPoint(), UseTransforms);
-        return true;
-    }
-
-    // find the next text/image child, to get a position
-    while (o) {
-        RenderObject* p = o;
-        if (RenderObject* child = o-&gt;firstChildSlow())
-            o = child;
-        else if (o-&gt;nextSibling())
-            o = o-&gt;nextSibling();
-        else {
-            RenderObject* next = 0;
-            while (!next &amp;&amp; o-&gt;parent()) {
-                o = o-&gt;parent();
-                next = o-&gt;nextSibling();
-            }
-            o = next;
-
-            if (!o)
-                break;
-        }
-        ASSERT(o);
-
-        if (!o-&gt;isInline() || o-&gt;isReplaced()) {
-            point = o-&gt;localToAbsolute(FloatPoint(), UseTransforms);
-            return true;
-        }
-
-        if (p-&gt;node() &amp;&amp; p-&gt;node() == this &amp;&amp; is&lt;RenderText&gt;(*o) &amp;&amp; !downcast&lt;RenderText&gt;(*o).firstTextBox()) {
-            // do nothing - skip unrendered whitespace that is a child or next sibling of the anchor
-        } else if (is&lt;RenderText&gt;(*o) || o-&gt;isReplaced()) {
-            point = FloatPoint();
-            if (is&lt;RenderText&gt;(*o) &amp;&amp; downcast&lt;RenderText&gt;(*o).firstTextBox())
-                point.move(downcast&lt;RenderText&gt;(*o).linesBoundingBox().x(), downcast&lt;RenderText&gt;(*o).firstTextBox()-&gt;root().lineTop());
-            else if (is&lt;RenderBox&gt;(*o))
-                point.moveBy(downcast&lt;RenderBox&gt;(*o).location());
-            point = o-&gt;container()-&gt;localToAbsolute(point, UseTransforms);
-            return true;
-        }
-    }
-    
-    // If the target doesn't have any children or siblings that could be used to calculate the scroll position, we must be
-    // at the end of the document. Scroll to the bottom. FIXME: who said anything about scrolling?
-    if (!o &amp;&amp; document().view()) {
-        point = FloatPoint(0, document().view()-&gt;contentsHeight());
-        return true;
-    }
-    return false;
-}
-
-bool ContainerNode::getLowerRightCorner(FloatPoint&amp; point) const
-{
-    if (!renderer())
-        return false;
-
-    RenderObject* o = renderer();
-    if (!o-&gt;isInline() || o-&gt;isReplaced()) {
-        point = o-&gt;localToAbsolute(LayoutPoint(downcast&lt;RenderBox&gt;(*o).size()), UseTransforms);
-        return true;
-    }
-
-    // find the last text/image child, to get a position
-    while (o) {
-        if (RenderObject* child = o-&gt;lastChildSlow())
-            o = child;
-        else if (o-&gt;previousSibling())
-            o = o-&gt;previousSibling();
-        else {
-            RenderObject* prev = 0;
-            while (!prev) {
-                o = o-&gt;parent();
-                if (!o)
-                    return false;
-                prev = o-&gt;previousSibling();
-            }
-            o = prev;
-        }
-        ASSERT(o);
-        if (is&lt;RenderText&gt;(*o) || o-&gt;isReplaced()) {
-            point = FloatPoint();
-            if (is&lt;RenderText&gt;(*o)) {
-                IntRect linesBox = downcast&lt;RenderText&gt;(*o).linesBoundingBox();
-                if (!linesBox.maxX() &amp;&amp; !linesBox.maxY())
-                    continue;
-                point.moveBy(linesBox.maxXMaxYCorner());
-            } else
-                point.moveBy(downcast&lt;RenderBox&gt;(*o).frameRect().maxXMaxYCorner());
-            point = o-&gt;container()-&gt;localToAbsolute(point, UseTransforms);
-            return true;
-        }
-    }
-    return true;
-}
-
-LayoutRect ContainerNode::boundingBox() const
-{
-    FloatPoint upperLeft, lowerRight;
-    bool foundUpperLeft = getUpperLeftCorner(upperLeft);
-    bool foundLowerRight = getLowerRightCorner(lowerRight);
-    
-    // If we've found one corner, but not the other,
-    // then we should just return a point at the corner that we did find.
-    if (foundUpperLeft != foundLowerRight) {
-        if (foundUpperLeft)
-            lowerRight = upperLeft;
-        else
-            upperLeft = lowerRight;
-    } 
-
-    return enclosingLayoutRect(FloatRect(upperLeft, lowerRight.expandedTo(upperLeft) - upperLeft));
-}
-
</del><span class="cx"> unsigned ContainerNode::countChildNodes() const
</span><span class="cx"> {
</span><span class="cx">     unsigned count = 0;
</span><span class="lines">@@ -1030,4 +910,11 @@
</span><span class="cx">     return ensureRareData().ensureNodeLists().addCacheWithAtomicName&lt;RadioNodeList&gt;(*this, name);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+LayoutRect rendererAnchorRect(const ContainerNode&amp; node)
+{
+    if (RenderElement* renderer = node.renderer())
+        return renderer-&gt;anchorRect();
+    return LayoutRect();
+}
+
</ins><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoredomContainerNodeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ContainerNode.h (177034 => 177035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ContainerNode.h        2014-12-09 20:50:16 UTC (rev 177034)
+++ trunk/Source/WebCore/dom/ContainerNode.h        2014-12-09 21:03:54 UTC (rev 177035)
</span><span class="lines">@@ -112,8 +112,6 @@
</span><span class="cx"> 
</span><span class="cx">     void cloneChildNodes(ContainerNode* clone);
</span><span class="cx"> 
</span><del>-    virtual LayoutRect boundingBox() const override;
-
</del><span class="cx">     enum ChildChangeType { ElementInserted, ElementRemoved, TextInserted, TextRemoved, TextChanged, AllChildrenRemoved, NonContentsChildChanged };
</span><span class="cx">     enum ChildChangeSource { ChildChangeSourceParser, ChildChangeSourceAPI };
</span><span class="cx">     struct ChildChange {
</span><span class="lines">@@ -157,9 +155,6 @@
</span><span class="cx">     void removeBetween(Node* previousChild, Node* nextChild, Node&amp; oldChild);
</span><span class="cx">     void insertBeforeCommon(Node&amp; nextChild, Node&amp; oldChild);
</span><span class="cx"> 
</span><del>-    bool getUpperLeftCorner(FloatPoint&amp;) const;
-    bool getLowerRightCorner(FloatPoint&amp;) const;
-
</del><span class="cx">     void notifyChildInserted(Node&amp; child, ChildChangeSource);
</span><span class="cx">     void notifyChildRemoved(Node&amp; child, Node* previousSibling, Node* nextSibling, ChildChangeSource);
</span><span class="cx"> 
</span><span class="lines">@@ -309,6 +304,8 @@
</span><span class="cx">     ChildNodesLazySnapshot* m_nextSnapshot;
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+LayoutRect rendererAnchorRect(const ContainerNode&amp;);
+
</ins><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="trunkSourceWebCoredomElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Element.cpp (177034 => 177035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Element.cpp        2014-12-09 20:50:16 UTC (rev 177034)
+++ trunk/Source/WebCore/dom/Element.cpp        2014-12-09 21:03:54 UTC (rev 177035)
</span><span class="lines">@@ -572,7 +572,7 @@
</span><span class="cx">     if (!renderer())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    LayoutRect bounds = boundingBox();
</del><ins>+    LayoutRect bounds = renderer()-&gt;anchorRect();
</ins><span class="cx">     // Align to the top / bottom and to the closest edge.
</span><span class="cx">     if (alignToTop)
</span><span class="cx">         renderer()-&gt;scrollRectToVisible(bounds, ScrollAlignment::alignToEdgeIfNeeded, ScrollAlignment::alignTopAlways);
</span><span class="lines">@@ -587,7 +587,7 @@
</span><span class="cx">     if (!renderer())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    LayoutRect bounds = boundingBox();
</del><ins>+    LayoutRect bounds = renderer()-&gt;anchorRect();
</ins><span class="cx">     if (centerIfNeeded)
</span><span class="cx">         renderer()-&gt;scrollRectToVisible(bounds, ScrollAlignment::alignCenterIfNeeded, ScrollAlignment::alignCenterIfNeeded);
</span><span class="cx">     else
</span><span class="lines">@@ -1978,7 +1978,7 @@
</span><span class="cx">             frame-&gt;selection().revealSelection();
</span><span class="cx">         }
</span><span class="cx">     } else if (renderer() &amp;&amp; !renderer()-&gt;isWidget())
</span><del>-        renderer()-&gt;scrollRectToVisible(boundingBox());
</del><ins>+        renderer()-&gt;scrollRectToVisible(renderer()-&gt;anchorRect());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Element::blur()
</span></span></pre></div>
<a id="trunkSourceWebCoredomNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Node.cpp (177034 => 177035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Node.cpp        2014-12-09 20:50:16 UTC (rev 177034)
+++ trunk/Source/WebCore/dom/Node.cpp        2014-12-09 21:03:54 UTC (rev 177035)
</span><span class="lines">@@ -637,13 +637,6 @@
</span><span class="cx">     RenderObject* renderer = this-&gt;renderer();
</span><span class="cx">     return is&lt;RenderBoxModelObject&gt;(renderer) ? downcast&lt;RenderBoxModelObject&gt;(renderer) : nullptr;
</span><span class="cx"> }
</span><del>-
-LayoutRect Node::boundingBox() const
-{
-    if (renderer())
-        return renderer()-&gt;absoluteBoundingBoxRect();
-    return LayoutRect();
-}
</del><span class="cx">     
</span><span class="cx"> LayoutRect Node::renderRect(bool* isReplaced)
</span><span class="cx"> {    
</span><span class="lines">@@ -2266,6 +2259,13 @@
</span><span class="cx">     return inDocument() &amp;&amp; document().hasLivingRenderTree();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+IntRect rendererBoundingBox(const Node&amp; node)
+{
+    if (RenderObject* renderer = node.renderer())
+        return renderer-&gt;absoluteBoundingBoxRect();
+    return IntRect();
+}
+
</ins><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 (177034 => 177035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Node.h        2014-12-09 20:50:16 UTC (rev 177034)
+++ trunk/Source/WebCore/dom/Node.h        2014-12-09 21:03:54 UTC (rev 177035)
</span><span class="lines">@@ -377,8 +377,6 @@
</span><span class="cx">         return false;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    virtual LayoutRect boundingBox() const;
-    IntRect pixelSnappedBoundingBox() const { return snappedIntRect(boundingBox()); }
</del><span class="cx">     WEBCORE_EXPORT LayoutRect renderRect(bool* isReplaced);
</span><span class="cx">     IntRect pixelSnappedRenderRect(bool* isReplaced) { return snappedIntRect(renderRect(isReplaced)); }
</span><span class="cx"> 
</span><span class="lines">@@ -739,6 +737,8 @@
</span><span class="cx">     return parentNode();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+WEBCORE_EXPORT IntRect rendererBoundingBox(const Node&amp;);
+
</ins><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 (177034 => 177035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/ColorInputType.cpp        2014-12-09 20:50:16 UTC (rev 177034)
+++ trunk/Source/WebCore/html/ColorInputType.cpp        2014-12-09 21:03:54 UTC (rev 177035)
</span><span class="lines">@@ -204,7 +204,7 @@
</span><span class="cx"> 
</span><span class="cx"> IntRect ColorInputType::elementRectRelativeToRootView() const
</span><span class="cx"> {
</span><del>-    return element().document().view()-&gt;contentsToRootView(element().pixelSnappedBoundingBox());
</del><ins>+    return element().document().view()-&gt;contentsToRootView(rendererBoundingBox(element()));
</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 (177034 => 177035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLInputElement.cpp        2014-12-09 20:50:16 UTC (rev 177034)
+++ trunk/Source/WebCore/html/HTMLInputElement.cpp        2014-12-09 21:03:54 UTC (rev 177035)
</span><span class="lines">@@ -1877,7 +1877,7 @@
</span><span class="cx">         parameters.stepBase = 0;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    parameters.anchorRectInRootView = document().view()-&gt;contentsToRootView(pixelSnappedBoundingBox());
</del><ins>+    parameters.anchorRectInRootView = document().view()-&gt;contentsToRootView(rendererBoundingBox(*this));
</ins><span class="cx">     parameters.currentValue = value();
</span><span class="cx">     parameters.isAnchorElementRTL = computedStyle()-&gt;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 (177034 => 177035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/ValidationMessage.cpp        2014-12-09 20:50:16 UTC (rev 177034)
+++ trunk/Source/WebCore/html/ValidationMessage.cpp        2014-12-09 21:03:54 UTC (rev 177035)
</span><span class="lines">@@ -178,7 +178,7 @@
</span><span class="cx">     m_bubble-&gt;setInlineStyleProperty(CSSPropertyPosition, CSSValueAbsolute);
</span><span class="cx">     shadowRoot.appendChild(m_bubble.get(), ASSERT_NO_EXCEPTION);
</span><span class="cx">     document.updateLayout();
</span><del>-    adjustBubblePosition(m_element-&gt;boundingBox(), m_bubble.get());
</del><ins>+    adjustBubblePosition(rendererBoundingBox(*m_element), m_bubble.get());
</ins><span class="cx"> 
</span><span class="cx">     RefPtr&lt;HTMLDivElement&gt; clipper = HTMLDivElement::create(document);
</span><span class="cx">     clipper-&gt;setPseudo(AtomicString(&quot;-webkit-validation-bubble-arrow-clipper&quot;, AtomicString::ConstructFromLiteral));
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderFrameLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/FrameLoader.cpp (177034 => 177035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/FrameLoader.cpp        2014-12-09 20:50:16 UTC (rev 177034)
+++ trunk/Source/WebCore/loader/FrameLoader.cpp        2014-12-09 21:03:54 UTC (rev 177035)
</span><span class="lines">@@ -1148,7 +1148,7 @@
</span><span class="cx">         parent-&gt;loader().checkCompleted();
</span><span class="cx"> 
</span><span class="cx">     if (m_frame.view())
</span><del>-        m_frame.view()-&gt;maintainScrollPositionAtAnchor(0);
</del><ins>+        m_frame.view()-&gt;maintainScrollPositionAtAnchor(nullptr);
</ins><span class="cx">     m_activityAssertion = nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepageFrameViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/FrameView.cpp (177034 => 177035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/FrameView.cpp        2014-12-09 20:50:16 UTC (rev 177034)
+++ trunk/Source/WebCore/page/FrameView.cpp        2014-12-09 21:03:54 UTC (rev 177035)
</span><span class="lines">@@ -1984,7 +1984,10 @@
</span><span class="cx">     if (!anchorElement &amp;&amp; !(name.isEmpty() || equalIgnoringCase(name, &quot;top&quot;)))
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    maintainScrollPositionAtAnchor(anchorElement ? static_cast&lt;Node*&gt;(anchorElement) : frame().document());
</del><ins>+    ContainerNode* scrollPositionAnchor = anchorElement;
+    if (!scrollPositionAnchor)
+        scrollPositionAnchor = frame().document();
+    maintainScrollPositionAtAnchor(scrollPositionAnchor);
</ins><span class="cx">     
</span><span class="cx">     // If the anchor accepts keyboard focus, move focus there to aid users relying on keyboard navigation.
</span><span class="cx">     if (anchorElement &amp;&amp; anchorElement-&gt;isFocusable())
</span><span class="lines">@@ -1993,7 +1996,7 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void FrameView::maintainScrollPositionAtAnchor(Node* anchorNode)
</del><ins>+void FrameView::maintainScrollPositionAtAnchor(ContainerNode* anchorNode)
</ins><span class="cx"> {
</span><span class="cx">     m_maintainScrollPositionAnchor = anchorNode;
</span><span class="cx">     if (!m_maintainScrollPositionAnchor)
</span><span class="lines">@@ -2014,7 +2017,7 @@
</span><span class="cx"> {
</span><span class="cx">     frame().document()-&gt;updateLayoutIgnorePendingStylesheets();
</span><span class="cx"> 
</span><del>-    LayoutRect bounds = element-&gt;boundingBox();
</del><ins>+    LayoutRect bounds = rendererAnchorRect(*element);
</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">@@ -2775,7 +2778,7 @@
</span><span class="cx"> 
</span><span class="cx"> void FrameView::scrollToAnchor()
</span><span class="cx"> {
</span><del>-    RefPtr&lt;Node&gt; anchorNode = m_maintainScrollPositionAnchor;
</del><ins>+    RefPtr&lt;ContainerNode&gt; anchorNode = m_maintainScrollPositionAnchor;
</ins><span class="cx">     if (!anchorNode)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="lines">@@ -2784,7 +2787,7 @@
</span><span class="cx"> 
</span><span class="cx">     LayoutRect rect;
</span><span class="cx">     if (anchorNode != frame().document())
</span><del>-        rect = anchorNode-&gt;boundingBox();
</del><ins>+        rect = rendererAnchorRect(*anchorNode.get());
</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="trunkSourceWebCorepageFrameViewh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/FrameView.h (177034 => 177035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/FrameView.h        2014-12-09 20:50:16 UTC (rev 177034)
+++ trunk/Source/WebCore/page/FrameView.h        2014-12-09 21:03:54 UTC (rev 177035)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;AdjustViewSizeOrNot.h&quot;
</span><span class="cx"> #include &quot;Color.h&quot;
</span><ins>+#include &quot;ContainerNode.h&quot;
</ins><span class="cx"> #include &quot;LayoutMilestones.h&quot;
</span><span class="cx"> #include &quot;LayoutRect.h&quot;
</span><span class="cx"> #include &quot;Pagination.h&quot;
</span><span class="lines">@@ -388,7 +389,7 @@
</span><span class="cx"> 
</span><span class="cx">     bool scrollToFragment(const URL&amp;);
</span><span class="cx">     bool scrollToAnchor(const String&amp;);
</span><del>-    void maintainScrollPositionAtAnchor(Node*);
</del><ins>+    void maintainScrollPositionAtAnchor(ContainerNode*);
</ins><span class="cx">     WEBCORE_EXPORT void scrollElementToRect(Element*, const IntRect&amp;);
</span><span class="cx"> 
</span><span class="cx">     // Methods to convert points and rects between the coordinate space of the renderer, and this view.
</span><span class="lines">@@ -715,7 +716,7 @@
</span><span class="cx">     bool m_isVisuallyNonEmpty;
</span><span class="cx">     bool m_firstVisuallyNonEmptyLayoutCallbackPending;
</span><span class="cx"> 
</span><del>-    RefPtr&lt;Node&gt; m_maintainScrollPositionAnchor;
</del><ins>+    RefPtr&lt;ContainerNode&gt; m_maintainScrollPositionAnchor;
</ins><span class="cx"> 
</span><span class="cx">     // Renderer to hold our custom scroll corner.
</span><span class="cx">     RenderPtr&lt;RenderScrollbarPart&gt; m_scrollCorner;
</span></span></pre></div>
<a id="trunkSourceWebCorepageSpatialNavigationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/SpatialNavigation.cpp (177034 => 177035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/SpatialNavigation.cpp        2014-12-09 20:50:16 UTC (rev 177034)
+++ trunk/Source/WebCore/page/SpatialNavigation.cpp        2014-12-09 21:03:54 UTC (rev 177035)
</span><span class="lines">@@ -501,6 +501,7 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+// FIXME: This is completely broken. This should be deleted and callers should be calling ScrollView::contentsToWindow() instead.
</ins><span class="cx"> static LayoutRect rectToAbsoluteCoordinates(Frame* initialFrame, const LayoutRect&amp; initialRect)
</span><span class="cx"> {
</span><span class="cx">     LayoutRect rect = initialRect;
</span><span class="lines">@@ -521,8 +522,9 @@
</span><span class="cx"> 
</span><span class="cx">     if (is&lt;Document&gt;(*node))
</span><span class="cx">         return frameRectInAbsoluteCoordinates(downcast&lt;Document&gt;(*node).frame());
</span><del>-    LayoutRect rect = rectToAbsoluteCoordinates(node-&gt;document().frame(), node-&gt;boundingBox());
</del><span class="cx"> 
</span><ins>+    LayoutRect rect = rectToAbsoluteCoordinates(node-&gt;document().frame(), rendererBoundingBox(*node));
+
</ins><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 class="cx">     if (ignoreBorder) {
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderElement.cpp (177034 => 177035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderElement.cpp        2014-12-09 20:50:16 UTC (rev 177034)
+++ trunk/Source/WebCore/rendering/RenderElement.cpp        2014-12-09 21:03:54 UTC (rev 177035)
</span><span class="lines">@@ -1511,4 +1511,127 @@
</span><span class="cx">     return theme().inactiveSelectionBackgroundColor();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool RenderElement::getLeadingCorner(FloatPoint&amp; point) const
+{
+    if (!isInline() || isReplaced()) {
+        point = localToAbsolute(FloatPoint(), UseTransforms);
+        return true;
+    }
+
+    // find the next text/image child, to get a position
+    const RenderObject* o = this;
+    while (o) {
+        const RenderObject* p = o;
+        if (RenderObject* child = o-&gt;firstChildSlow())
+            o = child;
+        else if (o-&gt;nextSibling())
+            o = o-&gt;nextSibling();
+        else {
+            RenderObject* next = 0;
+            while (!next &amp;&amp; o-&gt;parent()) {
+                o = o-&gt;parent();
+                next = o-&gt;nextSibling();
+            }
+            o = next;
+
+            if (!o)
+                break;
+        }
+        ASSERT(o);
+
+        if (!o-&gt;isInline() || o-&gt;isReplaced()) {
+            point = o-&gt;localToAbsolute(FloatPoint(), UseTransforms);
+            return true;
+        }
+
+        if (p-&gt;node() &amp;&amp; p-&gt;node() == element() &amp;&amp; is&lt;RenderText&gt;(*o) &amp;&amp; !downcast&lt;RenderText&gt;(*o).firstTextBox()) {
+            // do nothing - skip unrendered whitespace that is a child or next sibling of the anchor
+        } else if (is&lt;RenderText&gt;(*o) || o-&gt;isReplaced()) {
+            point = FloatPoint();
+            if (is&lt;RenderText&gt;(*o) &amp;&amp; downcast&lt;RenderText&gt;(*o).firstTextBox())
+                point.move(downcast&lt;RenderText&gt;(*o).linesBoundingBox().x(), downcast&lt;RenderText&gt;(*o).topOfFirstText());
+            else if (is&lt;RenderBox&gt;(*o))
+                point.moveBy(downcast&lt;RenderBox&gt;(*o).location());
+            point = o-&gt;container()-&gt;localToAbsolute(point, UseTransforms);
+            return true;
+        }
+    }
+    
+    // If the target doesn't have any children or siblings that could be used to calculate the scroll position, we must be
+    // at the end of the document. Scroll to the bottom. FIXME: who said anything about scrolling?
+    if (!o &amp;&amp; document().view()) {
+        point = FloatPoint(0, document().view()-&gt;contentsHeight());
+        return true;
+    }
+    return false;
</ins><span class="cx"> }
</span><ins>+
+bool RenderElement::getTrailingCorner(FloatPoint&amp; point) const
+{
+    if (!isInline() || isReplaced()) {
+        point = localToAbsolute(LayoutPoint(downcast&lt;RenderBox&gt;(*this).size()), UseTransforms);
+        return true;
+    }
+
+    // find the last text/image child, to get a position
+    const RenderObject* o = this;
+    while (o) {
+        if (RenderObject* child = o-&gt;lastChildSlow())
+            o = child;
+        else if (o-&gt;previousSibling())
+            o = o-&gt;previousSibling();
+        else {
+            RenderObject* prev = 0;
+            while (!prev) {
+                o = o-&gt;parent();
+                if (!o)
+                    return false;
+                prev = o-&gt;previousSibling();
+            }
+            o = prev;
+        }
+        ASSERT(o);
+        if (is&lt;RenderText&gt;(*o) || o-&gt;isReplaced()) {
+            point = FloatPoint();
+            if (is&lt;RenderText&gt;(*o)) {
+                IntRect linesBox = downcast&lt;RenderText&gt;(*o).linesBoundingBox();
+                if (!linesBox.maxX() &amp;&amp; !linesBox.maxY())
+                    continue;
+                point.moveBy(linesBox.maxXMaxYCorner());
+            } else
+                point.moveBy(downcast&lt;RenderBox&gt;(*o).frameRect().maxXMaxYCorner());
+            point = o-&gt;container()-&gt;localToAbsolute(point, UseTransforms);
+            return true;
+        }
+    }
+    return true;
+}
+
+LayoutRect RenderElement::anchorRect() const
+{
+    FloatPoint leading, trailing;
+    bool foundLeading = getLeadingCorner(leading);
+    bool foundTrailing = getTrailingCorner(trailing);
+    
+    // If we've found one corner, but not the other,
+    // then we should just return a point at the corner that we did find.
+    if (foundLeading != foundTrailing) {
+        if (foundLeading)
+            foundTrailing = foundLeading;
+        else
+            foundLeading = foundTrailing;
+    }
+
+    FloatPoint upperLeft = leading;
+    FloatPoint lowerRight = trailing;
+
+    // Vertical writing modes might mean the leading point is not in the top left
+    if (!isInline() || isReplaced()) {
+        upperLeft = FloatPoint(std::min(leading.x(), trailing.x()), std::min(leading.y(), trailing.y()));
+        lowerRight = FloatPoint(std::max(leading.x(), trailing.x()), std::max(leading.y(), trailing.y()));
+    } // Otherwise, it's not obvious what to do.
+
+    return enclosingLayoutRect(FloatRect(upperLeft, lowerRight.expandedTo(upperLeft) - upperLeft));
+}
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderElement.h (177034 => 177035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderElement.h        2014-12-09 20:50:16 UTC (rev 177034)
+++ trunk/Source/WebCore/rendering/RenderElement.h        2014-12-09 21:03:54 UTC (rev 177035)
</span><span class="lines">@@ -150,6 +150,10 @@
</span><span class="cx">     bool hasClipPath() const { return style().clipPath(); }
</span><span class="cx">     bool hasHiddenBackface() const { return style().backfaceVisibility() == BackfaceVisibilityHidden; }
</span><span class="cx"> 
</span><ins>+    // anchorRect() is conceptually similar to absoluteBoundingBoxRect(), but is intended for scrolling to an anchor.
+    // It works differently than absoluteBoundingBoxRect() for inline renderers.
+    LayoutRect anchorRect() const;
+
</ins><span class="cx">     bool hasFilter() const { return style().hasFilter(); }
</span><span class="cx">     bool hasBackdropFilter() const
</span><span class="cx">     {
</span><span class="lines">@@ -261,6 +265,9 @@
</span><span class="cx"> 
</span><span class="cx">     virtual void newImageAnimationFrameAvailable(CachedImage&amp;) final override;
</span><span class="cx"> 
</span><ins>+    bool getLeadingCorner(FloatPoint&amp; output) const;
+    bool getTrailingCorner(FloatPoint&amp; output) const;
+
</ins><span class="cx">     unsigned m_baseTypeFlags : 6;
</span><span class="cx">     unsigned m_ancestorLineBoxDirty : 1;
</span><span class="cx">     unsigned m_hasInitializedStyle : 1;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderTextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderText.cpp (177034 => 177035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderText.cpp        2014-12-09 20:50:16 UTC (rev 177034)
+++ trunk/Source/WebCore/rendering/RenderText.cpp        2014-12-09 21:03:54 UTC (rev 177035)
</span><span class="lines">@@ -1006,6 +1006,11 @@
</span><span class="cx">     return prev;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+LayoutUnit RenderText::topOfFirstText() const
+{
+    return firstTextBox()-&gt;root().lineTop();
+}
+
</ins><span class="cx"> void applyTextTransform(const RenderStyle&amp; style, String&amp; text, UChar previousCharacter)
</span><span class="cx"> {
</span><span class="cx">     switch (style.textTransform()) {
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderTexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderText.h (177034 => 177035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderText.h        2014-12-09 20:50:16 UTC (rev 177034)
+++ trunk/Source/WebCore/rendering/RenderText.h        2014-12-09 21:03:54 UTC (rev 177035)
</span><span class="lines">@@ -164,6 +164,8 @@
</span><span class="cx"> 
</span><span class="cx">     StringView stringView(int start = 0, int stop = -1) const;
</span><span class="cx"> 
</span><ins>+    LayoutUnit topOfFirstText() const;
+
</ins><span class="cx"> protected:
</span><span class="cx">     virtual void computePreferredLogicalWidths(float leadWidth);
</span><span class="cx">     virtual void willBeDestroyed() override;
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (177034 => 177035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2014-12-09 20:50:16 UTC (rev 177034)
+++ trunk/Source/WebKit/mac/ChangeLog        2014-12-09 21:03:54 UTC (rev 177035)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2014-12-09  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
+
+        Delete Node::boundingBox()
+        https://bugs.webkit.org/show_bug.cgi?id=139333
+
+        Reviewed by Zalan Bujtas.
+
+        * WebView/WebActionMenuController.mm:
+        (elementBoundingBoxInWindowCoordinatesFromNode): Use
+        RenderObject::absoluteBoundingBoxRect().
+
</ins><span class="cx"> 2014-12-08  Alexey Proskuryakov  &lt;ap@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         REGRESSION (r158036): WebView cannot handle HTTP Basic Authentication challenge
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebActionMenuControllermm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebActionMenuController.mm (177034 => 177035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebActionMenuController.mm        2014-12-09 20:50:16 UTC (rev 177034)
+++ trunk/Source/WebKit/mac/WebView/WebActionMenuController.mm        2014-12-09 21:03:54 UTC (rev 177035)
</span><span class="lines">@@ -262,7 +262,7 @@
</span><span class="cx">     if (!view)
</span><span class="cx">         return IntRect();
</span><span class="cx"> 
</span><del>-    return view-&gt;contentsToWindow(node-&gt;pixelSnappedBoundingBox());
</del><ins>+    return view-&gt;contentsToWindow(rendererBoundingBox(*node));
</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 (177034 => 177035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-12-09 20:50:16 UTC (rev 177034)
+++ trunk/Source/WebKit2/ChangeLog        2014-12-09 21:03:54 UTC (rev 177035)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2014-12-09  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
+
+        Delete Node::boundingBox()
+        https://bugs.webkit.org/show_bug.cgi?id=139333
+
+        Reviewed by Zalan Bujtas.
+
+        * Shared/WebHitTestResult.cpp:
+        (WebKit::WebHitTestResult::Data::elementBoundingBoxInWindowCoordinates):
+        Use RenderObject::absoluteBoundingBoxRect().
+        * WebProcess/WebPage/CoordinatedGraphics/WebPageCoordinatedGraphics.cpp:
+        (WebKit::WebPage::findZoomableAreaForPoint): Use
+        RenderObject::absoluteBoundingBoxRect().
+
</ins><span class="cx"> 2014-12-09  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [WK2] Crash when answering notification permission request after navigating
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedWebHitTestResultcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/WebHitTestResult.cpp (177034 => 177035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebHitTestResult.cpp        2014-12-09 20:50:16 UTC (rev 177034)
+++ trunk/Source/WebKit2/Shared/WebHitTestResult.cpp        2014-12-09 21:03:54 UTC (rev 177035)
</span><span class="lines">@@ -25,6 +25,7 @@
</span><span class="cx"> #include &lt;WebCore/Frame.h&gt;
</span><span class="cx"> #include &lt;WebCore/FrameView.h&gt;
</span><span class="cx"> #include &lt;WebCore/HitTestResult.h&gt;
</span><ins>+#include &lt;WebCore/RenderObject.h&gt;
</ins><span class="cx"> #include &lt;WebCore/URL.h&gt;
</span><span class="cx"> #include &lt;WebCore/Node.h&gt;
</span><span class="cx"> #include &lt;wtf/text/WTFString.h&gt;
</span><span class="lines">@@ -117,7 +118,7 @@
</span><span class="cx">     if (!view)
</span><span class="cx">         return IntRect();
</span><span class="cx"> 
</span><del>-    return view-&gt;contentsToWindow(node-&gt;pixelSnappedBoundingBox());
</del><ins>+    return view-&gt;contentsToWindow(rendererBoundingBox(*node));
</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 (177034 => 177035)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/WebPageCoordinatedGraphics.cpp        2014-12-09 20:50:16 UTC (rev 177034)
+++ trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/WebPageCoordinatedGraphics.cpp        2014-12-09 21:03:54 UTC (rev 177035)
</span><span class="lines">@@ -37,6 +37,7 @@
</span><span class="cx"> #include &lt;WebCore/EventHandler.h&gt;
</span><span class="cx"> #include &lt;WebCore/Frame.h&gt;
</span><span class="cx"> #include &lt;WebCore/FrameView.h&gt;
</span><ins>+#include &lt;WebCore/RenderObject.h&gt;
</ins><span class="cx"> #include &lt;WebCore/ScrollView.h&gt;
</span><span class="cx"> 
</span><span class="cx"> using namespace WebCore;
</span><span class="lines">@@ -54,7 +55,7 @@
</span><span class="cx">     if (!node)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    IntRect zoomableArea = node-&gt;pixelSnappedBoundingBox();
</del><ins>+    IntRect zoomableArea = rendererBoundingBox(*node);
</ins><span class="cx"> 
</span><span class="cx">     while (true) {
</span><span class="cx">         bool found = !node-&gt;isTextNode() &amp;&amp; !node-&gt;isShadowRoot();
</span><span class="lines">@@ -70,7 +71,7 @@
</span><span class="cx">             break;
</span><span class="cx"> 
</span><span class="cx">         node = node-&gt;parentNode();
</span><del>-        zoomableArea.unite(node-&gt;pixelSnappedBoundingBox());
</del><ins>+        zoomableArea.unite(rendererBoundingBox(*node));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (node-&gt;document().frame() &amp;&amp; node-&gt;document().frame()-&gt;view()) {
</span></span></pre>
</div>
</div>

</body>
</html>