<!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>[192193] 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/192193">192193</a></dd>
<dt>Author</dt> <dd>wenson_hsieh@apple.com</dd>
<dt>Date</dt> <dd>2015-11-09 17:07:47 -0800 (Mon, 09 Nov 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Sometimes unable to scroll fixed div when the body is scrollable
https://bugs.webkit.org/show_bug.cgi?id=151015
&lt;rdar://problem/23445723&gt;

Reviewed by Simon Fraser.

Source/WebCore:

Currently, if we scroll a page containing a fixed scrollable area, the non-fast-scrollable region corresponding to a fixed
area will not move down to reflect its new bounds in absolute coordinates, making it impossible to scroll position: fixed
overflow elements when the body's scroll position changes. To fix this, we inflate the non-fast-scrollable region
corresponding to scrollable position: fixed elements such that their regions encompass the area, relative to the page,
wherein the fixed element may lie when the page is scrolled by any amount within its scroll limits.

We also optimize the non-fast-scrollable regions emitted by elements that handle wheel events. Currently, if a fixed element
also has a wheel event handler, we take the entire document's rect to be non-fast-scrollable. This patch changes this region
to behave the same way as fixed scrollable elements above.

This patch also folds some common logic used to accomplish this into FrameView for use by RenderLayerCompositor and RenderView.

Test: tiled-drawing/scrolling/non-fast-region/fixed-div-in-scrollable-page.html

* page/FrameView.cpp:
(WebCore::FrameView::fixedScrollableAreaBoundsInflatedForScrolling):
(WebCore::FrameView::scrollOffsetRespectingCustomFixedPosition):
* page/FrameView.h:
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::absoluteNonFastScrollableRegionForFrame):
* platform/ScrollableArea.h:
(WebCore::ScrollableArea::scrollableAreaBoundingBox):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollableAreaBoundingBox):
* rendering/RenderLayer.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::computeExtent):
(WebCore::fixedPositionOffset): Deleted.
* rendering/RenderView.cpp:
(WebCore::RenderView::mapLocalToContainer):
(WebCore::RenderView::pushMappingToContainer):
(WebCore::RenderView::mapAbsoluteToLocalPoint):
(WebCore::RenderView::computeRectForRepaint):
(WebCore::fixedPositionOffset): Deleted.

LayoutTests:

Adds a new test that scrolling a fixed div is possible when the page is scrolled. Also
changes some existing non-fast-scrollable region tests to match the new behavior for
computing non-fast-scrollable regions for fixed scrollable elements (see ChangeLog
entry in WebCore for more details).

