<!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>[195445] 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/195445">195445</a></dd>
<dt>Author</dt> <dd>simon.fraser@apple.com</dd>
<dt>Date</dt> <dd>2016-01-21 22:45:05 -0800 (Thu, 21 Jan 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>REGRESSION (<a href="http://trac.webkit.org/projects/webkit/changeset/168244">r168244</a>): Content in horizontal-bt page is offset such that only the end is viewable and there is a white gap at the top
https://bugs.webkit.org/show_bug.cgi?id=136019

Reviewed by Dan Bernstein.

Source/WebCore:

In horizontal-bt documents (where the page starts scrolled to the bottom, and scrolling up goes into negative scroll positions),
the position of the root content layer would be set incorrectly by the scrolling thread, resulting in misplaced
content.

Fix by having the renamed &quot;yPositionForRootContentLayer&quot; take scroll origin into
account, and being more consistent about using scrollOrigin to position this layer.

Test: fast/scrolling/programmatic-horizontal-bt-document-scroll.html

* page/FrameView.cpp:
(WebCore::FrameView::yPositionForFooterLayer): Moved
(WebCore::FrameView::positionForRootContentLayer): Take scrollOrigin, and subtract it from the computed value.
(WebCore::FrameView::yPositionForRootContentLayer): Renamed.
* page/FrameView.h:
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll): We've already pushed the new scrollPosition onto the FrameView,
so we can just use the member function to compute the positionForContentsLayer.
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition): This is the bug fix; FrameView::positionForRootContentLayer()
now takes scrollOrigin into account.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateRootLayerPosition): Rather than using the documentRect, position the root content layer
in terms of the scroll origin (which is -documentRect.location()).

Source/WebKit2:

Now call frameView.positionForRootContentLayer(), and add a FIXME questioning the
behavior in horizontal b-t documents. However, this code isn't hit now that we always
do extended backgrounds, so never have shadow layers.

* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::shadowLayerPositionForFrame):

LayoutTests:

Test that scrolls a horizontal-bt document.

