<!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>[168763] trunk/Source</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/168763">168763</a></dd>
<dt>Author</dt> <dd>bdakin@apple.com</dd>
<dt>Date</dt> <dd>2014-05-13 17:13:56 -0700 (Tue, 13 May 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>REGRESSION (topContentInset): Searching through Facebook Messenger's chat causes 
scrolling in News Feed
https://bugs.webkit.org/show_bug.cgi?id=132889
-and corresponding-
&lt;rdar://problem/16715716&gt;

Reviewed by Simon Fraser.


Source/WebCore: 
First of all, scrollOffsetRelativeToDocument() was very poorly named. This patch 
re-names it to the much more accurate documentScrollOffsetRelativeToViewOrigin(). 
Re-naming it makes it clear that ONE call site was not getting the right offset. 
That call site does not want to know the document’s position relative to the view 
origin, but rather it wants to know the Document’s position relative to the 
scrolling origin.

Export new name.
* WebCore.exp.in:

Use newly re-named documentScrollPositionRelativeToViewOrigin().
* page/FrameView.cpp:
(WebCore::FrameView::convertToRenderer):
* platform/ScrollView.cpp:
(WebCore::ScrollView::documentScrollOffsetRelativeToViewOrigin):
(WebCore::ScrollView::documentScrollPositionRelativeToViewOrigin):
(WebCore::ScrollView::documentScrollOffsetRelativeToScrollableAreaOrigin):
(WebCore::ScrollView::rootViewToContents):
(WebCore::ScrollView::windowToContents):
(WebCore::ScrollView::scrollOffsetRelativeToDocument): Deleted.
(WebCore::ScrollView::scrollPositionRelativeToDocument): Deleted.
* platform/ScrollView.h:

THIS is the spot that needs the new function, 
documentScrollOffsetRelativeToScrollableAreaOrigin()()
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollRectToVisible):