* tiled-drawing/scrolling/non-fast-region/fixed-div-in-scrollable-page-expected.txt: Added.
* tiled-drawing/scrolling/non-fast-region/fixed-div-in-scrollable-page.html: Added.
* tiled-drawing/scrolling/non-fast-region/wheel-handler-fixed-child-expected.txt:
* tiled-drawing/scrolling/non-fast-region/wheel-handler-inside-fixed-expected.txt:
* tiled-drawing/scrolling/non-fast-region/wheel-handler-on-fixed-expected.txt:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTeststileddrawingscrollingnonfastregionwheelhandlerfixedchildexpectedtxt">trunk/LayoutTests/tiled-drawing/scrolling/non-fast-region/wheel-handler-fixed-child-expected.txt</a></li>
<li><a href="#trunkLayoutTeststileddrawingscrollingnonfastregionwheelhandlerinsidefixedexpectedtxt">trunk/LayoutTests/tiled-drawing/scrolling/non-fast-region/wheel-handler-inside-fixed-expected.txt</a></li>
<li><a href="#trunkLayoutTeststileddrawingscrollingnonfastregionwheelhandleronfixedexpectedtxt">trunk/LayoutTests/tiled-drawing/scrolling/non-fast-region/wheel-handler-on-fixed-expected.txt</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="#trunkSourceWebCorepagescrollingScrollingCoordinatorcpp">trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformScrollableAreah">trunk/Source/WebCore/platform/ScrollableArea.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayercpp">trunk/Source/WebCore/rendering/RenderLayer.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayerh">trunk/Source/WebCore/rendering/RenderLayer.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayerCompositorcpp">trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderListBoxcpp">trunk/Source/WebCore/rendering/RenderListBox.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderListBoxh">trunk/Source/WebCore/rendering/RenderListBox.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderViewcpp">trunk/Source/WebCore/rendering/RenderView.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessPluginsPDFDeprecatedPDFPluginh">trunk/Source/WebKit2/WebProcess/Plugins/PDF/DeprecatedPDFPlugin.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessPluginsPDFDeprecatedPDFPluginmm">trunk/Source/WebKit2/WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTeststileddrawingscrollingnonfastregionfixeddivinscrollablepageexpectedtxt">trunk/LayoutTests/tiled-drawing/scrolling/non-fast-region/fixed-div-in-scrollable-page-expected.txt</a></li>
<li><a href="#trunkLayoutTeststileddrawingscrollingnonfastregionfixeddivinscrollablepagehtml">trunk/LayoutTests/tiled-drawing/scrolling/non-fast-region/fixed-div-in-scrollable-page.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (192192 => 192193)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-11-10 00:55:28 UTC (rev 192192)
+++ trunk/LayoutTests/ChangeLog        2015-11-10 01:07:47 UTC (rev 192193)
</span><span class="lines">@@ -1,3 +1,22 @@
</span><ins>+2015-11-09  Wenson Hsieh  &lt;wenson_hsieh@apple.com&gt;
+
+        Sometimes unable to scroll fixed div when the body is scrollable
+        https://bugs.webkit.org/show_bug.cgi?id=151015
+        &lt;rdar://problem/23445723&gt;
+
+        Reviewed by Simon Fraser.
+
+        Adds a new test that scrolling a fixed div is possible when the page is scrolled. Also
+        changes some existing non-fast-scrollable region tests to match the new behavior for
+        computing non-fast-scrollable regions for fixed scrollable elements (see ChangeLog
+        entry in WebCore for more details).
+
+        * tiled-drawing/scrolling/non-fast-region/fixed-div-in-scrollable-page-expected.txt: Added.
+        * tiled-drawing/scrolling/non-fast-region/fixed-div-in-scrollable-page.html: Added.
+        * tiled-drawing/scrolling/non-fast-region/wheel-handler-fixed-child-expected.txt:
+        * tiled-drawing/scrolling/non-fast-region/wheel-handler-inside-fixed-expected.txt:
+        * tiled-drawing/scrolling/non-fast-region/wheel-handler-on-fixed-expected.txt:
+
</ins><span class="cx"> 2015-11-09  Ryan Haddad  &lt;ryanhaddad@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, rolling out r192181.
</span></span></pre></div>
<a id="trunkLayoutTeststileddrawingscrollingnonfastregionfixeddivinscrollablepageexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/tiled-drawing/scrolling/non-fast-region/fixed-div-in-scrollable-page-expected.txt (0 => 192193)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/tiled-drawing/scrolling/non-fast-region/fixed-div-in-scrollable-page-expected.txt                                (rev 0)
+++ trunk/LayoutTests/tiled-drawing/scrolling/non-fast-region/fixed-div-in-scrollable-page-expected.txt        2015-11-10 01:07:47 UTC (rev 192193)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+0, 0 - 1315, 1528
</ins></span></pre></div>
<a id="trunkLayoutTeststileddrawingscrollingnonfastregionfixeddivinscrollablepagehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/tiled-drawing/scrolling/non-fast-region/fixed-div-in-scrollable-page.html (0 => 192193)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/tiled-drawing/scrolling/non-fast-region/fixed-div-in-scrollable-page.html                                (rev 0)
+++ trunk/LayoutTests/tiled-drawing/scrolling/non-fast-region/fixed-div-in-scrollable-page.html        2015-11-10 01:07:47 UTC (rev 192193)
</span><span class="lines">@@ -0,0 +1,42 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+    &lt;script src=&quot;resources/wheel-handler-region-helper.js&quot;&gt;&lt;/script&gt;
+    &lt;style&gt;
+    body {
+        margin: 0;
+    }
+
+    .fixed {
+        background: #fff;
+        position: fixed;
+        width: 100px;
+        height: 100px;
+        overflow: scroll;
+    }
+
+    .tall {
+        height: 2000px;
+    }
+
+    .wide {
+        width: 2000px;
+    }
+    &lt;/style&gt;
+    &lt;script&gt;
+    function dumpRegion()
+    {
+        if (window.internals) {
+            var rects = window.internals.nonFastScrollableRects();
+            document.getElementById('output').textContent = rectsAsString(rects);
+        }
+    }
+    &lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;dumpRegion()&quot;&gt;
+    &lt;div class=&quot;fixed&quot;&gt;
+        &lt;div class=&quot;tall&quot;&gt;&lt;/div&gt;
+    &lt;/div&gt;
+    &lt;div class=&quot;tall wide&quot;&gt;&lt;/div&gt;
+    &lt;pre id=&quot;output&quot;&gt;&lt;/pre&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTeststileddrawingscrollingnonfastregionwheelhandlerfixedchildexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/tiled-drawing/scrolling/non-fast-region/wheel-handler-fixed-child-expected.txt (192192 => 192193)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/tiled-drawing/scrolling/non-fast-region/wheel-handler-fixed-child-expected.txt        2015-11-10 00:55:28 UTC (rev 192192)
+++ trunk/LayoutTests/tiled-drawing/scrolling/non-fast-region/wheel-handler-fixed-child-expected.txt        2015-11-10 01:07:47 UTC (rev 192193)
</span><span class="lines">@@ -1 +1 @@
</span><del>-0, 0 - 785, 628
</del><ins>+50, 50 - 150, 178
</ins></span></pre></div>
<a id="trunkLayoutTeststileddrawingscrollingnonfastregionwheelhandlerinsidefixedexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/tiled-drawing/scrolling/non-fast-region/wheel-handler-inside-fixed-expected.txt (192192 => 192193)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/tiled-drawing/scrolling/non-fast-region/wheel-handler-inside-fixed-expected.txt        2015-11-10 00:55:28 UTC (rev 192192)
+++ trunk/LayoutTests/tiled-drawing/scrolling/non-fast-region/wheel-handler-inside-fixed-expected.txt        2015-11-10 01:07:47 UTC (rev 192193)
</span><span class="lines">@@ -1 +1 @@
</span><del>-0, 0 - 800, 600
</del><ins>+60, 60 - 160, 160
</ins></span></pre></div>
<a id="trunkLayoutTeststileddrawingscrollingnonfastregionwheelhandleronfixedexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/tiled-drawing/scrolling/non-fast-region/wheel-handler-on-fixed-expected.txt (192192 => 192193)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/tiled-drawing/scrolling/non-fast-region/wheel-handler-on-fixed-expected.txt        2015-11-10 00:55:28 UTC (rev 192192)
+++ trunk/LayoutTests/tiled-drawing/scrolling/non-fast-region/wheel-handler-on-fixed-expected.txt        2015-11-10 01:07:47 UTC (rev 192193)
</span><span class="lines">@@ -1 +1 @@
</span><del>-0, 0 - 800, 600
</del><ins>+10, 10 - 110, 110
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (192192 => 192193)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-11-10 00:55:28 UTC (rev 192192)
+++ trunk/Source/WebCore/ChangeLog        2015-11-10 01:07:47 UTC (rev 192193)
</span><span class="lines">@@ -1,3 +1,46 @@
</span><ins>+2015-11-09  Wenson Hsieh  &lt;wenson_hsieh@apple.com&gt;
+
+        Sometimes unable to scroll fixed div when the body is scrollable
+        https://bugs.webkit.org/show_bug.cgi?id=151015
+        &lt;rdar://problem/23445723&gt;
+
+        Reviewed by Simon Fraser.
+
+        Currently, if we scroll a page containing a fixed scrollable area, the non-fast-scrollable region corresponding to a fixed
+        area will not move down to reflect its new bounds in absolute coordinates, making it impossible to scroll position: fixed
+        overflow elements when the body's scroll position changes. To fix this, we inflate the non-fast-scrollable region
+        corresponding to scrollable position: fixed elements such that their regions encompass the area, relative to the page,
+        wherein the fixed element may lie when the page is scrolled by any amount within its scroll limits.
+
+        We also optimize the non-fast-scrollable regions emitted by elements that handle wheel events. Currently, if a fixed element
+        also has a wheel event handler, we take the entire document's rect to be non-fast-scrollable. This patch changes this region
+        to behave the same way as fixed scrollable elements above.
+
+        This patch also folds some common logic used to accomplish this into FrameView for use by RenderLayerCompositor and RenderView.
+
+        Test: tiled-drawing/scrolling/non-fast-region/fixed-div-in-scrollable-page.html
+
+        * page/FrameView.cpp:
+        (WebCore::FrameView::fixedScrollableAreaBoundsInflatedForScrolling):
+        (WebCore::FrameView::scrollOffsetRespectingCustomFixedPosition):
+        * page/FrameView.h:
+        * page/scrolling/ScrollingCoordinator.cpp:
+        (WebCore::ScrollingCoordinator::absoluteNonFastScrollableRegionForFrame):
+        * platform/ScrollableArea.h:
+        (WebCore::ScrollableArea::scrollableAreaBoundingBox):
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::scrollableAreaBoundingBox):
+        * rendering/RenderLayer.h:
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::computeExtent):
+        (WebCore::fixedPositionOffset): Deleted.
+        * rendering/RenderView.cpp:
+        (WebCore::RenderView::mapLocalToContainer):
+        (WebCore::RenderView::pushMappingToContainer):
+        (WebCore::RenderView::mapAbsoluteToLocalPoint):
+        (WebCore::RenderView::computeRectForRepaint):
+        (WebCore::fixedPositionOffset): Deleted.
+
</ins><span class="cx"> 2015-11-09  Ryan Haddad  &lt;ryanhaddad@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, rolling out r192181.
</span></span></pre></div>
<a id="trunkSourceWebCorepageFrameViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/FrameView.cpp (192192 => 192193)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/FrameView.cpp        2015-11-10 00:55:28 UTC (rev 192192)
+++ trunk/Source/WebCore/page/FrameView.cpp        2015-11-10 01:07:47 UTC (rev 192193)
</span><span class="lines">@@ -1076,6 +1076,25 @@
</span><span class="cx">     view-&gt;compositor().scheduleLayerFlush(true /* canThrottle */);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+LayoutRect FrameView::fixedScrollableAreaBoundsInflatedForScrolling(const LayoutRect&amp; uninflatedBounds) const
+{
+    LayoutSize scrollPosition = scrollOffsetRespectingCustomFixedPosition();
+
+    LayoutSize topLeftExpansion = scrollPosition - toLayoutSize(minimumScrollPosition());
+    LayoutSize bottomRightExpansion = toLayoutSize(maximumScrollPosition()) - scrollPosition;
+
+    return LayoutRect(uninflatedBounds.location() - topLeftExpansion, uninflatedBounds.size() + topLeftExpansion + bottomRightExpansion);
+}
+
+LayoutSize FrameView::scrollOffsetRespectingCustomFixedPosition() const
+{
+#if PLATFORM(IOS)
+    return useCustomFixedPositionLayoutRect() ? customFixedPositionLayoutRect().location() - LayoutPoint() : scrollOffset();
+#else
+    return scrollOffsetForFixedPosition();
+#endif
+}
+
</ins><span class="cx"> void FrameView::setHeaderHeight(int headerHeight)
</span><span class="cx"> {
</span><span class="cx">     if (frame().page())
</span><span class="lines">@@ -3543,7 +3562,7 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-IntRect FrameView::scrollableAreaBoundingBox() const
</del><ins>+IntRect FrameView::scrollableAreaBoundingBox(bool*) const
</ins><span class="cx"> {
</span><span class="cx">     RenderWidget* ownerRenderer = frame().ownerRenderer();
</span><span class="cx">     if (!ownerRenderer)
</span></span></pre></div>
<a id="trunkSourceWebCorepageFrameViewh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/FrameView.h (192192 => 192193)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/FrameView.h        2015-11-10 00:55:28 UTC (rev 192192)
+++ trunk/Source/WebCore/page/FrameView.h        2015-11-10 01:07:47 UTC (rev 192193)
</span><span class="lines">@@ -495,6 +495,9 @@
</span><span class="cx">     WEBCORE_EXPORT GraphicsLayer* setWantsLayerForBottomOverHangArea(bool) const;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+    LayoutRect fixedScrollableAreaBoundsInflatedForScrolling(const LayoutRect&amp; uninflatedBounds) const;
+    LayoutSize scrollOffsetRespectingCustomFixedPosition() const;
+
</ins><span class="cx">     virtual int headerHeight() const override { return m_headerHeight; }
</span><span class="cx">     WEBCORE_EXPORT void setHeaderHeight(int);
</span><span class="cx">     virtual int footerHeight() const override { return m_footerHeight; }
</span><span class="lines">@@ -624,7 +627,7 @@
</span><span class="cx">     virtual void scrollTo(const IntSize&amp;) override;
</span><span class="cx">     virtual void setVisibleScrollerThumbRect(const IntRect&amp;) override;
</span><span class="cx">     virtual ScrollableArea* enclosingScrollableArea() const override;
</span><del>-    virtual IntRect scrollableAreaBoundingBox() const override;
</del><ins>+    virtual IntRect scrollableAreaBoundingBox(bool* = nullptr) const override;
</ins><span class="cx">     virtual bool scrollAnimatorEnabled() const override;
</span><span class="cx">     virtual GraphicsLayer* layerForScrolling() const override;
</span><span class="cx">     virtual GraphicsLayer* layerForHorizontalScrollbar() const override;
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingScrollingCoordinatorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp (192192 => 192193)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp        2015-11-10 00:55:28 UTC (rev 192192)
+++ trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp        2015-11-10 01:07:47 UTC (rev 192193)
</span><span class="lines">@@ -134,7 +134,11 @@
</span><span class="cx">             if (scrollableArea-&gt;usesAsyncScrolling())
</span><span class="cx">                 continue;
</span><span class="cx"> 
</span><del>-            IntRect box = scrollableArea-&gt;scrollableAreaBoundingBox();
</del><ins>+            bool isInsideFixed;
+            IntRect box = scrollableArea-&gt;scrollableAreaBoundingBox(&amp;isInsideFixed);
+            if (isInsideFixed)
+                box = IntRect(frameView-&gt;fixedScrollableAreaBoundsInflatedForScrolling(LayoutRect(box)));
+
</ins><span class="cx">             nonFastScrollableRegion.unite(box);
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -168,11 +172,9 @@
</span><span class="cx">     Document::RegionFixedPair wheelHandlerRegion = frame.document()-&gt;absoluteRegionForEventTargets(frame.document()-&gt;wheelEventTargets());
</span><span class="cx">     bool wheelHandlerInFixedContent = wheelHandlerRegion.second;
</span><span class="cx">     if (wheelHandlerInFixedContent) {
</span><del>-        // FIXME: if a fixed element has a wheel event handler, for now just cover the entire document
-        // with the slow-scrolling region. This could be improved.
</del><span class="cx">         // FIXME: need to handle position:sticky here too.
</span><del>-        bool inFixed;
-        wheelHandlerRegion.first.unite(enclosingIntRect(frame.document()-&gt;absoluteEventHandlerBounds(inFixed)));
</del><ins>+        LayoutRect inflatedWheelHandlerBounds = frameView-&gt;fixedScrollableAreaBoundsInflatedForScrolling(LayoutRect(wheelHandlerRegion.first.bounds()));
+        wheelHandlerRegion.first.unite(enclosingIntRect(inflatedWheelHandlerBounds));
</ins><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     nonFastScrollableRegion.unite(wheelHandlerRegion.first);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformScrollableAreah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ScrollableArea.h (192192 => 192193)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ScrollableArea.h        2015-11-10 00:55:28 UTC (rev 192192)
+++ trunk/Source/WebCore/platform/ScrollableArea.h        2015-11-10 01:07:47 UTC (rev 192193)
</span><span class="lines">@@ -228,7 +228,7 @@
</span><span class="cx">     virtual bool hasScrollableOrRubberbandableAncestor() = 0;
</span><span class="cx"> 
</span><span class="cx">     // Returns the bounding box of this scrollable area, in the coordinate system of the enclosing scroll view.
</span><del>-    virtual IntRect scrollableAreaBoundingBox() const = 0;
</del><ins>+    virtual IntRect scrollableAreaBoundingBox(bool* = nullptr) const = 0;
</ins><span class="cx"> 
</span><span class="cx">     virtual bool isRubberBandInProgress() const { return false; }
</span><span class="cx">     virtual bool isScrollSnapInProgress() const { return false; }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (192192 => 192193)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayer.cpp        2015-11-10 00:55:28 UTC (rev 192192)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp        2015-11-10 01:07:47 UTC (rev 192193)
</span><span class="lines">@@ -1486,9 +1486,9 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-IntRect RenderLayer::scrollableAreaBoundingBox() const
</del><ins>+IntRect RenderLayer::scrollableAreaBoundingBox(bool* isInsideFixed) const
</ins><span class="cx"> {
</span><del>-    return renderer().absoluteBoundingBoxRect();
</del><ins>+    return renderer().absoluteBoundingBoxRect(/* useTransforms */ true, isInsideFixed);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool RenderLayer::isRubberBandInProgress() const
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayer.h (192192 => 192193)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayer.h        2015-11-10 00:55:28 UTC (rev 192192)
+++ trunk/Source/WebCore/rendering/RenderLayer.h        2015-11-10 01:07:47 UTC (rev 192193)
</span><span class="lines">@@ -874,7 +874,7 @@
</span><span class="cx">     virtual IntPoint lastKnownMousePosition() const override;
</span><span class="cx">     virtual bool isHandlingWheelEvent() const override;
</span><span class="cx">     virtual bool shouldSuspendScrollAnimations() const override;
</span><del>-    virtual IntRect scrollableAreaBoundingBox() const override;
</del><ins>+    virtual IntRect scrollableAreaBoundingBox(bool* isInsideFixed = nullptr) const override;
</ins><span class="cx">     virtual bool isRubberBandInProgress() const override;
</span><span class="cx">     virtual bool updatesScrollLayerPositionOnMainThread() const override { return true; }
</span><span class="cx">     virtual bool forceUpdateScrollbarsOnMainThreadForPerformanceTesting() const override;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayerCompositorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp (192192 => 192193)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp        2015-11-10 00:55:28 UTC (rev 192192)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp        2015-11-10 01:07:47 UTC (rev 192193)
</span><span class="lines">@@ -1185,14 +1185,6 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if PLATFORM(IOS)
-// FIXME: Share with RenderView.
-static inline LayoutSize fixedPositionOffset(const FrameView&amp; frameView)
-{
-    return frameView.useCustomFixedPositionLayoutRect() ? (frameView.customFixedPositionLayoutRect().location() - LayoutPoint()) : frameView.scrollOffset();
-}
-#endif
-
</del><span class="cx"> void RenderLayerCompositor::computeExtent(const OverlapMap&amp; overlapMap, const RenderLayer&amp; layer, OverlapExtent&amp; extent) const
</span><span class="cx"> {
</span><span class="cx">     if (extent.extentComputed)
</span><span class="lines">@@ -1224,20 +1216,7 @@
</span><span class="cx">         else
</span><span class="cx">             viewportRect = m_renderView.frameView().viewportConstrainedVisibleContentRect();
</span><span class="cx"> 
</span><del>-#if PLATFORM(IOS)
-        LayoutSize scrollPosition = fixedPositionOffset(m_renderView.frameView());
-#else
-        LayoutSize scrollPosition = m_renderView.frameView().scrollOffsetForFixedPosition();
-#endif
-
-        LayoutPoint minimumScrollPosition = m_renderView.frameView().minimumScrollPosition();
-        LayoutPoint maximumScrollPosition = m_renderView.frameView().maximumScrollPosition();
-        
-        LayoutSize topLeftExpansion = scrollPosition - toLayoutSize(minimumScrollPosition);
-        LayoutSize bottomRightExpansion = toLayoutSize(maximumScrollPosition) - scrollPosition;
-
-        extent.bounds.setLocation(extent.bounds.location() - topLeftExpansion);
-        extent.bounds.setSize(extent.bounds.size() + topLeftExpansion + bottomRightExpansion);
</del><ins>+        extent.bounds = m_renderView.frameView().fixedScrollableAreaBoundsInflatedForScrolling(extent.bounds);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     extent.extentComputed = true;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderListBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderListBox.cpp (192192 => 192193)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderListBox.cpp        2015-11-10 00:55:28 UTC (rev 192192)
+++ trunk/Source/WebCore/rendering/RenderListBox.cpp        2015-11-10 01:07:47 UTC (rev 192193)
</span><span class="lines">@@ -803,7 +803,7 @@
</span><span class="cx">     return enclosingLayer() &amp;&amp; enclosingLayer()-&gt;hasScrollableOrRubberbandableAncestor();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-IntRect RenderListBox::scrollableAreaBoundingBox() const
</del><ins>+IntRect RenderListBox::scrollableAreaBoundingBox(bool*) const
</ins><span class="cx"> {
</span><span class="cx">     return absoluteBoundingBoxRect();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderListBoxh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderListBox.h (192192 => 192193)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderListBox.h        2015-11-10 00:55:28 UTC (rev 192192)
+++ trunk/Source/WebCore/rendering/RenderListBox.h        2015-11-10 01:07:47 UTC (rev 192193)
</span><span class="lines">@@ -133,7 +133,7 @@
</span><span class="cx">     virtual ScrollableArea* enclosingScrollableArea() const override;
</span><span class="cx">     virtual bool isScrollableOrRubberbandable() override;
</span><span class="cx">     virtual bool hasScrollableOrRubberbandableAncestor() override;
</span><del>-    virtual IntRect scrollableAreaBoundingBox() const override;
</del><ins>+    virtual IntRect scrollableAreaBoundingBox(bool* = nullptr) const override;
</ins><span class="cx"> 
</span><span class="cx">     // NOTE: This should only be called by the overriden setScrollOffset from ScrollableArea.
</span><span class="cx">     void scrollTo(int newOffset);
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderView.cpp (192192 => 192193)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderView.cpp        2015-11-10 00:55:28 UTC (rev 192192)
+++ trunk/Source/WebCore/rendering/RenderView.cpp        2015-11-10 01:07:47 UTC (rev 192193)
</span><span class="lines">@@ -427,13 +427,6 @@
</span><span class="cx">     return clientLogicalHeight();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if PLATFORM(IOS)
-static inline LayoutSize fixedPositionOffset(const FrameView&amp; frameView)
-{
-    return frameView.useCustomFixedPositionLayoutRect() ? (frameView.customFixedPositionLayoutRect().location() - LayoutPoint()) : frameView.scrollOffset();
-}
-#endif
-
</del><span class="cx"> void RenderView::mapLocalToContainer(const RenderLayerModelObject* repaintContainer, TransformState&amp; transformState, MapCoordinatesFlags mode, bool* wasFixed) const
</span><span class="cx"> {
</span><span class="cx">     // If a container was specified, and was not nullptr or the RenderView,
</span><span class="lines">@@ -448,11 +441,7 @@
</span><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     if (mode &amp; IsFixed)
</span><del>-#if PLATFORM(IOS)
-        transformState.move(fixedPositionOffset(m_frameView));
-#else
-        transformState.move(frameView().scrollOffsetForFixedPosition());
-#endif
</del><ins>+        transformState.move(frameView().scrollOffsetRespectingCustomFixedPosition());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> const RenderObject* RenderView::pushMappingToContainer(const RenderLayerModelObject* ancestorToStopAt, RenderGeometryMap&amp; geometryMap) const
</span><span class="lines">@@ -461,11 +450,7 @@
</span><span class="cx">     // then we should have found it by now.
</span><span class="cx">     ASSERT_ARG(ancestorToStopAt, !ancestorToStopAt || ancestorToStopAt == this);
</span><span class="cx"> 
</span><del>-#if PLATFORM(IOS)
-    LayoutSize scrollOffset = fixedPositionOffset(frameView());
-#else
-    LayoutSize scrollOffset = frameView().scrollOffsetForFixedPosition();
-#endif
</del><ins>+    LayoutSize scrollOffset = frameView().scrollOffsetRespectingCustomFixedPosition();
</ins><span class="cx"> 
</span><span class="cx">     if (!ancestorToStopAt &amp;&amp; shouldUseTransformFromContainer(nullptr)) {
</span><span class="cx">         TransformationMatrix t;
</span><span class="lines">@@ -480,11 +465,7 @@
</span><span class="cx"> void RenderView::mapAbsoluteToLocalPoint(MapCoordinatesFlags mode, TransformState&amp; transformState) const
</span><span class="cx"> {
</span><span class="cx">     if (mode &amp; IsFixed)
</span><del>-#if PLATFORM(IOS)
-        transformState.move(fixedPositionOffset(frameView()));
-#else
-        transformState.move(frameView().scrollOffsetForFixedPosition());
-#endif
</del><ins>+        transformState.move(frameView().scrollOffsetRespectingCustomFixedPosition());
</ins><span class="cx"> 
</span><span class="cx">     if (mode &amp; UseTransforms &amp;&amp; shouldUseTransformFromContainer(nullptr)) {
</span><span class="cx">         TransformationMatrix t;
</span><span class="lines">@@ -716,11 +697,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (fixed) {
</span><del>-#if PLATFORM(IOS)
-        adjustedRect.move(fixedPositionOffset(frameView()));
-#else
-        adjustedRect.move(frameView().scrollOffsetForFixedPosition());
-#endif
</del><ins>+        adjustedRect.move(frameView().scrollOffsetRespectingCustomFixedPosition());
</ins><span class="cx">     }
</span><span class="cx">         
</span><span class="cx">     // Apply our transform if we have one (because of full page zooming).
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessPluginsPDFDeprecatedPDFPluginh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Plugins/PDF/DeprecatedPDFPlugin.h (192192 => 192193)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Plugins/PDF/DeprecatedPDFPlugin.h        2015-11-10 00:55:28 UTC (rev 192192)
+++ trunk/Source/WebKit2/WebProcess/Plugins/PDF/DeprecatedPDFPlugin.h        2015-11-10 01:07:47 UTC (rev 192193)
</span><span class="lines">@@ -188,7 +188,7 @@
</span><span class="cx">     virtual WebCore::ScrollableArea* enclosingScrollableArea() const override;
</span><span class="cx">     virtual bool isScrollableOrRubberbandable() override { return true; }
</span><span class="cx">     virtual bool hasScrollableOrRubberbandableAncestor() override { return true; }
</span><del>-    virtual WebCore::IntRect scrollableAreaBoundingBox() const override;
</del><ins>+    virtual WebCore::IntRect scrollableAreaBoundingBox(bool* = nullptr) const override;
</ins><span class="cx">     virtual void setScrollOffset(const WebCore::IntPoint&amp;) override;
</span><span class="cx">     virtual void invalidateScrollbarRect(WebCore::Scrollbar*, const WebCore::IntRect&amp;) override;
</span><span class="cx">     virtual void invalidateScrollCornerRect(const WebCore::IntRect&amp;) override;
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessPluginsPDFDeprecatedPDFPluginmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm (192192 => 192193)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm        2015-11-10 00:55:28 UTC (rev 192192)
+++ trunk/Source/WebKit2/WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm        2015-11-10 01:07:47 UTC (rev 192193)
</span><span class="lines">@@ -743,7 +743,7 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-IntRect PDFPlugin::scrollableAreaBoundingBox() const
</del><ins>+IntRect PDFPlugin::scrollableAreaBoundingBox(bool*) const
</ins><span class="cx"> {
</span><span class="cx">     return pluginView()-&gt;frameRect();
</span><span class="cx"> }
</span></span></pre>
</div>
</div>

</body>
</html>