* fast/scrolling/programmatic-horizontal-bt-document-scroll-expected.html: Added.
* fast/scrolling/programmatic-horizontal-bt-document-scroll.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</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="#trunkSourceWebCorepagescrollingAsyncScrollingCoordinatorcpp">trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp</a></li>
<li><a href="#trunkSourceWebCorepagescrollingmacScrollingTreeFrameScrollingNodeMacmm">trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayerCompositorcpp">trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPagemacTiledCoreAnimationDrawingAreamm">trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastscrollingprogrammatichorizontalbtdocumentscrollexpectedhtml">trunk/LayoutTests/fast/scrolling/programmatic-horizontal-bt-document-scroll-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastscrollingprogrammatichorizontalbtdocumentscrollhtml">trunk/LayoutTests/fast/scrolling/programmatic-horizontal-bt-document-scroll.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (195444 => 195445)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-01-22 06:44:52 UTC (rev 195444)
+++ trunk/LayoutTests/ChangeLog        2016-01-22 06:45:05 UTC (rev 195445)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2016-01-21  Simon Fraser  &lt;simon.fraser@apple.com&gt;
+
+        REGRESSION (r168244): Content in horizontal-bt page is offset such that only the end is viewable and there is a white gap at the top
+        https://bugs.webkit.org/show_bug.cgi?id=136019
+
+        Reviewed by Dan Bernstein.
+
+        Test that scrolls a horizontal-bt document.
+
+        * fast/scrolling/programmatic-horizontal-bt-document-scroll-expected.html: Added.
+        * fast/scrolling/programmatic-horizontal-bt-document-scroll.html: Added.
+
</ins><span class="cx"> 2016-01-21  Brady Eidson  &lt;beidson@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Modern IDB: Support populating/extracting database metadata with SQLite backend.
</span></span></pre></div>
<a id="trunkLayoutTestsfastscrollingprogrammatichorizontalbtdocumentscrollexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/scrolling/programmatic-horizontal-bt-document-scroll-expected.html (0 => 195445)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/scrolling/programmatic-horizontal-bt-document-scroll-expected.html                                (rev 0)
+++ trunk/LayoutTests/fast/scrolling/programmatic-horizontal-bt-document-scroll-expected.html        2016-01-22 06:45:05 UTC (rev 195445)
</span><span class="lines">@@ -0,0 +1,32 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        body {
+            margin: 0;
+            height: 1100px;
+        }
+        .origin {
+            position: absolute;
+            top: 500px;
+            left: 0;
+            width: 10px;
+            height: 10px;
+            background-color: blue;
+        }
+        
+        #indicator {
+            position: absolute;
+            left: 0;
+            top: 0;
+            width: 100px;
+            height: 100px;
+            background-color: green;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;div class=&quot;origin&quot;&gt;&lt;/div&gt;
+    &lt;div id=&quot;indicator&quot;&gt;&lt;/div&gt;
+    &lt;div id=&quot;result&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastscrollingprogrammatichorizontalbtdocumentscrollhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/scrolling/programmatic-horizontal-bt-document-scroll.html (0 => 195445)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/scrolling/programmatic-horizontal-bt-document-scroll.html                                (rev 0)
+++ trunk/LayoutTests/fast/scrolling/programmatic-horizontal-bt-document-scroll.html        2016-01-22 06:45:05 UTC (rev 195445)
</span><span class="lines">@@ -0,0 +1,39 @@
</span><ins>+&lt;html style=&quot;-webkit-writing-mode: horizontal-bt;&quot;&gt;
+&lt;head&gt;
+    &lt;style&gt;
+        body {
+            margin: 0;
+        }
+        .origin {
+            position: absolute;
+            top: 0;
+            left: 0;
+            width: 10px;
+            height: 10px;
+            background-color: blue;
+        }
+        
+        #indicator {
+            position: absolute;
+            left: 0;
+            top: -500px;
+            width: 100px;
+            height: 100px;
+            background-color: green;
+        }
+    &lt;/style&gt;
+    &lt;script&gt;
+    function runTest()
+    {
+        document.scrollingElement.scrollTop = -500;
+    }
+    
+    window.addEventListener('load', runTest, false);
+    &lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;div class=&quot;origin&quot;&gt;&lt;/div&gt;
+    &lt;div id=&quot;indicator&quot;&gt;&lt;/div&gt;
+    &lt;div id=&quot;result&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (195444 => 195445)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-01-22 06:44:52 UTC (rev 195444)
+++ trunk/Source/WebCore/ChangeLog        2016-01-22 06:45:05 UTC (rev 195445)
</span><span class="lines">@@ -1,3 +1,34 @@
</span><ins>+2016-01-21  Simon Fraser  &lt;simon.fraser@apple.com&gt;
+
+        REGRESSION (r168244): Content in horizontal-bt page is offset such that only the end is viewable and there is a white gap at the top
+        https://bugs.webkit.org/show_bug.cgi?id=136019
+
+        Reviewed by Dan Bernstein.
+
+        In horizontal-bt documents (where the page starts scrolled to the bottom, and scrolling up goes into negative scroll positions),
+        the position of the root content layer would be set incorrectly by the scrolling thread, resulting in misplaced
+        content.
+
+        Fix by having the renamed &quot;yPositionForRootContentLayer&quot; take scroll origin into
+        account, and being more consistent about using scrollOrigin to position this layer.
+
+        Test: fast/scrolling/programmatic-horizontal-bt-document-scroll.html
+
+        * page/FrameView.cpp:
+        (WebCore::FrameView::yPositionForFooterLayer): Moved
+        (WebCore::FrameView::positionForRootContentLayer): Take scrollOrigin, and subtract it from the computed value.
+        (WebCore::FrameView::yPositionForRootContentLayer): Renamed.
+        * page/FrameView.h:
+        * page/scrolling/AsyncScrollingCoordinator.cpp:
+        (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll): We've already pushed the new scrollPosition onto the FrameView,
+        so we can just use the member function to compute the positionForContentsLayer.
+        * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
+        (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition): This is the bug fix; FrameView::positionForRootContentLayer()
+        now takes scrollOrigin into account.
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::updateRootLayerPosition): Rather than using the documentRect, position the root content layer
+        in terms of the scroll origin (which is -documentRect.location()).
+
</ins><span class="cx"> 2016-01-21  Brady Eidson  &lt;beidson@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Modern IDB: Support populating/extracting database metadata with SQLite backend.
</span></span></pre></div>
<a id="trunkSourceWebCorepageFrameViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/FrameView.cpp (195444 => 195445)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/FrameView.cpp        2016-01-22 06:44:52 UTC (rev 195444)
+++ trunk/Source/WebCore/page/FrameView.cpp        2016-01-22 06:45:05 UTC (rev 195445)
</span><span class="lines">@@ -1766,19 +1766,19 @@
</span><span class="cx">     return scrollY;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-float FrameView::yPositionForRootContentLayer(const FloatPoint&amp; scrollPosition, float topContentInset, float headerHeight)
</del><ins>+float FrameView::yPositionForFooterLayer(const FloatPoint&amp; scrollPosition, float topContentInset, float totalContentsHeight, float footerHeight)
</ins><span class="cx"> {
</span><del>-    return yPositionForHeaderLayer(scrollPosition, topContentInset) + headerHeight;
</del><ins>+    return yPositionForHeaderLayer(scrollPosition, topContentInset) + totalContentsHeight - footerHeight;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-float FrameView::yPositionForFooterLayer(const FloatPoint&amp; scrollPosition, float topContentInset, float totalContentsHeight, float footerHeight)
</del><ins>+FloatPoint FrameView::positionForRootContentLayer(const FloatPoint&amp; scrollPosition, const FloatPoint&amp; scrollOrigin, float topContentInset, float headerHeight)
</ins><span class="cx"> {
</span><del>-    return yPositionForHeaderLayer(scrollPosition, topContentInset) + totalContentsHeight - footerHeight;
</del><ins>+    return FloatPoint(0, yPositionForHeaderLayer(scrollPosition, topContentInset) + headerHeight) - toFloatSize(scrollOrigin);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-float FrameView::yPositionForRootContentLayer() const
</del><ins>+FloatPoint FrameView::positionForRootContentLayer() const
</ins><span class="cx"> {
</span><del>-    return yPositionForRootContentLayer(scrollPosition(), topContentInset(), headerHeight());
</del><ins>+    return positionForRootContentLayer(scrollPosition(), scrollOrigin(), topContentInset(), headerHeight());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span></span></pre></div>
<a id="trunkSourceWebCorepageFrameViewh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/FrameView.h (195444 => 195445)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/FrameView.h        2016-01-22 06:44:52 UTC (rev 195444)
+++ trunk/Source/WebCore/page/FrameView.h        2016-01-22 06:45:05 UTC (rev 195445)
</span><span class="lines">@@ -287,8 +287,8 @@
</span><span class="cx">     // These layers are positioned differently when there is a topContentInset, a header, or a footer. These value need to be computed
</span><span class="cx">     // on both the main thread and the scrolling thread.
</span><span class="cx">     static float yPositionForInsetClipLayer(const FloatPoint&amp; scrollPosition, float topContentInset);
</span><del>-    WEBCORE_EXPORT static float yPositionForRootContentLayer(const FloatPoint&amp; scrollPosition, float topContentInset, float headerHeight);
-    WEBCORE_EXPORT float yPositionForRootContentLayer() const;
</del><ins>+    WEBCORE_EXPORT static FloatPoint positionForRootContentLayer(const FloatPoint&amp; scrollPosition, const FloatPoint&amp; scrollOrigin, float topContentInset, float headerHeight);
+    WEBCORE_EXPORT FloatPoint positionForRootContentLayer() const;
</ins><span class="cx"> 
</span><span class="cx">     static float yPositionForHeaderLayer(const FloatPoint&amp; scrollPosition, float topContentInset);
</span><span class="cx">     static float yPositionForFooterLayer(const FloatPoint&amp; scrollPosition, float topContentInset, float totalContentsHeight, float footerHeight);
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingAsyncScrollingCoordinatorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp (195444 => 195445)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp        2016-01-22 06:44:52 UTC (rev 195444)
+++ trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp        2016-01-22 06:45:05 UTC (rev 195445)
</span><span class="lines">@@ -323,8 +323,7 @@
</span><span class="cx"> 
</span><span class="cx">             float topContentInset = frameView.topContentInset();
</span><span class="cx">             FloatPoint positionForInsetClipLayer = FloatPoint(0, FrameView::yPositionForInsetClipLayer(scrollPosition, topContentInset));
</span><del>-            FloatPoint positionForContentsLayer = FloatPoint(scrolledContentsLayer-&gt;position().x(),
-                FrameView::yPositionForRootContentLayer(scrollPosition, topContentInset, frameView.headerHeight()));
</del><ins>+            FloatPoint positionForContentsLayer = frameView.positionForRootContentLayer();
</ins><span class="cx">             FloatPoint positionForHeaderLayer = FloatPoint(scrollPositionForFixed.x(), FrameView::yPositionForHeaderLayer(scrollPosition, topContentInset));
</span><span class="cx">             FloatPoint positionForFooterLayer = FloatPoint(scrollPositionForFixed.x(),
</span><span class="cx">                 FrameView::yPositionForFooterLayer(scrollPosition, topContentInset, frameView.totalContentsSize().height(), frameView.footerHeight()));
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingmacScrollingTreeFrameScrollingNodeMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm (195444 => 195445)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm        2016-01-22 06:44:52 UTC (rev 195444)
+++ trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm        2016-01-22 06:45:05 UTC (rev 195445)
</span><span class="lines">@@ -404,8 +404,7 @@
</span><span class="cx">     float topContentInset = this-&gt;topContentInset();
</span><span class="cx">     if (m_insetClipLayer &amp;&amp; m_scrolledContentsLayer &amp;&amp; topContentInset) {
</span><span class="cx">         m_insetClipLayer.get().position = FloatPoint(0, FrameView::yPositionForInsetClipLayer(position, topContentInset));
</span><del>-        m_scrolledContentsLayer.get().position = FloatPoint(m_scrolledContentsLayer.get().position.x,
-            FrameView::yPositionForRootContentLayer(position, topContentInset, headerHeight()));
</del><ins>+        m_scrolledContentsLayer.get().position = FrameView::positionForRootContentLayer(position, scrollOrigin(), topContentInset, headerHeight());
</ins><span class="cx">         if (m_contentShadowLayer)
</span><span class="cx">             m_contentShadowLayer.get().position = m_scrolledContentsLayer.get().position;
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayerCompositorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp (195444 => 195445)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp        2016-01-22 06:44:52 UTC (rev 195444)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp        2016-01-22 06:45:05 UTC (rev 195445)
</span><span class="lines">@@ -2121,9 +2121,8 @@
</span><span class="cx"> void RenderLayerCompositor::updateRootLayerPosition()
</span><span class="cx"> {
</span><span class="cx">     if (m_rootContentLayer) {
</span><del>-        const IntRect&amp; documentRect = m_renderView.documentRect();
-        m_rootContentLayer-&gt;setSize(documentRect.size());        
-        m_rootContentLayer-&gt;setPosition(FloatPoint(documentRect.x(), documentRect.y() + m_renderView.frameView().yPositionForRootContentLayer()));
</del><ins>+        m_rootContentLayer-&gt;setSize(m_renderView.frameView().contentsSize());
+        m_rootContentLayer-&gt;setPosition(m_renderView.frameView().positionForRootContentLayer());
</ins><span class="cx">         m_rootContentLayer-&gt;setAnchorPoint(FloatPoint3D());
</span><span class="cx">     }
</span><span class="cx">     if (m_clipLayer) {
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (195444 => 195445)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-01-22 06:44:52 UTC (rev 195444)
+++ trunk/Source/WebKit2/ChangeLog        2016-01-22 06:45:05 UTC (rev 195445)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2016-01-21  Simon Fraser  &lt;simon.fraser@apple.com&gt;
+
+        REGRESSION (r168244): Content in horizontal-bt page is offset such that only the end is viewable and there is a white gap at the top
+        https://bugs.webkit.org/show_bug.cgi?id=136019
+
+        Reviewed by Dan Bernstein.
+
+        Now call frameView.positionForRootContentLayer(), and add a FIXME questioning the
+        behavior in horizontal b-t documents. However, this code isn't hit now that we always
+        do extended backgrounds, so never have shadow layers.
+
+        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
+        (WebKit::shadowLayerPositionForFrame):
+
</ins><span class="cx"> 2016-01-21  Dean Jackson  &lt;dino@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Move _allowsDoubleTapGestures implementation out of category
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagemacTiledCoreAnimationDrawingAreamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm (195444 => 195445)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm        2016-01-22 06:44:52 UTC (rev 195444)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm        2016-01-22 06:45:05 UTC (rev 195445)
</span><span class="lines">@@ -693,7 +693,8 @@
</span><span class="cx">     
</span><span class="cx"> static FloatPoint shadowLayerPositionForFrame(FrameView&amp; frameView, FloatPoint origin)
</span><span class="cx"> {
</span><del>-    FloatPoint position = frameView.renderView()-&gt;documentRect().location() + FloatPoint(0, frameView.yPositionForRootContentLayer());
</del><ins>+    // FIXME: correct for b-t documents?
+    FloatPoint position = frameView.positionForRootContentLayer();
</ins><span class="cx">     return position + origin.expandedTo(FloatPoint());
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>