Source/WebKit2: 
Re-name scrollOffsetRelativeToDocument() to 
documentScrollPositionRelativeToViewOrigin().
* WebProcess/WebPage/FindController.cpp:
(WebKit::FindController::rectsForTextMatches):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::determinePrimarySnapshottedPlugIn):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCoreexpin">trunk/Source/WebCore/WebCore.exp.in</a></li>
<li><a href="#trunkSourceWebCorepageFrameViewcpp">trunk/Source/WebCore/page/FrameView.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="#trunkSourceWebCorerenderingRenderLayercpp">trunk/Source/WebCore/rendering/RenderLayer.cpp</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageFindControllercpp">trunk/Source/WebKit2/WebProcess/WebPage/FindController.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPagecpp">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (168762 => 168763)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-05-14 00:10:44 UTC (rev 168762)
+++ trunk/Source/WebCore/ChangeLog        2014-05-14 00:13:56 UTC (rev 168763)
</span><span class="lines">@@ -1,3 +1,41 @@
</span><ins>+2014-05-13  Beth Dakin  &lt;bdakin@apple.com&gt;
+
+        REGRESSION (topContentInset): Searching through Facebook Messenger's chat causes 
+        scrolling in News Feed
+        https://bugs.webkit.org/show_bug.cgi?id=132889
+        -and corresponding-
+        &lt;rdar://problem/16715716&gt;
+
+        Reviewed by Simon Fraser.
+
+        First of all, scrollOffsetRelativeToDocument() was very poorly named. This patch 
+        re-names it to the much more accurate documentScrollOffsetRelativeToViewOrigin(). 
+        Re-naming it makes it clear that ONE call site was not getting the right offset. 
+        That call site does not want to know the document’s position relative to the view 
+        origin, but rather it wants to know the Document’s position relative to the 
+        scrolling origin.
+
+        Export new name.
+        * WebCore.exp.in:
+
+        Use newly re-named documentScrollPositionRelativeToViewOrigin().
+        * page/FrameView.cpp:
+        (WebCore::FrameView::convertToRenderer):
+        * platform/ScrollView.cpp:
+        (WebCore::ScrollView::documentScrollOffsetRelativeToViewOrigin):
+        (WebCore::ScrollView::documentScrollPositionRelativeToViewOrigin):
+        (WebCore::ScrollView::documentScrollOffsetRelativeToScrollableAreaOrigin):
+        (WebCore::ScrollView::rootViewToContents):
+        (WebCore::ScrollView::windowToContents):
+        (WebCore::ScrollView::scrollOffsetRelativeToDocument): Deleted.
+        (WebCore::ScrollView::scrollPositionRelativeToDocument): Deleted.
+        * platform/ScrollView.h:
+
+        THIS is the spot that needs the new function, 
+        documentScrollOffsetRelativeToScrollableAreaOrigin()()
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::scrollRectToVisible):
+
</ins><span class="cx"> 2014-05-13  Dean Jackson  &lt;dino@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [iOS] Page scale update messages for media controls should only fire at the end of zooming
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.exp.in (168762 => 168763)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.exp.in        2014-05-14 00:10:44 UTC (rev 168762)
+++ trunk/Source/WebCore/WebCore.exp.in        2014-05-14 00:13:56 UTC (rev 168763)
</span><span class="lines">@@ -1507,7 +1507,7 @@
</span><span class="cx"> __ZNK7WebCore10ScrollView18contentsToRootViewERKNS_8IntPointE
</span><span class="cx"> __ZNK7WebCore10ScrollView18rootViewToContentsERKNS_8IntPointE
</span><span class="cx"> __ZNK7WebCore10ScrollView23rootViewToTotalContentsERKNS_8IntPointE
</span><del>-__ZNK7WebCore10ScrollView30scrollOffsetRelativeToDocumentEv
</del><ins>+__ZNK7WebCore10ScrollView40documentScrollOffsetRelativeToViewOriginEv
</ins><span class="cx"> __ZNK7WebCore10StorageMap6lengthEv
</span><span class="cx"> __ZNK7WebCore10StorageMap7getItemERKN3WTF6StringE
</span><span class="cx"> __ZNK7WebCore10StorageMap8containsERKN3WTF6StringE
</span></span></pre></div>
<a id="trunkSourceWebCorepageFrameViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/FrameView.cpp (168762 => 168763)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/FrameView.cpp        2014-05-14 00:10:44 UTC (rev 168762)
+++ trunk/Source/WebCore/page/FrameView.cpp        2014-05-14 00:13:56 UTC (rev 168763)
</span><span class="lines">@@ -3879,7 +3879,7 @@
</span><span class="cx">     
</span><span class="cx">     // Convert from FrameView coords into page (&quot;absolute&quot;) coordinates.
</span><span class="cx">     if (!delegatesScrolling())
</span><del>-        rect.moveBy(scrollPositionRelativeToDocument());
</del><ins>+        rect.moveBy(documentScrollPositionRelativeToViewOrigin());
</ins><span class="cx"> 
</span><span class="cx">     // FIXME: we don't have a way to map an absolute rect down to a local quad, so just
</span><span class="cx">     // move the rect for now.
</span><span class="lines">@@ -3903,7 +3903,7 @@
</span><span class="cx"> 
</span><span class="cx">     // Convert from FrameView coords into page (&quot;absolute&quot;) coordinates.
</span><span class="cx">     if (!delegatesScrolling())
</span><del>-        point = point + scrollPositionRelativeToDocument();
</del><ins>+        point = point + documentScrollPositionRelativeToViewOrigin();
</ins><span class="cx"> 
</span><span class="cx">     return roundedIntPoint(renderer-&gt;absoluteToLocal(point, UseTransforms));
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformScrollViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ScrollView.cpp (168762 => 168763)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ScrollView.cpp        2014-05-14 00:10:44 UTC (rev 168762)
+++ trunk/Source/WebCore/platform/ScrollView.cpp        2014-05-14 00:13:56 UTC (rev 168763)
</span><span class="lines">@@ -412,18 +412,22 @@
</span><span class="cx">     return newScrollPosition;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-IntSize ScrollView::scrollOffsetRelativeToDocument() const
</del><ins>+IntSize ScrollView::documentScrollOffsetRelativeToViewOrigin() const
</ins><span class="cx"> {
</span><del>-    IntSize scrollOffset = this-&gt;scrollOffset();
-    return IntSize(scrollOffset.width(), scrollOffset.height() - headerHeight() - topContentInset());
</del><ins>+    return scrollOffset() - IntSize(0, headerHeight() + topContentInset());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-IntPoint ScrollView::scrollPositionRelativeToDocument() const
</del><ins>+IntPoint ScrollView::documentScrollPositionRelativeToViewOrigin() const
</ins><span class="cx"> {
</span><span class="cx">     IntPoint scrollPosition = this-&gt;scrollPosition();
</span><span class="cx">     return IntPoint(scrollPosition.x(), scrollPosition.y() - headerHeight() - topContentInset());
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+IntSize ScrollView::documentScrollOffsetRelativeToScrollableAreaOrigin() const
+{
+    return scrollOffset() - IntSize(0, headerHeight());
+}
+
</ins><span class="cx"> int ScrollView::scrollSize(ScrollbarOrientation orientation) const
</span><span class="cx"> {
</span><span class="cx">     // If no scrollbars are present, it does not indicate content is not be scrollable.
</span><span class="lines">@@ -822,7 +826,7 @@
</span><span class="cx">         return convertFromRootView(rootViewPoint);
</span><span class="cx"> 
</span><span class="cx">     IntPoint viewPoint = convertFromRootView(rootViewPoint);
</span><del>-    return viewPoint + scrollOffsetRelativeToDocument();
</del><ins>+    return viewPoint + documentScrollOffsetRelativeToViewOrigin();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> IntPoint ScrollView::contentsToRootView(const IntPoint&amp; contentsPoint) const
</span><span class="lines">@@ -840,7 +844,7 @@
</span><span class="cx">         return convertFromRootView(rootViewRect);
</span><span class="cx"> 
</span><span class="cx">     IntRect viewRect = convertFromRootView(rootViewRect);
</span><del>-    viewRect.move(scrollOffsetRelativeToDocument());
</del><ins>+    viewRect.move(documentScrollOffsetRelativeToViewOrigin());
</ins><span class="cx">     return viewRect;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -869,7 +873,7 @@
</span><span class="cx">         return convertFromContainingWindow(windowPoint);
</span><span class="cx"> 
</span><span class="cx">     IntPoint viewPoint = convertFromContainingWindow(windowPoint);
</span><del>-    return viewPoint + scrollOffsetRelativeToDocument();
</del><ins>+    return viewPoint + documentScrollOffsetRelativeToViewOrigin();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> IntPoint ScrollView::contentsToWindow(const IntPoint&amp; contentsPoint) const
</span><span class="lines">@@ -887,7 +891,7 @@
</span><span class="cx">         return convertFromContainingWindow(windowRect);
</span><span class="cx"> 
</span><span class="cx">     IntRect viewRect = convertFromContainingWindow(windowRect);
</span><del>-    viewRect.move(scrollOffsetRelativeToDocument());
</del><ins>+    viewRect.move(documentScrollOffsetRelativeToViewOrigin());
</ins><span class="cx">     return viewRect;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformScrollViewh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ScrollView.h (168762 => 168763)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ScrollView.h        2014-05-14 00:10:44 UTC (rev 168762)
+++ trunk/Source/WebCore/platform/ScrollView.h        2014-05-14 00:13:56 UTC (rev 168763)
</span><span class="lines">@@ -241,13 +241,22 @@
</span><span class="cx">     IntPoint actualScrollPosition() const { return unobscuredContentRect().location(); }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    // scrollOffset() anchors its (0,0) point at the top end of the header if this ScrollableArea
-    // has a header, so it is relative to the totalContentsSize(). scrollOffsetRelativeToDocument()
-    // anchors (0,0) at the top of the Document, which will be beneath any headers, so it is relative
-    // to contentsSize().
-    IntSize scrollOffsetRelativeToDocument() const;
-    IntPoint scrollPositionRelativeToDocument() const;
</del><ins>+    // scrollOffset() anchors its (0,0) point at the ScrollableArea's origin. When the Page has a
+    // header, the header is positioned at (0,0), ABOVE the start of the Document. So when a page with
+    // a header is pinned to the top, the scrollOffset() is (0,0), but the Document is actually at
+    // (0, -headerHeight()). documentScrollOffsetRelativeToScrollableAreaOrigin() will return this
+    // version of the offset, which tracks the top of Document relative to where scrolling was achored.
+    IntSize documentScrollOffsetRelativeToScrollableAreaOrigin() const;
</ins><span class="cx"> 
</span><ins>+    // scrollOffset() anchors its (0,0) point at the ScrollableArea's origin. The top of the scrolling
+    // layer does not represent the top of the view when there is a topContentInset. Additionally, as
+    // detailed above, the origin of the scrolling layer also does not necessarily correspond with the
+    // top of the document anyway, since there could also be header. documentScrollOffsetRelativeToViewOrigin()
+    // will return a version of the current scroll offset which tracks the top of the Document
+    // relative to the very top of the view.
+    IntSize documentScrollOffsetRelativeToViewOrigin() const;
+    IntPoint documentScrollPositionRelativeToViewOrigin() const;
+
</ins><span class="cx">     virtual IntSize overhangAmount() const override;
</span><span class="cx"> 
</span><span class="cx">     void cacheCurrentScrollPosition() { m_cachedScrollPosition = scrollPosition(); }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (168762 => 168763)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayer.cpp        2014-05-14 00:10:44 UTC (rev 168762)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp        2014-05-14 00:13:56 UTC (rev 168763)
</span><span class="lines">@@ -2409,8 +2409,8 @@
</span><span class="cx"> #if !PLATFORM(IOS)
</span><span class="cx">             LayoutRect viewRect = frameView.visibleContentRect();
</span><span class="cx">             LayoutRect visibleRectRelativeToDocument = viewRect;
</span><del>-            IntSize scrollOffsetRelativeToDocument = frameView.scrollOffsetRelativeToDocument();
-            visibleRectRelativeToDocument.setLocation(IntPoint(scrollOffsetRelativeToDocument.width(), scrollOffsetRelativeToDocument.height()));
</del><ins>+            IntSize documentScrollOffsetRelativeToScrollableAreaOrigin = frameView.documentScrollOffsetRelativeToScrollableAreaOrigin();
+            visibleRectRelativeToDocument.setLocation(IntPoint(documentScrollOffsetRelativeToScrollableAreaOrigin.width(), documentScrollOffsetRelativeToScrollableAreaOrigin.height()));
</ins><span class="cx"> #else
</span><span class="cx">             LayoutRect viewRect = frameView.unobscuredContentRect();
</span><span class="cx">             LayoutRect visibleRectRelativeToDocument = viewRect;
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (168762 => 168763)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-05-14 00:10:44 UTC (rev 168762)
+++ trunk/Source/WebKit2/ChangeLog        2014-05-14 00:13:56 UTC (rev 168763)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2014-05-13  Beth Dakin  &lt;bdakin@apple.com&gt;
+
+        REGRESSION (topContentInset): Searching through Facebook Messenger's chat causes 
+        scrolling in News Feed
+        https://bugs.webkit.org/show_bug.cgi?id=132889
+        -and corresponding-
+        &lt;rdar://problem/16715716&gt;
+
+        Reviewed by Simon Fraser.
+
+        Re-name scrollOffsetRelativeToDocument() to 
+        documentScrollPositionRelativeToViewOrigin().
+        * WebProcess/WebPage/FindController.cpp:
+        (WebKit::FindController::rectsForTextMatches):
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::determinePrimarySnapshottedPlugIn):
+
</ins><span class="cx"> 2014-05-13  Dean Jackson  &lt;dino@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [iOS] Page scale update messages for media controls should only fire at the end of zooming
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageFindControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/FindController.cpp (168762 => 168763)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/FindController.cpp        2014-05-14 00:10:44 UTC (rev 168762)
+++ trunk/Source/WebKit2/WebProcess/WebPage/FindController.cpp        2014-05-14 00:13:56 UTC (rev 168763)
</span><span class="lines">@@ -418,7 +418,7 @@
</span><span class="cx"> 
</span><span class="cx">         IntRect visibleRect = frame-&gt;view()-&gt;visibleContentRect();
</span><span class="cx">         Vector&lt;IntRect&gt; frameRects = document-&gt;markers().renderedRectsForMarkers(DocumentMarker::TextMatch);
</span><del>-        IntPoint frameOffset(-frame-&gt;view()-&gt;scrollOffsetRelativeToDocument().width(), -frame-&gt;view()-&gt;scrollOffsetRelativeToDocument().height());
</del><ins>+        IntPoint frameOffset(-frame-&gt;view()-&gt;documentScrollOffsetRelativeToViewOrigin().width(), -frame-&gt;view()-&gt;documentScrollOffsetRelativeToViewOrigin().height());
</ins><span class="cx">         frameOffset = frame-&gt;view()-&gt;convertToContainingWindow(frameOffset);
</span><span class="cx"> 
</span><span class="cx">         for (Vector&lt;IntRect&gt;::iterator it = frameRects.begin(), end = frameRects.end(); it != end; ++it) {
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (168762 => 168763)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2014-05-14 00:10:44 UTC (rev 168762)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2014-05-14 00:13:56 UTC (rev 168763)
</span><span class="lines">@@ -4395,7 +4395,7 @@
</span><span class="cx">             IntRect plugInRectRelativeToView = plugInImageElement.clientRect();
</span><span class="cx">             if (plugInRectRelativeToView.isEmpty())
</span><span class="cx">                 continue;
</span><del>-            IntSize scrollOffset = mainFrame.view()-&gt;scrollOffsetRelativeToDocument();
</del><ins>+            IntSize scrollOffset = mainFrame.view()-&gt;documentScrollOffsetRelativeToViewOrigin();
</ins><span class="cx">             IntRect plugInRectRelativeToTopDocument(plugInRectRelativeToView.location() + scrollOffset, plugInRectRelativeToView.size());
</span><span class="cx">             if (!plugInRectRelativeToTopDocument.intersects(searchRect))
</span><span class="cx">                 continue;
</span></span></pre>
</div>
</div>

</body>
</html>