<!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>[171891] 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/171891">171891</a></dd>
<dt>Author</dt> <dd>bdakin@apple.com</dd>
<dt>Date</dt> <dd>2014-07-31 15:32:40 -0700 (Thu, 31 Jul 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Hit-testing broken in WebKit 1 views with AppKit's contentInsets
https://bugs.webkit.org/show_bug.cgi?id=135434
-and corresponding-
&lt;rdar://problem/17850323&gt;

Reviewed by Benjamin Poulain.


Source/WebCore: 
AppKit's contentInsets are factored into scroll positions and mouse positions, but
in WebCore, we generally want all of those things to be factored out so that, for
example, the scroll position of a document pinned to the top is the same whether
or not there is a contentInset. So to fix hit-testing in WebKit 1 views with
contentInsets, this patch factors the inset out or into of all coordinate
conversion methods just like we do for the WebKit2 contentInset.
        
This patch also adds the ability to test WK1 platformContentInsets with
window.internals, and it re-names convertFromRenderer to 
convertFromRendererToContainingView and also re-names convertToRenderer to
convertFromContainingViewToRenderer.

ScrollView::topContentInset() takes an optional parameter indicating whether the
caller wants the WebCore::Page contentInset or the platform content inset. It’s
necessary to distinguish between these cases because there is a lot of code that
only wants the WebCore::Page contentInset since that feature is actually
implemented in WebCore as opposed to being implemented at the platform level.
* WebCore.exp.in:
* page/FrameView.cpp:
(WebCore::FrameView::topContentInset):

For layout test purposes, set the platforTopContentInset here if there is a 
platformWidget().
(WebCore::FrameView::topContentInsetDidChange):

Re-named functions, also all coordinate conversion functions call 
topContentInset(ManualOrPlatformContentInset)
(WebCore::FrameView::convertFromContainingViewToRenderer):
(WebCore::FrameView::convertToContainingView):
(WebCore::FrameView::convertFromContainingView):
(WebCore::FrameView::convertFromRenderer): Deleted.
(WebCore::FrameView::convertToRenderer): Deleted.
* page/FrameView.h:
* page/Page.cpp:
(WebCore::Page::setTopContentInset):
* platform/ScrollView.cpp:
(WebCore::ScrollView::documentScrollOffsetRelativeToViewOrigin):
(WebCore::ScrollView::documentScrollPositionRelativeToViewOrigin):
(WebCore::ScrollView::contentsToRootView):
(WebCore::ScrollView::rootViewToTotalContents):
(WebCore::ScrollView::contentsToWindow):
(WebCore::ScrollView::platformTopContentInset):
(WebCore::ScrollView::platformSetTopContentInset):
* platform/ScrollView.h:
(WebCore::ScrollView::topContentInset):
* platform/ios/ScrollViewIOS.mm:
(WebCore::ScrollView::platformTopContentInset):
(WebCore::ScrollView::platformSetTopContentInset):

Implement new platform inset-related functions using AppKit's implementation.
* platform/mac/ScrollViewMac.mm:
(WebCore::ScrollView::platformTopContentInset):
(WebCore::ScrollView::platformSetTopContentInset):
        
When we set the scroll position for the documentView, we have to factor the inset
back into the WebCore scroll position.
(WebCore::ScrollView::platformSetScrollPosition):
        
Re-named functions.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::convertFromScrollbarToContainingView):
(WebCore::RenderLayer::convertFromContainingViewToScrollbar):
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::convertFromScrollbarToContainingView):
(WebCore::RenderListBox::convertFromContainingViewToScrollbar):

Source/WebKit2: 
Re-named functions.
* WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::convertFromScrollbarToContainingView):
(WebKit::PDFPlugin::convertFromContainingViewToScrollbar):

LayoutTests: 
These hit-testing related contentInset tests will now work for mac on wk1 on 
Yosemite and wk2.

* platform/mac-wk1/TestExpectations:
* platform/mac-wk2/tiled-drawing/content-inset-hit-testing-expected.txt: Removed.
* platform/mac-wk2/tiled-drawing/content-inset-hit-testing-in-frame-expected.txt: Removed.
* platform/mac-wk2/tiled-drawing/content-inset-hit-testing-in-frame.html: Removed.
* platform/mac-wk2/tiled-drawing/content-inset-hit-testing.html: Removed.
* platform/mac-wk2/tiled-drawing/resources/iframe-to-hit-test.html: Removed.
* platform/mac/fast/events/content-inset-hit-testing-expected.txt: Copied from platform/mac-wk2/tiled-drawing/content-inset-hit-testing-expected.txt.
* platform/mac/fast/events/content-inset-hit-testing-in-frame-expected.txt: Copied from platform/mac-wk2/tiled-drawing/content-inset-hit-testing-in-frame-expected.txt.
* platform/mac/fast/events/content-inset-hit-testing-in-frame.html: Copied from platform/mac-wk2/tiled-drawing/content-inset-hit-testing-in-frame.html.
* platform/mac/fast/events/content-inset-hit-testing.html: Copied from platform/mac-wk2/tiled-drawing/content-inset-hit-testing.html.
* platform/mac/fast/events/resources: Added.
* platform/mac/fast/events/resources/iframe-to-hit-test.html: Copied from platform/mac-wk2/tiled-drawing/resources/iframe-to-hit-test.html.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformmacwk1TestExpectations">trunk/LayoutTests/platform/mac-wk1/TestExpectations</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="#trunkSourceWebCorepageFrameViewcpp">trunk/Source/WebCore/page/FrameView.cpp</a></li>
<li><a href="#trunkSourceWebCorepageFrameViewh">trunk/Source/WebCore/page/FrameView.h</a></li>
<li><a href="#trunkSourceWebCorepagePagecpp">trunk/Source/WebCore/page/Page.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformScrollViewcpp">trunk/Source/WebCore/platform/ScrollView.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformScrollViewh">trunk/Source/WebCore/platform/ScrollView.h</a></li>
<li><a href="#trunkSourceWebCoreplatformiosScrollViewIOSmm">trunk/Source/WebCore/platform/ios/ScrollViewIOS.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformmacScrollViewMacmm">trunk/Source/WebCore/platform/mac/ScrollViewMac.mm</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayercpp">trunk/Source/WebCore/rendering/RenderLayer.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderListBoxcpp">trunk/Source/WebCore/rendering/RenderListBox.cpp</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2WebProcessPluginsPDFPDFPluginmm">trunk/Source/WebKit2/WebProcess/Plugins/PDF/PDFPlugin.mm</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsplatformmacfasteventscontentinsethittestingexpectedtxt">trunk/LayoutTests/platform/mac/fast/events/content-inset-hit-testing-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmacfasteventscontentinsethittestinginframeexpectedtxt">trunk/LayoutTests/platform/mac/fast/events/content-inset-hit-testing-in-frame-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmacfasteventscontentinsethittestinginframehtml">trunk/LayoutTests/platform/mac/fast/events/content-inset-hit-testing-in-frame.html</a></li>
<li><a href="#trunkLayoutTestsplatformmacfasteventscontentinsethittestinghtml">trunk/LayoutTests/platform/mac/fast/events/content-inset-hit-testing.html</a></li>
<li>trunk/LayoutTests/platform/mac/fast/events/resources/</li>
<li><a href="#trunkLayoutTestsplatformmacfasteventsresourcesiframetohittesthtml">trunk/LayoutTests/platform/mac/fast/events/resources/iframe-to-hit-test.html</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsplatformmacwk2tileddrawingcontentinsethittestingexpectedtxt">trunk/LayoutTests/platform/mac-wk2/tiled-drawing/content-inset-hit-testing-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmacwk2tileddrawingcontentinsethittestinginframeexpectedtxt">trunk/LayoutTests/platform/mac-wk2/tiled-drawing/content-inset-hit-testing-in-frame-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmacwk2tileddrawingcontentinsethittestinginframehtml">trunk/LayoutTests/platform/mac-wk2/tiled-drawing/content-inset-hit-testing-in-frame.html</a></li>
<li><a href="#trunkLayoutTestsplatformmacwk2tileddrawingcontentinsethittestinghtml">trunk/LayoutTests/platform/mac-wk2/tiled-drawing/content-inset-hit-testing.html</a></li>
<li><a href="#trunkLayoutTestsplatformmacwk2tileddrawingresourcesiframetohittesthtml">trunk/LayoutTests/platform/mac-wk2/tiled-drawing/resources/iframe-to-hit-test.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (171890 => 171891)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-07-31 22:07:46 UTC (rev 171890)
+++ trunk/LayoutTests/ChangeLog        2014-07-31 22:32:40 UTC (rev 171891)
</span><span class="lines">@@ -1,3 +1,28 @@
</span><ins>+2014-07-31  Beth Dakin  &lt;bdakin@apple.com&gt;
+
+        Hit-testing broken in WebKit 1 views with AppKit's contentInsets
+        https://bugs.webkit.org/show_bug.cgi?id=135434
+        -and corresponding-
+        &lt;rdar://problem/17850323&gt;
+
+        Reviewed by Benjamin Poulain.
+
+        These hit-testing related contentInset tests will now work for mac on wk1 on 
+        Yosemite and wk2.
+
+        * platform/mac-wk1/TestExpectations:
+        * platform/mac-wk2/tiled-drawing/content-inset-hit-testing-expected.txt: Removed.
+        * platform/mac-wk2/tiled-drawing/content-inset-hit-testing-in-frame-expected.txt: Removed.
+        * platform/mac-wk2/tiled-drawing/content-inset-hit-testing-in-frame.html: Removed.
+        * platform/mac-wk2/tiled-drawing/content-inset-hit-testing.html: Removed.
+        * platform/mac-wk2/tiled-drawing/resources/iframe-to-hit-test.html: Removed.
+        * platform/mac/fast/events/content-inset-hit-testing-expected.txt: Copied from platform/mac-wk2/tiled-drawing/content-inset-hit-testing-expected.txt.
+        * platform/mac/fast/events/content-inset-hit-testing-in-frame-expected.txt: Copied from platform/mac-wk2/tiled-drawing/content-inset-hit-testing-in-frame-expected.txt.
+        * platform/mac/fast/events/content-inset-hit-testing-in-frame.html: Copied from platform/mac-wk2/tiled-drawing/content-inset-hit-testing-in-frame.html.
+        * platform/mac/fast/events/content-inset-hit-testing.html: Copied from platform/mac-wk2/tiled-drawing/content-inset-hit-testing.html.
+        * platform/mac/fast/events/resources: Added.
+        * platform/mac/fast/events/resources/iframe-to-hit-test.html: Copied from platform/mac-wk2/tiled-drawing/resources/iframe-to-hit-test.html.
+
</ins><span class="cx"> 2014-07-31  Bear Travis  &lt;betravis@adobe.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [CSS Font Loading] Rename document.fontloader to document.fonts
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacfasteventscontentinsethittestingexpectedtxtfromrev171873trunkLayoutTestsplatformmacwk2tileddrawingcontentinsethittestingexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/platform/mac/fast/events/content-inset-hit-testing-expected.txt (from rev 171873, trunk/LayoutTests/platform/mac-wk2/tiled-drawing/content-inset-hit-testing-expected.txt) (0 => 171891)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/fast/events/content-inset-hit-testing-expected.txt                                (rev 0)
+++ trunk/LayoutTests/platform/mac/fast/events/content-inset-hit-testing-expected.txt        2014-07-31 22:32:40 UTC (rev 171891)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+Pass!
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformmacfasteventscontentinsethittestinginframeexpectedtxtfromrev171873trunkLayoutTestsplatformmacwk2tileddrawingcontentinsethittestinginframeexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/platform/mac/fast/events/content-inset-hit-testing-in-frame-expected.txt (from rev 171873, trunk/LayoutTests/platform/mac-wk2/tiled-drawing/content-inset-hit-testing-in-frame-expected.txt) (0 => 171891)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/fast/events/content-inset-hit-testing-in-frame-expected.txt                                (rev 0)
+++ trunk/LayoutTests/platform/mac/fast/events/content-inset-hit-testing-in-frame-expected.txt        2014-07-31 22:32:40 UTC (rev 171891)
</span><span class="lines">@@ -0,0 +1,2 @@
</span><ins>+
+Pass!
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformmacfasteventscontentinsethittestinginframehtmlfromrev171873trunkLayoutTestsplatformmacwk2tileddrawingcontentinsethittestinginframehtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/platform/mac/fast/events/content-inset-hit-testing-in-frame.html (from rev 171873, trunk/LayoutTests/platform/mac-wk2/tiled-drawing/content-inset-hit-testing-in-frame.html) (0 => 171891)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/fast/events/content-inset-hit-testing-in-frame.html                                (rev 0)
+++ trunk/LayoutTests/platform/mac/fast/events/content-inset-hit-testing-in-frame.html        2014-07-31 22:32:40 UTC (rev 171891)
</span><span class="lines">@@ -0,0 +1,22 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;script&gt;
+    function runTest() {
+        if (!window.eventSender)
+            return;
+        if (window.internals)
+            window.internals.setTopContentInset(100);
+        if (window.testRunner)
+            testRunner.dumpAsText();
+
+        eventSender.mouseMoveTo(20, 120);
+        eventSender.mouseDown();
+        eventSender.mouseUp();
+    }
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;runTest()&quot;&gt;
+    &lt;iframe src=&quot;resources/iframe-to-hit-test.html&quot; scrolling=&quot;no&quot; frameborder=&quot;no&quot; height=&quot;300&quot; width=&quot;600&quot;&gt;&lt;/iframe&gt;
+    &lt;div id=&quot;result&quot;&gt;This test needs to be run through WebKitTestRunner.&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformmacfasteventscontentinsethittestinghtmlfromrev171873trunkLayoutTestsplatformmacwk2tileddrawingcontentinsethittestinghtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/platform/mac/fast/events/content-inset-hit-testing.html (from rev 171873, trunk/LayoutTests/platform/mac-wk2/tiled-drawing/content-inset-hit-testing.html) (0 => 171891)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/fast/events/content-inset-hit-testing.html                                (rev 0)
+++ trunk/LayoutTests/platform/mac/fast/events/content-inset-hit-testing.html        2014-07-31 22:32:40 UTC (rev 171891)
</span><span class="lines">@@ -0,0 +1,41 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;style&gt;
+    #target {
+        background-color:purple;
+        width:25px;
+        height:25px;
+    }
+&lt;/style&gt;
+&lt;script&gt;
+    var numberOfClicks = 0;
+
+    function runTest() {
+        if (!window.eventSender)
+            return;
+        if (window.internals)
+            window.internals.setTopContentInset(100);
+        if (window.testRunner)
+            testRunner.dumpAsText();
+
+        eventSender.mouseMoveTo(15, 115);
+        eventSender.mouseDown();
+        eventSender.mouseUp();
+
+        var result = document.getElementById(&quot;result&quot;);
+        if (numberOfClicks &gt; 0)
+            result.innerHTML = &quot;Pass!&quot;;
+        else
+            result.innerHTML = &quot;Fail.&quot;;
+    }
+    
+    function clicked() {
+        numberOfClicks = 1;
+    }
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;runTest()&quot;&gt;
+    &lt;div id=&quot;target&quot; onclick=&quot;clicked()&quot;&gt;&lt;/div&gt;
+    &lt;div id=&quot;result&quot;&gt;This test needs to be run through WebKitTestRunner.&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformmacfasteventsresourcesiframetohittesthtmlfromrev171873trunkLayoutTestsplatformmacwk2tileddrawingresourcesiframetohittesthtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/platform/mac/fast/events/resources/iframe-to-hit-test.html (from rev 171873, trunk/LayoutTests/platform/mac-wk2/tiled-drawing/resources/iframe-to-hit-test.html) (0 => 171891)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/fast/events/resources/iframe-to-hit-test.html                                (rev 0)
+++ trunk/LayoutTests/platform/mac/fast/events/resources/iframe-to-hit-test.html        2014-07-31 22:32:40 UTC (rev 171891)
</span><span class="lines">@@ -0,0 +1,20 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;style&gt;
+    #target {
+        background-color:purple;
+        width:25px;
+        height:25px;
+    }
+&lt;/style&gt;
+&lt;script&gt;
+    function clicked() {
+        var result = parent.document.getElementById(&quot;result&quot;);
+        result.innerHTML = &quot;Pass!&quot;;
+    }
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;div id=&quot;target&quot; onclick=&quot;clicked()&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformmacwk1TestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac-wk1/TestExpectations (171890 => 171891)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac-wk1/TestExpectations        2014-07-31 22:07:46 UTC (rev 171890)
+++ trunk/LayoutTests/platform/mac-wk1/TestExpectations        2014-07-31 22:32:40 UTC (rev 171891)
</span><span class="lines">@@ -47,5 +47,9 @@
</span><span class="cx"> # Disable snapshotting tests on WK1 only
</span><span class="cx"> plugins/snapshotting
</span><span class="cx"> 
</span><ins>+# Mavericks and prior do not support contentInset
+[ MountainLion Mavericks ] platform/mac/fast/events/content-inset-hit-testing.html [ Skip ]
+[ MountainLion Mavericks ] platform/mac/fast/events/content-inset-hit-testing-in-frame.html [ Skip ]
+
</ins><span class="cx"> ### END OF (2) Failures without bug reports
</span><span class="cx"> ########################################
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacwk2tileddrawingcontentinsethittestingexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/platform/mac-wk2/tiled-drawing/content-inset-hit-testing-expected.txt (171890 => 171891)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac-wk2/tiled-drawing/content-inset-hit-testing-expected.txt        2014-07-31 22:07:46 UTC (rev 171890)
+++ trunk/LayoutTests/platform/mac-wk2/tiled-drawing/content-inset-hit-testing-expected.txt        2014-07-31 22:32:40 UTC (rev 171891)
</span><span class="lines">@@ -1 +0,0 @@
</span><del>-Pass!
</del></span></pre></div>
<a id="trunkLayoutTestsplatformmacwk2tileddrawingcontentinsethittestinginframeexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/platform/mac-wk2/tiled-drawing/content-inset-hit-testing-in-frame-expected.txt (171890 => 171891)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac-wk2/tiled-drawing/content-inset-hit-testing-in-frame-expected.txt        2014-07-31 22:07:46 UTC (rev 171890)
+++ trunk/LayoutTests/platform/mac-wk2/tiled-drawing/content-inset-hit-testing-in-frame-expected.txt        2014-07-31 22:32:40 UTC (rev 171891)
</span><span class="lines">@@ -1,2 +0,0 @@
</span><del>-
-Pass!
</del></span></pre></div>
<a id="trunkLayoutTestsplatformmacwk2tileddrawingcontentinsethittestinginframehtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/platform/mac-wk2/tiled-drawing/content-inset-hit-testing-in-frame.html (171890 => 171891)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac-wk2/tiled-drawing/content-inset-hit-testing-in-frame.html        2014-07-31 22:07:46 UTC (rev 171890)
+++ trunk/LayoutTests/platform/mac-wk2/tiled-drawing/content-inset-hit-testing-in-frame.html        2014-07-31 22:32:40 UTC (rev 171891)
</span><span class="lines">@@ -1,22 +0,0 @@
</span><del>-&lt;html&gt;
-&lt;head&gt;
-&lt;script&gt;
-    function runTest() {
-        if (!window.eventSender)
-            return;
-        if (window.internals)
-            window.internals.setTopContentInset(100);
-        if (window.testRunner)
-            testRunner.dumpAsText();
-
-        eventSender.mouseMoveTo(20, 120);
-        eventSender.mouseDown();
-        eventSender.mouseUp();
-    }
-&lt;/script&gt;
-&lt;/head&gt;
-&lt;body onload=&quot;runTest()&quot;&gt;
-    &lt;iframe src=&quot;resources/iframe-to-hit-test.html&quot; scrolling=&quot;no&quot; frameborder=&quot;no&quot; height=&quot;300&quot; width=&quot;600&quot;&gt;&lt;/iframe&gt;
-    &lt;div id=&quot;result&quot;&gt;This test needs to be run through WebKitTestRunner.&lt;/div&gt;
-&lt;/body&gt;
-&lt;/html&gt;
</del></span></pre></div>
<a id="trunkLayoutTestsplatformmacwk2tileddrawingcontentinsethittestinghtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/platform/mac-wk2/tiled-drawing/content-inset-hit-testing.html (171890 => 171891)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac-wk2/tiled-drawing/content-inset-hit-testing.html        2014-07-31 22:07:46 UTC (rev 171890)
+++ trunk/LayoutTests/platform/mac-wk2/tiled-drawing/content-inset-hit-testing.html        2014-07-31 22:32:40 UTC (rev 171891)
</span><span class="lines">@@ -1,41 +0,0 @@
</span><del>-&lt;html&gt;
-&lt;head&gt;
-&lt;style&gt;
-    #target {
-        background-color:purple;
-        width:25px;
-        height:25px;
-    }
-&lt;/style&gt;
-&lt;script&gt;
-    var numberOfClicks = 0;
-
-    function runTest() {
-        if (!window.eventSender)
-            return;
-        if (window.internals)
-            window.internals.setTopContentInset(100);
-        if (window.testRunner)
-            testRunner.dumpAsText();
-
-        eventSender.mouseMoveTo(15, 115);
-        eventSender.mouseDown();
-        eventSender.mouseUp();
-
-        var result = document.getElementById(&quot;result&quot;);
-        if (numberOfClicks &gt; 0)
-            result.innerHTML = &quot;Pass!&quot;;
-        else
-            result.innerHTML = &quot;Fail.&quot;;
-    }
-    
-    function clicked() {
-        numberOfClicks = 1;
-    }
-&lt;/script&gt;
-&lt;/head&gt;
-&lt;body onload=&quot;runTest()&quot;&gt;
-    &lt;div id=&quot;target&quot; onclick=&quot;clicked()&quot;&gt;&lt;/div&gt;
-    &lt;div id=&quot;result&quot;&gt;This test needs to be run through WebKitTestRunner.&lt;/div&gt;
-&lt;/body&gt;
-&lt;/html&gt;
</del></span></pre></div>
<a id="trunkLayoutTestsplatformmacwk2tileddrawingresourcesiframetohittesthtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/platform/mac-wk2/tiled-drawing/resources/iframe-to-hit-test.html (171890 => 171891)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac-wk2/tiled-drawing/resources/iframe-to-hit-test.html        2014-07-31 22:07:46 UTC (rev 171890)
+++ trunk/LayoutTests/platform/mac-wk2/tiled-drawing/resources/iframe-to-hit-test.html        2014-07-31 22:32:40 UTC (rev 171891)
</span><span class="lines">@@ -1,20 +0,0 @@
</span><del>-&lt;html&gt;
-&lt;head&gt;
-&lt;style&gt;
-    #target {
-        background-color:purple;
-        width:25px;
-        height:25px;
-    }
-&lt;/style&gt;
-&lt;script&gt;
-    function clicked() {
-        var result = parent.document.getElementById(&quot;result&quot;);
-        result.innerHTML = &quot;Pass!&quot;;
-    }
-&lt;/script&gt;
-&lt;/head&gt;
-&lt;body&gt;
-    &lt;div id=&quot;target&quot; onclick=&quot;clicked()&quot;&gt;&lt;/div&gt;
-&lt;/body&gt;
-&lt;/html&gt;
</del></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (171890 => 171891)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-07-31 22:07:46 UTC (rev 171890)
+++ trunk/Source/WebCore/ChangeLog        2014-07-31 22:32:40 UTC (rev 171891)
</span><span class="lines">@@ -1,3 +1,78 @@
</span><ins>+2014-07-31  Beth Dakin  &lt;bdakin@apple.com&gt;
+
+        Hit-testing broken in WebKit 1 views with AppKit's contentInsets
+        https://bugs.webkit.org/show_bug.cgi?id=135434
+        -and corresponding-
+        &lt;rdar://problem/17850323&gt;
+
+        Reviewed by Benjamin Poulain.
+
+        AppKit's contentInsets are factored into scroll positions and mouse positions, but
+        in WebCore, we generally want all of those things to be factored out so that, for
+        example, the scroll position of a document pinned to the top is the same whether
+        or not there is a contentInset. So to fix hit-testing in WebKit 1 views with
+        contentInsets, this patch factors the inset out or into of all coordinate
+        conversion methods just like we do for the WebKit2 contentInset.
+        
+        This patch also adds the ability to test WK1 platformContentInsets with
+        window.internals, and it re-names convertFromRenderer to 
+        convertFromRendererToContainingView and also re-names convertToRenderer to
+        convertFromContainingViewToRenderer.
+
+        ScrollView::topContentInset() takes an optional parameter indicating whether the
+        caller wants the WebCore::Page contentInset or the platform content inset. It’s
+        necessary to distinguish between these cases because there is a lot of code that
+        only wants the WebCore::Page contentInset since that feature is actually
+        implemented in WebCore as opposed to being implemented at the platform level.
+        * WebCore.exp.in:
+        * page/FrameView.cpp:
+        (WebCore::FrameView::topContentInset):
+
+        For layout test purposes, set the platforTopContentInset here if there is a 
+        platformWidget().
+        (WebCore::FrameView::topContentInsetDidChange):
+
+        Re-named functions, also all coordinate conversion functions call 
+        topContentInset(ManualOrPlatformContentInset)
+        (WebCore::FrameView::convertFromContainingViewToRenderer):
+        (WebCore::FrameView::convertToContainingView):
+        (WebCore::FrameView::convertFromContainingView):
+        (WebCore::FrameView::convertFromRenderer): Deleted.
+        (WebCore::FrameView::convertToRenderer): Deleted.
+        * page/FrameView.h:
+        * page/Page.cpp:
+        (WebCore::Page::setTopContentInset):
+        * platform/ScrollView.cpp:
+        (WebCore::ScrollView::documentScrollOffsetRelativeToViewOrigin):
+        (WebCore::ScrollView::documentScrollPositionRelativeToViewOrigin):
+        (WebCore::ScrollView::contentsToRootView):
+        (WebCore::ScrollView::rootViewToTotalContents):
+        (WebCore::ScrollView::contentsToWindow):
+        (WebCore::ScrollView::platformTopContentInset):
+        (WebCore::ScrollView::platformSetTopContentInset):
+        * platform/ScrollView.h:
+        (WebCore::ScrollView::topContentInset):
+        * platform/ios/ScrollViewIOS.mm:
+        (WebCore::ScrollView::platformTopContentInset):
+        (WebCore::ScrollView::platformSetTopContentInset):
+
+        Implement new platform inset-related functions using AppKit's implementation.
+        * platform/mac/ScrollViewMac.mm:
+        (WebCore::ScrollView::platformTopContentInset):
+        (WebCore::ScrollView::platformSetTopContentInset):
+        
+        When we set the scroll position for the documentView, we have to factor the inset
+        back into the WebCore scroll position.
+        (WebCore::ScrollView::platformSetScrollPosition):
+        
+        Re-named functions.
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::convertFromScrollbarToContainingView):
+        (WebCore::RenderLayer::convertFromContainingViewToScrollbar):
+        * rendering/RenderListBox.cpp:
+        (WebCore::RenderListBox::convertFromScrollbarToContainingView):
+        (WebCore::RenderListBox::convertFromContainingViewToScrollbar):
+
</ins><span class="cx"> 2014-07-31  Dean Jackson  &lt;dino@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Default buttons do not pulse in OS X 10.10
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.exp.in (171890 => 171891)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.exp.in        2014-07-31 22:07:46 UTC (rev 171890)
+++ trunk/Source/WebCore/WebCore.exp.in        2014-07-31 22:32:40 UTC (rev 171891)
</span><span class="lines">@@ -2017,18 +2017,18 @@
</span><span class="cx"> __ZNK7WebCore9FrameView13isTransparentEv
</span><span class="cx"> __ZNK7WebCore9FrameView13paintBehaviorEv
</span><span class="cx"> __ZNK7WebCore9FrameView14didFirstLayoutEv
</span><del>-__ZNK7WebCore9FrameView15topContentInsetEv
-__ZNK7WebCore9FrameView17convertToRendererEPKNS_13RenderElementERKNS_7IntRectE
-__ZNK7WebCore9FrameView17convertToRendererEPKNS_13RenderElementERKNS_8IntPointE
</del><ins>+__ZNK7WebCore9FrameView15topContentInsetENS_10ScrollView19TopContentInsetTypeE
</ins><span class="cx"> __ZNK7WebCore9FrameView19baseBackgroundColorEv
</span><del>-__ZNK7WebCore9FrameView19convertFromRendererEPKNS_13RenderElementERKNS_7IntRectE
-__ZNK7WebCore9FrameView19convertFromRendererEPKNS_13RenderElementERKNS_8IntPointE
</del><span class="cx"> __ZNK7WebCore9FrameView20isSoftwareRenderableEv
</span><span class="cx"> __ZNK7WebCore9FrameView21maximumScrollPositionEv
</span><span class="cx"> __ZNK7WebCore9FrameView21minimumScrollPositionEv
</span><span class="cx"> __ZNK7WebCore9FrameView23documentBackgroundColorEv
</span><span class="cx"> __ZNK7WebCore9FrameView27windowClipRectForFrameOwnerEPKNS_21HTMLFrameOwnerElementEb
</span><span class="cx"> __ZNK7WebCore9FrameView28isEnclosedInCompositingLayerEv
</span><ins>+__ZNK7WebCore9FrameView35convertFromContainingViewToRendererEPKNS_13RenderElementERKNS_7IntRectE
+__ZNK7WebCore9FrameView35convertFromContainingViewToRendererEPKNS_13RenderElementERKNS_8IntPointE
+__ZNK7WebCore9FrameView35convertFromRendererToContainingViewEPKNS_13RenderElementERKNS_7IntRectE
+__ZNK7WebCore9FrameView35convertFromRendererToContainingViewEPKNS_13RenderElementERKNS_8IntPointE
</ins><span class="cx"> __ZNK7WebCore9InlineBox10lineHeightEv
</span><span class="cx"> __ZNK7WebCore9InlineBox14caretMaxOffsetEv
</span><span class="cx"> __ZNK7WebCore9InlineBox14caretMinOffsetEv
</span></span></pre></div>
<a id="trunkSourceWebCorepageFrameViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/FrameView.cpp (171890 => 171891)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/FrameView.cpp        2014-07-31 22:07:46 UTC (rev 171890)
+++ trunk/Source/WebCore/page/FrameView.cpp        2014-07-31 22:32:40 UTC (rev 171891)
</span><span class="lines">@@ -930,8 +930,11 @@
</span><span class="cx">         renderView-&gt;setNeedsLayout();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-float FrameView::topContentInset() const
</del><ins>+float FrameView::topContentInset(TopContentInsetType contentInsetTypeToReturn) const
</ins><span class="cx"> {
</span><ins>+    if (platformWidget() &amp;&amp; contentInsetTypeToReturn == TopContentInsetType::WebCoreOrPlatformContentInset)
+        return platformTopContentInset();
+
</ins><span class="cx">     if (!frame().isMainFrame())
</span><span class="cx">         return 0;
</span><span class="cx">     
</span><span class="lines">@@ -939,11 +942,14 @@
</span><span class="cx">     return page ? page-&gt;topContentInset() : 0;
</span><span class="cx"> }
</span><span class="cx">     
</span><del>-void FrameView::topContentInsetDidChange()
</del><ins>+void FrameView::topContentInsetDidChange(float newTopContentInset)
</ins><span class="cx"> {
</span><span class="cx">     RenderView* renderView = this-&gt;renderView();
</span><span class="cx">     if (!renderView)
</span><span class="cx">         return;
</span><ins>+
+    if (platformWidget())
+        platformSetTopContentInset(newTopContentInset);
</ins><span class="cx">     
</span><span class="cx">     layout();
</span><span class="cx"> 
</span><span class="lines">@@ -952,7 +958,7 @@
</span><span class="cx">         renderView-&gt;compositor().frameViewDidChangeSize();
</span><span class="cx"> 
</span><span class="cx">     if (TiledBacking* tiledBacking = this-&gt;tiledBacking())
</span><del>-        tiledBacking-&gt;setTopContentInset(topContentInset());
</del><ins>+        tiledBacking-&gt;setTopContentInset(newTopContentInset);
</ins><span class="cx"> }
</span><span class="cx">     
</span><span class="cx"> bool FrameView::hasCompositedContent() const
</span><span class="lines">@@ -3931,18 +3937,18 @@
</span><span class="cx">     renderView-&gt;setPrintRect(IntRect());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-IntRect FrameView::convertFromRenderer(const RenderElement* renderer, const IntRect&amp; rendererRect) const
</del><ins>+IntRect FrameView::convertFromRendererToContainingView(const RenderElement* renderer, const IntRect&amp; rendererRect) const
</ins><span class="cx"> {
</span><span class="cx">     IntRect rect = pixelSnappedIntRect(enclosingLayoutRect(renderer-&gt;localToAbsoluteQuad(FloatRect(rendererRect)).boundingBox()));
</span><span class="cx"> 
</span><span class="cx">     // Convert from page (&quot;absolute&quot;) to FrameView coordinates.
</span><span class="cx">     if (!delegatesScrolling())
</span><del>-        rect.moveBy(-scrollPosition() + IntPoint(0, headerHeight() + topContentInset()));
</del><ins>+        rect.moveBy(-scrollPosition() + IntPoint(0, headerHeight() + topContentInset(TopContentInsetType::WebCoreOrPlatformContentInset)));
</ins><span class="cx"> 
</span><span class="cx">     return rect;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-IntRect FrameView::convertToRenderer(const RenderElement* renderer, const IntRect&amp; viewRect) const
</del><ins>+IntRect FrameView::convertFromContainingViewToRenderer(const RenderElement* renderer, const IntRect&amp; viewRect) const
</ins><span class="cx"> {
</span><span class="cx">     IntRect rect = viewRect;
</span><span class="cx">     
</span><span class="lines">@@ -3956,17 +3962,17 @@
</span><span class="cx">     return rect;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-IntPoint FrameView::convertFromRenderer(const RenderElement* renderer, const IntPoint&amp; rendererPoint) const
</del><ins>+IntPoint FrameView::convertFromRendererToContainingView(const RenderElement* renderer, const IntPoint&amp; rendererPoint) const
</ins><span class="cx"> {
</span><span class="cx">     IntPoint point = roundedIntPoint(renderer-&gt;localToAbsolute(rendererPoint, UseTransforms));
</span><span class="cx"> 
</span><span class="cx">     // Convert from page (&quot;absolute&quot;) to FrameView coordinates.
</span><span class="cx">     if (!delegatesScrolling())
</span><del>-        point.moveBy(-scrollPosition() + IntPoint(0, headerHeight() + topContentInset()));
</del><ins>+        point.moveBy(-scrollPosition() + IntPoint(0, headerHeight() + topContentInset(TopContentInsetType::WebCoreOrPlatformContentInset)));
</ins><span class="cx">     return point;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-IntPoint FrameView::convertToRenderer(const RenderElement* renderer, const IntPoint&amp; viewPoint) const
</del><ins>+IntPoint FrameView::convertFromContainingViewToRenderer(const RenderElement* renderer, const IntPoint&amp; viewPoint) const
</ins><span class="cx"> {
</span><span class="cx">     IntPoint point = viewPoint;
</span><span class="cx"> 
</span><span class="lines">@@ -3991,7 +3997,7 @@
</span><span class="cx">             // Add borders and padding??
</span><span class="cx">             rect.move(renderer-&gt;borderLeft() + renderer-&gt;paddingLeft(),
</span><span class="cx">                       renderer-&gt;borderTop() + renderer-&gt;paddingTop());
</span><del>-            return parentView-&gt;convertFromRenderer(renderer, rect);
</del><ins>+            return parentView-&gt;convertFromRendererToContainingView(renderer, rect);
</ins><span class="cx">         }
</span><span class="cx">         
</span><span class="cx">         return Widget::convertToContainingView(localRect);
</span><span class="lines">@@ -4011,7 +4017,7 @@
</span><span class="cx">             if (!renderer)
</span><span class="cx">                 return parentRect;
</span><span class="cx"> 
</span><del>-            IntRect rect = parentView-&gt;convertToRenderer(renderer, parentRect);
</del><ins>+            IntRect rect = parentView-&gt;convertFromContainingViewToRenderer(renderer, parentRect);
</ins><span class="cx">             // Subtract borders and padding
</span><span class="cx">             rect.move(-renderer-&gt;borderLeft() - renderer-&gt;paddingLeft(),
</span><span class="cx">                       -renderer-&gt;borderTop() - renderer-&gt;paddingTop());
</span><span class="lines">@@ -4040,7 +4046,7 @@
</span><span class="cx">             // Add borders and padding
</span><span class="cx">             point.move(renderer-&gt;borderLeft() + renderer-&gt;paddingLeft(),
</span><span class="cx">                        renderer-&gt;borderTop() + renderer-&gt;paddingTop());
</span><del>-            return parentView-&gt;convertFromRenderer(renderer, point);
</del><ins>+            return parentView-&gt;convertFromRendererToContainingView(renderer, point);
</ins><span class="cx">         }
</span><span class="cx">         
</span><span class="cx">         return Widget::convertToContainingView(localPoint);
</span><span class="lines">@@ -4060,7 +4066,7 @@
</span><span class="cx">             if (!renderer)
</span><span class="cx">                 return parentPoint;
</span><span class="cx"> 
</span><del>-            IntPoint point = parentView-&gt;convertToRenderer(renderer, parentPoint);
</del><ins>+            IntPoint point = parentView-&gt;convertFromContainingViewToRenderer(renderer, parentPoint);
</ins><span class="cx">             // Subtract borders and padding
</span><span class="cx">             point.move(-renderer-&gt;borderLeft() - renderer-&gt;paddingLeft(),
</span><span class="cx">                        -renderer-&gt;borderTop() - renderer-&gt;paddingTop());
</span></span></pre></div>
<a id="trunkSourceWebCorepageFrameViewh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/FrameView.h (171890 => 171891)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/FrameView.h        2014-07-31 22:07:46 UTC (rev 171890)
+++ trunk/Source/WebCore/page/FrameView.h        2014-07-31 22:32:40 UTC (rev 171891)
</span><span class="lines">@@ -387,10 +387,10 @@
</span><span class="cx">     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><del>-    IntRect convertFromRenderer(const RenderElement*, const IntRect&amp;) const;
-    IntRect convertToRenderer(const RenderElement*, const IntRect&amp;) const;
-    IntPoint convertFromRenderer(const RenderElement*, const IntPoint&amp;) const;
-    IntPoint convertToRenderer(const RenderElement*, const IntPoint&amp;) const;
</del><ins>+    IntRect convertFromRendererToContainingView(const RenderElement*, const IntRect&amp;) const;
+    IntRect convertFromContainingViewToRenderer(const RenderElement*, const IntRect&amp;) const;
+    IntPoint convertFromRendererToContainingView(const RenderElement*, const IntPoint&amp;) const;
+    IntPoint convertFromContainingViewToRenderer(const RenderElement*, const IntPoint&amp;) const;
</ins><span class="cx"> 
</span><span class="cx">     bool isFrameViewScrollCorner(RenderScrollbarPart* scrollCorner) const { return m_scrollCorner == scrollCorner; }
</span><span class="cx"> 
</span><span class="lines">@@ -465,8 +465,8 @@
</span><span class="cx">     virtual int footerHeight() const override { return m_footerHeight; }
</span><span class="cx">     void setFooterHeight(int);
</span><span class="cx"> 
</span><del>-    virtual float topContentInset() const override;
-    void topContentInsetDidChange();
</del><ins>+    virtual float topContentInset(TopContentInsetType = TopContentInsetType::WebCoreContentInset) const override;
+    void topContentInsetDidChange(float newTopContentInset);
</ins><span class="cx"> 
</span><span class="cx">     virtual void willStartLiveResize() override;
</span><span class="cx">     virtual void willEndLiveResize() override;
</span></span></pre></div>
<a id="trunkSourceWebCorepagePagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Page.cpp (171890 => 171891)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Page.cpp        2014-07-31 22:07:46 UTC (rev 171890)
+++ trunk/Source/WebCore/page/Page.cpp        2014-07-31 22:32:40 UTC (rev 171891)
</span><span class="lines">@@ -806,7 +806,7 @@
</span><span class="cx">     m_topContentInset = contentInset;
</span><span class="cx">     
</span><span class="cx">     if (FrameView* view = mainFrame().view())
</span><del>-        view-&gt;topContentInsetDidChange();
</del><ins>+        view-&gt;topContentInsetDidChange(m_topContentInset);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Page::setShouldSuppressScrollbarAnimations(bool suppressAnimations)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformScrollViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ScrollView.cpp (171890 => 171891)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ScrollView.cpp        2014-07-31 22:07:46 UTC (rev 171890)
+++ trunk/Source/WebCore/platform/ScrollView.cpp        2014-07-31 22:32:40 UTC (rev 171891)
</span><span class="lines">@@ -410,13 +410,13 @@
</span><span class="cx"> 
</span><span class="cx"> IntSize ScrollView::documentScrollOffsetRelativeToViewOrigin() const
</span><span class="cx"> {
</span><del>-    return scrollOffset() - IntSize(0, headerHeight() + topContentInset());
</del><ins>+    return scrollOffset() - IntSize(0, headerHeight() + topContentInset(TopContentInsetType::WebCoreOrPlatformContentInset));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> IntPoint ScrollView::documentScrollPositionRelativeToViewOrigin() const
</span><span class="cx"> {
</span><span class="cx">     IntPoint scrollPosition = this-&gt;scrollPosition();
</span><del>-    return IntPoint(scrollPosition.x(), scrollPosition.y() - headerHeight() - topContentInset());
</del><ins>+    return IntPoint(scrollPosition.x(), scrollPosition.y() - headerHeight() - topContentInset(TopContentInsetType::WebCoreOrPlatformContentInset));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> IntSize ScrollView::documentScrollOffsetRelativeToScrollableAreaOrigin() const
</span><span class="lines">@@ -830,7 +830,7 @@
</span><span class="cx">     if (delegatesScrolling())
</span><span class="cx">         return convertToRootView(contentsPoint);
</span><span class="cx"> 
</span><del>-    IntPoint viewPoint = contentsPoint + IntSize(0, headerHeight() + topContentInset()) - scrollOffset();
</del><ins>+    IntPoint viewPoint = contentsPoint + IntSize(0, headerHeight() + topContentInset(TopContentInsetType::WebCoreOrPlatformContentInset)) - scrollOffset();
</ins><span class="cx">     return convertToRootView(viewPoint);  
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -850,7 +850,7 @@
</span><span class="cx">         return convertToRootView(contentsRect);
</span><span class="cx"> 
</span><span class="cx">     IntRect viewRect = contentsRect;
</span><del>-    viewRect.move(-scrollOffset() + IntSize(0, headerHeight() + topContentInset()));
</del><ins>+    viewRect.move(-scrollOffset() + IntSize(0, headerHeight() + topContentInset(TopContentInsetType::WebCoreOrPlatformContentInset)));
</ins><span class="cx">     return convertToRootView(viewRect);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -860,7 +860,7 @@
</span><span class="cx">         return convertFromRootView(rootViewPoint);
</span><span class="cx"> 
</span><span class="cx">     IntPoint viewPoint = convertFromRootView(rootViewPoint);
</span><del>-    return viewPoint + scrollOffset() - IntSize(0, topContentInset());
</del><ins>+    return viewPoint + scrollOffset() - IntSize(0, topContentInset(TopContentInsetType::WebCoreOrPlatformContentInset));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> IntPoint ScrollView::windowToContents(const IntPoint&amp; windowPoint) const
</span><span class="lines">@@ -877,7 +877,7 @@
</span><span class="cx">     if (delegatesScrolling())
</span><span class="cx">         return convertToContainingWindow(contentsPoint);
</span><span class="cx"> 
</span><del>-    IntPoint viewPoint = contentsPoint + IntSize(0, headerHeight() + topContentInset()) - scrollOffset();
</del><ins>+    IntPoint viewPoint = contentsPoint + IntSize(0, headerHeight() + topContentInset(TopContentInsetType::WebCoreOrPlatformContentInset)) - scrollOffset();
</ins><span class="cx">     return convertToContainingWindow(viewPoint);  
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -897,7 +897,7 @@
</span><span class="cx">         return convertToContainingWindow(contentsRect);
</span><span class="cx"> 
</span><span class="cx">     IntRect viewRect = contentsRect;
</span><del>-    viewRect.move(-scrollOffset() + IntSize(0, headerHeight() + topContentInset()));
</del><ins>+    viewRect.move(-scrollOffset() + IntSize(0, headerHeight() + topContentInset(TopContentInsetType::WebCoreOrPlatformContentInset)));
</ins><span class="cx">     return convertToContainingWindow(viewRect);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1515,6 +1515,15 @@
</span><span class="cx">     return IntRect();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+float ScrollView::platformTopContentInset() const
+{
+    return 0;
+}
+
+void ScrollView::platformSetTopContentInset(float)
+{
+}
+
</ins><span class="cx"> IntSize ScrollView::platformVisibleContentSize(bool) const
</span><span class="cx"> {
</span><span class="cx">     return IntSize();
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformScrollViewh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ScrollView.h (171890 => 171891)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ScrollView.h        2014-07-31 22:07:46 UTC (rev 171890)
+++ trunk/Source/WebCore/platform/ScrollView.h        2014-07-31 22:32:40 UTC (rev 171891)
</span><span class="lines">@@ -156,7 +156,13 @@
</span><span class="cx">     void setCanBlitOnScroll(bool);
</span><span class="cx">     bool canBlitOnScroll() const;
</span><span class="cx"> 
</span><del>-    virtual float topContentInset() const { return 0; }
</del><ins>+    // There are at least three types of contentInset. Usually we just care about WebCoreContentInset, which is the inset
+    // that is set on a Page that requires WebCore to move its layers to accomodate the inset. However, there are platform
+    // concepts that are similar on both iOS and Mac when there is a platformWidget(). Sometimes we need the Mac platform value
+    // for topContentInset, so when the TopContentInsetType is WebCoreOrPlatformContentInset, platformTopContentInset()
+    // will be returned instead of the value set on Page.
+    enum class TopContentInsetType { WebCoreContentInset, WebCoreOrPlatformContentInset };
+    virtual float topContentInset(TopContentInsetType = TopContentInsetType::WebCoreContentInset) const { return 0; }
</ins><span class="cx"> 
</span><span class="cx">     // The visible content rect has a location that is the scrolled offset of the document. The width and height are the unobscured viewport
</span><span class="cx">     // width and height. By default the scrollbars themselves are excluded from this rectangle, but an optional boolean argument allows them
</span><span class="lines">@@ -408,6 +414,9 @@
</span><span class="cx">     // Called to update the scrollbars to accurately reflect the state of the view.
</span><span class="cx">     void updateScrollbars(const IntSize&amp; desiredOffset);
</span><span class="cx"> 
</span><ins>+    float platformTopContentInset() const;
+    void platformSetTopContentInset(float);
+
</ins><span class="cx"> private:
</span><span class="cx">     virtual IntRect visibleContentRectInternal(VisibleContentRectIncludesScrollbars, VisibleContentRectBehavior) const override;
</span><span class="cx">     IntRect unobscuredContentRectInternal(VisibleContentRectIncludesScrollbars = ExcludeScrollbars) const;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformiosScrollViewIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ios/ScrollViewIOS.mm (171890 => 171891)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/ScrollViewIOS.mm        2014-07-31 22:07:46 UTC (rev 171890)
+++ trunk/Source/WebCore/platform/ios/ScrollViewIOS.mm        2014-07-31 22:32:40 UTC (rev 171891)
</span><span class="lines">@@ -161,6 +161,15 @@
</span><span class="cx">     END_BLOCK_OBJC_EXCEPTIONS;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+float ScrollView::platformTopContentInset(float) const
+{
+    return 0;
+}
+
+void ScrollView::platformSetTopContentInset()
+{
+}
+
</ins><span class="cx"> IntRect ScrollView::platformVisibleContentRect(bool includeScrollbars) const
</span><span class="cx"> {
</span><span class="cx">     BEGIN_BLOCK_OBJC_EXCEPTIONS;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmacScrollViewMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/ScrollViewMac.mm (171890 => 171891)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/ScrollViewMac.mm        2014-07-31 22:07:46 UTC (rev 171890)
+++ trunk/Source/WebCore/platform/mac/ScrollViewMac.mm        2014-07-31 22:32:40 UTC (rev 171891)
</span><span class="lines">@@ -108,6 +108,35 @@
</span><span class="cx">     return [[scrollView() contentView] copiesOnScroll];
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+float ScrollView::platformTopContentInset() const
+{
+    BEGIN_BLOCK_OBJC_EXCEPTIONS;
+#if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101000
+    return scrollView().contentInsets.top;
+#endif
+    END_BLOCK_OBJC_EXCEPTIONS;
+
+    return 0;
+}
+
+void ScrollView::platformSetTopContentInset(float topContentInset)
+{
+    BEGIN_BLOCK_OBJC_EXCEPTIONS;
+#if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101000
+    if (topContentInset)
+        scrollView().automaticallyAdjustsContentInsets = NO;
+    else
+        scrollView().automaticallyAdjustsContentInsets = YES;
+
+    NSEdgeInsets contentInsets = scrollView().contentInsets;
+    contentInsets.top = topContentInset;
+    scrollView().contentInsets = contentInsets;
+#else
+    UNUSED_PARAM(topContentInset);
+#endif
+    END_BLOCK_OBJC_EXCEPTIONS;
+}
+
</ins><span class="cx"> IntRect ScrollView::platformVisibleContentRect(bool includeScrollbars) const
</span><span class="cx"> {
</span><span class="cx">     BEGIN_BLOCK_OBJC_EXCEPTIONS;
</span><span class="lines">@@ -160,6 +189,14 @@
</span><span class="cx">     BEGIN_BLOCK_OBJC_EXCEPTIONS;
</span><span class="cx">     NSPoint floatPoint = scrollPoint;
</span><span class="cx">     NSPoint tempPoint = { std::max(-[scrollView() scrollOrigin].x, floatPoint.x), std::max(-[scrollView() scrollOrigin].y, floatPoint.y) };  // Don't use NSMakePoint to work around 4213314.
</span><ins>+
+#if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101000
+    // AppKit has the inset factored into all of its scroll positions. In WebCore, we use positions that ignore
+    // the insets so that they are equivalent whether or not there is an inset.
+    tempPoint.x = tempPoint.x - scrollView().contentInsets.left;
+    tempPoint.y = tempPoint.y - scrollView().contentInsets.top;
+#endif
+
</ins><span class="cx">     [documentView() scrollPoint:tempPoint];
</span><span class="cx">     END_BLOCK_OBJC_EXCEPTIONS;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (171890 => 171891)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayer.cpp        2014-07-31 22:07:46 UTC (rev 171890)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp        2014-07-31 22:32:40 UTC (rev 171891)
</span><span class="lines">@@ -2730,12 +2730,12 @@
</span><span class="cx">     IntRect rect = scrollbarRect;
</span><span class="cx">     rect.move(scrollbarOffset(scrollbar));
</span><span class="cx"> 
</span><del>-    return renderer().view().frameView().convertFromRenderer(&amp;renderer(), rect);
</del><ins>+    return renderer().view().frameView().convertFromRendererToContainingView(&amp;renderer(), rect);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> IntRect RenderLayer::convertFromContainingViewToScrollbar(const Scrollbar* scrollbar, const IntRect&amp; parentRect) const
</span><span class="cx"> {
</span><del>-    IntRect rect = renderer().view().frameView().convertToRenderer(&amp;renderer(), parentRect);
</del><ins>+    IntRect rect = renderer().view().frameView().convertFromContainingViewToRenderer(&amp;renderer(), parentRect);
</ins><span class="cx">     rect.move(-scrollbarOffset(scrollbar));
</span><span class="cx">     return rect;
</span><span class="cx"> }
</span><span class="lines">@@ -2744,12 +2744,12 @@
</span><span class="cx"> {
</span><span class="cx">     IntPoint point = scrollbarPoint;
</span><span class="cx">     point.move(scrollbarOffset(scrollbar));
</span><del>-    return renderer().view().frameView().convertFromRenderer(&amp;renderer(), point);
</del><ins>+    return renderer().view().frameView().convertFromRendererToContainingView(&amp;renderer(), point);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> IntPoint RenderLayer::convertFromContainingViewToScrollbar(const Scrollbar* scrollbar, const IntPoint&amp; parentPoint) const
</span><span class="cx"> {
</span><del>-    IntPoint point = renderer().view().frameView().convertToRenderer(&amp;renderer(), parentPoint);
</del><ins>+    IntPoint point = renderer().view().frameView().convertFromContainingViewToRenderer(&amp;renderer(), parentPoint);
</ins><span class="cx">     point.move(-scrollbarOffset(scrollbar));
</span><span class="cx">     return point;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderListBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderListBox.cpp (171890 => 171891)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderListBox.cpp        2014-07-31 22:07:46 UTC (rev 171890)
+++ trunk/Source/WebCore/rendering/RenderListBox.cpp        2014-07-31 22:32:40 UTC (rev 171891)
</span><span class="lines">@@ -725,12 +725,12 @@
</span><span class="cx">     int scrollbarLeft = width() - borderRight() - scrollbar-&gt;width();
</span><span class="cx">     int scrollbarTop = borderTop();
</span><span class="cx">     rect.move(scrollbarLeft, scrollbarTop);
</span><del>-    return view().frameView().convertFromRenderer(this, rect);
</del><ins>+    return view().frameView().convertFromRendererToContainingView(this, rect);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> IntRect RenderListBox::convertFromContainingViewToScrollbar(const Scrollbar* scrollbar, const IntRect&amp; parentRect) const
</span><span class="cx"> {
</span><del>-    IntRect rect = view().frameView().convertToRenderer(this, parentRect);
</del><ins>+    IntRect rect = view().frameView().convertFromContainingViewToRenderer(this, parentRect);
</ins><span class="cx">     int scrollbarLeft = width() - borderRight() - scrollbar-&gt;width();
</span><span class="cx">     int scrollbarTop = borderTop();
</span><span class="cx">     rect.move(-scrollbarLeft, -scrollbarTop);
</span><span class="lines">@@ -743,12 +743,12 @@
</span><span class="cx">     int scrollbarLeft = width() - borderRight() - scrollbar-&gt;width();
</span><span class="cx">     int scrollbarTop = borderTop();
</span><span class="cx">     point.move(scrollbarLeft, scrollbarTop);
</span><del>-    return view().frameView().convertFromRenderer(this, point);
</del><ins>+    return view().frameView().convertFromRendererToContainingView(this, point);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> IntPoint RenderListBox::convertFromContainingViewToScrollbar(const Scrollbar* scrollbar, const IntPoint&amp; parentPoint) const
</span><span class="cx"> {
</span><del>-    IntPoint point = view().frameView().convertToRenderer(this, parentPoint);
</del><ins>+    IntPoint point = view().frameView().convertFromContainingViewToRenderer(this, parentPoint);
</ins><span class="cx">     int scrollbarLeft = width() - borderRight() - scrollbar-&gt;width();
</span><span class="cx">     int scrollbarTop = borderTop();
</span><span class="cx">     point.move(-scrollbarLeft, -scrollbarTop);
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (171890 => 171891)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-07-31 22:07:46 UTC (rev 171890)
+++ trunk/Source/WebKit2/ChangeLog        2014-07-31 22:32:40 UTC (rev 171891)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2014-07-31  Beth Dakin  &lt;bdakin@apple.com&gt;
+
+        Hit-testing broken in WebKit 1 views with AppKit's contentInsets
+        https://bugs.webkit.org/show_bug.cgi?id=135434
+        -and corresponding-
+        &lt;rdar://problem/17850323&gt;
+
+        Reviewed by Benjamin Poulain.
+
+        Re-named functions.
+        * WebProcess/Plugins/PDF/PDFPlugin.mm:
+        (WebKit::PDFPlugin::convertFromScrollbarToContainingView):
+        (WebKit::PDFPlugin::convertFromContainingViewToScrollbar):
+
</ins><span class="cx"> 2014-07-31  Oliver Hunt  &lt;oliver@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Various SSO services need the networking process to be able to spoof its bundle id
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessPluginsPDFPDFPluginmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Plugins/PDF/PDFPlugin.mm (171890 => 171891)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Plugins/PDF/PDFPlugin.mm        2014-07-31 22:07:46 UTC (rev 171890)
+++ trunk/Source/WebKit2/WebProcess/Plugins/PDF/PDFPlugin.mm        2014-07-31 22:32:40 UTC (rev 171891)
</span><span class="lines">@@ -679,12 +679,12 @@
</span><span class="cx">     IntRect rect = scrollbarRect;
</span><span class="cx">     rect.move(scrollbar-&gt;location() - pluginView()-&gt;location());
</span><span class="cx"> 
</span><del>-    return pluginView()-&gt;frame()-&gt;view()-&gt;convertFromRenderer(pluginView()-&gt;renderer(), rect);
</del><ins>+    return pluginView()-&gt;frame()-&gt;view()-&gt;convertFromRendererToContainingView(pluginView()-&gt;renderer(), rect);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> IntRect PDFPlugin::convertFromContainingViewToScrollbar(const Scrollbar* scrollbar, const IntRect&amp; parentRect) const
</span><span class="cx"> {
</span><del>-    IntRect rect = pluginView()-&gt;frame()-&gt;view()-&gt;convertToRenderer(pluginView()-&gt;renderer(), parentRect);
</del><ins>+    IntRect rect = pluginView()-&gt;frame()-&gt;view()-&gt;convertFromContainingViewToRenderer(pluginView()-&gt;renderer(), parentRect);
</ins><span class="cx">     rect.move(pluginView()-&gt;location() - scrollbar-&gt;location());
</span><span class="cx"> 
</span><span class="cx">     return rect;
</span><span class="lines">@@ -695,12 +695,12 @@
</span><span class="cx">     IntPoint point = scrollbarPoint;
</span><span class="cx">     point.move(scrollbar-&gt;location() - pluginView()-&gt;location());
</span><span class="cx"> 
</span><del>-    return pluginView()-&gt;frame()-&gt;view()-&gt;convertFromRenderer(pluginView()-&gt;renderer(), point);
</del><ins>+    return pluginView()-&gt;frame()-&gt;view()-&gt;convertFromRendererToContainingView(pluginView()-&gt;renderer(), point);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> IntPoint PDFPlugin::convertFromContainingViewToScrollbar(const Scrollbar* scrollbar, const IntPoint&amp; parentPoint) const
</span><span class="cx"> {
</span><del>-    IntPoint point = pluginView()-&gt;frame()-&gt;view()-&gt;convertToRenderer(pluginView()-&gt;renderer(), parentPoint);
</del><ins>+    IntPoint point = pluginView()-&gt;frame()-&gt;view()-&gt;convertFromContainingViewToRenderer(pluginView()-&gt;renderer(), parentPoint);
</ins><span class="cx">     point.move(pluginView()-&gt;location() - scrollbar-&gt;location());
</span><span class="cx">     
</span><span class="cx">     return point;
</span></span></pre>
</div>
</div>

</body>
</html>