<!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>[173014] 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/173014">173014</a></dd>
<dt>Author</dt> <dd>bdakin@apple.com</dd>
<dt>Date</dt> <dd>2014-08-27 12:53:31 -0700 (Wed, 27 Aug 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>overflow:scroll elements should not latch to the body if the body is 
overflow:hidden
https://bugs.webkit.org/show_bug.cgi?id=136273

Reviewed by Darin Adler.

Source/WebCore:

This patch adds an optional parameter to isScrollable(). The Scrollability 
parameter that allows the caller to define what they mean by 'scrollable.' Most 
callers are interested in the default value, Scrollability::Scrollable, which 
means that there is actually content to scroll to, and a scrollbar that will allow 
you to access it. In some cases, such as this latching case, callers want to know 
if the FrameView is allowed to rubber-band, which the main frame might be allowed 
to do even if there is no content to scroll to. In that case, callers use 
Scrollability::ScrollableOrRubberbandable.
* page/FrameView.cpp:
(WebCore::FrameView::isScrollable):
(WebCore::FrameView::hasScrollableOrRubberbandableAncestor):

New virtual function on ScrollableArea answers whether a ScrollableArea has any 
scrollable or rubber-bandable ancestor.
* page/FrameView.h:
* platform/ScrollableArea.h:

Events should only be allowed to prevent stretching if there is some ancestor 
ScrollableArea that will be able to make use of the event. 
* platform/mac/ScrollAnimatorMac.mm:
(WebCore::ScrollAnimatorMac::allowsVerticalStretching):
(WebCore::ScrollAnimatorMac::allowsHorizontalStretching):

New ScrollableArea virtual function.
* platform/win/PopupMenuWin.h:

New RenderBox isScrollableOrRubberbandable() returns just 
canBeScrolledAndHasScrollableArea() for most RenderBox, but will be overridden by 
RenderView.
* rendering/RenderBox.cpp:
(WebCore::RenderBox::isScrollableOrRubberbandable):
* rendering/RenderBox.h:

Recurse up the parent chain to find out if anything is scrollable or just rubber-
bandable.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::hasScrollableOrRubberbandableAncestor):
* rendering/RenderLayer.h:

Call into RenderLayer.
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::hasScrollableOrRubberbandableAncestor):
* rendering/RenderListBox.h:

Override isScrollableOrRubberbandable() to handle the main frame case where the 
main frame is typically allowed to rubber-band even if there is no content to 
scroll to.
* rendering/RenderView.cpp:
(WebCore::RenderView::isScrollableOrRubberbandable):
* rendering/RenderView.h:

Source/WebKit2:

New ScrollabeArea virtual function.
* WebProcess/Plugins/PDF/PDFPlugin.h:</pre>

<h3>Modified Paths</h3>
<ul>
<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="#trunkSourceWebCoreplatformScrollableAreah">trunk/Source/WebCore/platform/ScrollableArea.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmacScrollAnimatorMacmm">trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformwinPopupMenuWinh">trunk/Source/WebCore/platform/win/PopupMenuWin.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBoxcpp">trunk/Source/WebCore/rendering/RenderBox.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBoxh">trunk/Source/WebCore/rendering/RenderBox.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="#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="#trunkSourceWebCorerenderingRenderViewh">trunk/Source/WebCore/rendering/RenderView.h</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2WebProcessPluginsPDFPDFPluginh">trunk/Source/WebKit2/WebProcess/Plugins/PDF/PDFPlugin.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (173013 => 173014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-08-27 19:37:16 UTC (rev 173013)
+++ trunk/Source/WebCore/ChangeLog        2014-08-27 19:53:31 UTC (rev 173014)
</span><span class="lines">@@ -1,3 +1,62 @@
</span><ins>+2014-08-27  Beth Dakin  &lt;bdakin@apple.com&gt;
+
+        overflow:scroll elements should not latch to the body if the body is 
+        overflow:hidden
+        https://bugs.webkit.org/show_bug.cgi?id=136273
+
+        Reviewed by Darin Adler.
+
+        This patch adds an optional parameter to isScrollable(). The Scrollability 
+        parameter that allows the caller to define what they mean by 'scrollable.' Most 
+        callers are interested in the default value, Scrollability::Scrollable, which 
+        means that there is actually content to scroll to, and a scrollbar that will allow 
+        you to access it. In some cases, such as this latching case, callers want to know 
+        if the FrameView is allowed to rubber-band, which the main frame might be allowed 
+        to do even if there is no content to scroll to. In that case, callers use 
+        Scrollability::ScrollableOrRubberbandable.
+        * page/FrameView.cpp:
+        (WebCore::FrameView::isScrollable):
+        (WebCore::FrameView::hasScrollableOrRubberbandableAncestor):
+
+        New virtual function on ScrollableArea answers whether a ScrollableArea has any 
+        scrollable or rubber-bandable ancestor.
+        * page/FrameView.h:
+        * platform/ScrollableArea.h:
+
+        Events should only be allowed to prevent stretching if there is some ancestor 
+        ScrollableArea that will be able to make use of the event. 
+        * platform/mac/ScrollAnimatorMac.mm:
+        (WebCore::ScrollAnimatorMac::allowsVerticalStretching):
+        (WebCore::ScrollAnimatorMac::allowsHorizontalStretching):
+
+        New ScrollableArea virtual function.
+        * platform/win/PopupMenuWin.h:
+
+        New RenderBox isScrollableOrRubberbandable() returns just 
+        canBeScrolledAndHasScrollableArea() for most RenderBox, but will be overridden by 
+        RenderView.
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::isScrollableOrRubberbandable):
+        * rendering/RenderBox.h:
+
+        Recurse up the parent chain to find out if anything is scrollable or just rubber-
+        bandable.
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::hasScrollableOrRubberbandableAncestor):
+        * rendering/RenderLayer.h:
+
+        Call into RenderLayer.
+        * rendering/RenderListBox.cpp:
+        (WebCore::RenderListBox::hasScrollableOrRubberbandableAncestor):
+        * rendering/RenderListBox.h:
+
+        Override isScrollableOrRubberbandable() to handle the main frame case where the 
+        main frame is typically allowed to rubber-band even if there is no content to 
+        scroll to.
+        * rendering/RenderView.cpp:
+        (WebCore::RenderView::isScrollableOrRubberbandable):
+        * rendering/RenderView.h:
+
</ins><span class="cx"> 2014-08-27  Benjamin Poulain  &lt;bpoulain@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Updating attributes on HTML elements do not invalidate the style correctly unless the attribute name is lowercase in the stylesheet
</span></span></pre></div>
<a id="trunkSourceWebCorepageFrameViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/FrameView.cpp (173013 => 173014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/FrameView.cpp        2014-08-27 19:37:16 UTC (rev 173013)
+++ trunk/Source/WebCore/page/FrameView.cpp        2014-08-27 19:53:31 UTC (rev 173014)
</span><span class="lines">@@ -3265,7 +3265,7 @@
</span><span class="cx">     return ownerRenderer-&gt;absoluteContentQuad().enclosingBoundingBox();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool FrameView::isScrollable()
</del><ins>+bool FrameView::isScrollable(Scrollability definitionOfScrollable)
</ins><span class="cx"> {
</span><span class="cx">     // Check for:
</span><span class="cx">     // 1) If there an actual overflow.
</span><span class="lines">@@ -3273,11 +3273,18 @@
</span><span class="cx">     // 3) overflow{-x,-y}: hidden;
</span><span class="cx">     // 4) scrolling: no;
</span><span class="cx"> 
</span><ins>+    bool requiresActualOverflowToBeConsideredScrollable = !frame().isMainFrame() || definitionOfScrollable != Scrollability::ScrollableOrRubberbandable;
+#if !ENABLE(RUBBER_BANDING)
+    requiresActualOverflowToBeConsideredScrollable = true;
+#endif
+
</ins><span class="cx">     // Covers #1
</span><del>-    IntSize totalContentsSize = this-&gt;totalContentsSize();
-    IntSize visibleContentSize = visibleContentRect(LegacyIOSDocumentVisibleRect).size();
-    if ((totalContentsSize.height() &lt;= visibleContentSize.height() &amp;&amp; totalContentsSize.width() &lt;= visibleContentSize.width()))
-        return false;
</del><ins>+    if (requiresActualOverflowToBeConsideredScrollable) {
+        IntSize totalContentsSize = this-&gt;totalContentsSize();
+        IntSize visibleContentSize = visibleContentRect(LegacyIOSDocumentVisibleRect).size();
+        if ((totalContentsSize.height() &lt;= visibleContentSize.height() &amp;&amp; totalContentsSize.width() &lt;= visibleContentSize.width()))
+            return false;
+    }
</ins><span class="cx"> 
</span><span class="cx">     // Covers #2.
</span><span class="cx">     HTMLFrameOwnerElement* owner = frame().ownerElement();
</span><span class="lines">@@ -3294,6 +3301,23 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool FrameView::hasScrollableOrRubberbandableAncestor()
+{
+    if (frame().isMainFrame())
+        return isScrollable(Scrollability::ScrollableOrRubberbandable);
+
+    FrameView* parentFrameView = this-&gt;parentFrameView();
+    if (!parentFrameView)
+        return false;
+
+    RenderView* parentRenderView = parentFrameView-&gt;renderView();
+    if (!parentRenderView)
+        return false;
+
+    RenderLayer* enclosingLayer = parentRenderView-&gt;enclosingLayer();
+    return enclosingLayer &amp;&amp; enclosingLayer-&gt;hasScrollableOrRubberbandableAncestor();
+}
+
</ins><span class="cx"> void FrameView::updateScrollableAreaSet()
</span><span class="cx"> {
</span><span class="cx">     // That ensures that only inner frames are cached.
</span></span></pre></div>
<a id="trunkSourceWebCorepageFrameViewh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/FrameView.h (173013 => 173014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/FrameView.h        2014-08-27 19:37:16 UTC (rev 173013)
+++ trunk/Source/WebCore/page/FrameView.h        2014-08-27 19:53:31 UTC (rev 173014)
</span><span class="lines">@@ -396,7 +396,14 @@
</span><span class="cx"> 
</span><span class="cx">     bool isFrameViewScrollCorner(RenderScrollbarPart* scrollCorner) const { return m_scrollCorner == scrollCorner; }
</span><span class="cx"> 
</span><del>-    bool isScrollable();
</del><ins>+    // isScrollable() takes an optional Scrollability parameter that allows the caller to define what they mean by 'scrollable.'
+    // Most callers are interested in the default value, Scrollability::Scrollable, which means that there is actually content
+    // to scroll to, and a scrollbar that will allow you to access it. In some cases, callers want to know if the FrameView is allowed
+    // to rubber-band, which the main frame might be allowed to do even if there is no content to scroll to. In that case,
+    // callers use Scrollability::ScrollableOrRubberbandable.
+    enum class Scrollability { Scrollable, ScrollableOrRubberbandable };
+    bool isScrollable(Scrollability definitionOfScrollable = Scrollability::Scrollable);
+    virtual bool hasScrollableOrRubberbandableAncestor() override;
</ins><span class="cx"> 
</span><span class="cx">     enum ScrollbarModesCalculationStrategy { RulesFromWebContentOnly, AnyRule };
</span><span class="cx">     void calculateScrollbarModesForLayout(ScrollbarMode&amp; hMode, ScrollbarMode&amp; vMode, ScrollbarModesCalculationStrategy = AnyRule);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformScrollableAreah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ScrollableArea.h (173013 => 173014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ScrollableArea.h        2014-08-27 19:37:16 UTC (rev 173013)
+++ trunk/Source/WebCore/platform/ScrollableArea.h        2014-08-27 19:53:31 UTC (rev 173014)
</span><span class="lines">@@ -207,6 +207,8 @@
</span><span class="cx">     // Note that this only returns scrollable areas that can actually be scrolled.
</span><span class="cx">     virtual ScrollableArea* enclosingScrollableArea() const = 0;
</span><span class="cx"> 
</span><ins>+    virtual bool hasScrollableOrRubberbandableAncestor() = 0;
+
</ins><span class="cx">     // Returns the bounding box of this scrollable area, in the coordinate system of the enclosing scroll view.
</span><span class="cx">     virtual IntRect scrollableAreaBoundingBox() const = 0;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmacScrollAnimatorMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.mm (173013 => 173014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.mm        2014-08-27 19:37:16 UTC (rev 173013)
+++ trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.mm        2014-08-27 19:53:31 UTC (rev 173014)
</span><span class="lines">@@ -1158,7 +1158,7 @@
</span><span class="cx">         Scrollbar* hScroller = m_scrollableArea-&gt;horizontalScrollbar();
</span><span class="cx">         Scrollbar* vScroller = m_scrollableArea-&gt;verticalScrollbar();
</span><span class="cx">         bool scrollbarsAllowStretching = ((vScroller &amp;&amp; vScroller-&gt;enabled()) || (!hScroller || !hScroller-&gt;enabled()));
</span><del>-        bool eventPreventsStretching = newGestureIsStarting(wheelEvent) &amp;&amp; isAlreadyPinnedInDirectionOfGesture(wheelEvent, ScrollEventAxis::Vertical);
</del><ins>+        bool eventPreventsStretching = m_scrollableArea-&gt;hasScrollableOrRubberbandableAncestor() &amp;&amp; newGestureIsStarting(wheelEvent) &amp;&amp; isAlreadyPinnedInDirectionOfGesture(wheelEvent, ScrollEventAxis::Vertical);
</ins><span class="cx">         return scrollbarsAllowStretching &amp;&amp; !eventPreventsStretching;
</span><span class="cx">     }
</span><span class="cx">     case ScrollElasticityNone:
</span><span class="lines">@@ -1178,7 +1178,7 @@
</span><span class="cx">         Scrollbar* hScroller = m_scrollableArea-&gt;horizontalScrollbar();
</span><span class="cx">         Scrollbar* vScroller = m_scrollableArea-&gt;verticalScrollbar();
</span><span class="cx">         bool scrollbarsAllowStretching = ((hScroller &amp;&amp; hScroller-&gt;enabled()) || (!vScroller || !vScroller-&gt;enabled()));
</span><del>-        bool eventPreventsStretching = newGestureIsStarting(wheelEvent) &amp;&amp; isAlreadyPinnedInDirectionOfGesture(wheelEvent, ScrollEventAxis::Horizontal);
</del><ins>+        bool eventPreventsStretching = m_scrollableArea-&gt;hasScrollableOrRubberbandableAncestor() &amp;&amp; newGestureIsStarting(wheelEvent) &amp;&amp; isAlreadyPinnedInDirectionOfGesture(wheelEvent, ScrollEventAxis::Horizontal);
</ins><span class="cx">         return scrollbarsAllowStretching &amp;&amp; !eventPreventsStretching;
</span><span class="cx">     }
</span><span class="cx">     case ScrollElasticityNone:
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformwinPopupMenuWinh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/win/PopupMenuWin.h (173013 => 173014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/win/PopupMenuWin.h        2014-08-27 19:37:16 UTC (rev 173013)
+++ trunk/Source/WebCore/platform/win/PopupMenuWin.h        2014-08-27 19:53:31 UTC (rev 173014)
</span><span class="lines">@@ -95,6 +95,7 @@
</span><span class="cx">     virtual void invalidateScrollCornerRect(const IntRect&amp;) override { }
</span><span class="cx">     virtual bool isActive() const override { return true; }
</span><span class="cx">     ScrollableArea* enclosingScrollableArea() const override { return 0; }
</span><ins>+    virtual bool hasScrollableOrRubberbandableAncestor() override { return true; }
</ins><span class="cx">     virtual bool isScrollCornerVisible() const override { return false; }
</span><span class="cx">     virtual IntRect scrollCornerRect() const override { return IntRect(); }
</span><span class="cx">     virtual Scrollbar* verticalScrollbar() const override { return m_scrollbar.get(); }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (173013 => 173014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBox.cpp        2014-08-27 19:37:16 UTC (rev 173013)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp        2014-08-27 19:53:31 UTC (rev 173014)
</span><span class="lines">@@ -835,7 +835,12 @@
</span><span class="cx"> {
</span><span class="cx">     return canBeProgramaticallyScrolled() &amp;&amp; (scrollHeight() != clientHeight() || scrollWidth() != clientWidth());
</span><span class="cx"> }
</span><del>-    
</del><ins>+
+bool RenderBox::isScrollableOrRubberbandable() const
+{
+    return canBeScrolledAndHasScrollableArea();
+}
+
</ins><span class="cx"> bool RenderBox::canBeProgramaticallyScrolled() const
</span><span class="cx"> {
</span><span class="cx">     if (isRenderView())
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBoxh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBox.h (173013 => 173014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBox.h        2014-08-27 19:37:16 UTC (rev 173013)
+++ trunk/Source/WebCore/rendering/RenderBox.h        2014-08-27 19:53:31 UTC (rev 173014)
</span><span class="lines">@@ -462,6 +462,7 @@
</span><span class="cx">     virtual bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1, Element** stopElement = nullptr, RenderBox* startBox = nullptr, const IntPoint&amp; wheelEventAbsolutePoint = IntPoint());
</span><span class="cx">     virtual bool logicalScroll(ScrollLogicalDirection, ScrollGranularity, float multiplier = 1, Element** stopElement = 0);
</span><span class="cx">     bool canBeScrolledAndHasScrollableArea() const;
</span><ins>+    virtual bool isScrollableOrRubberbandable() const;
</ins><span class="cx">     virtual bool canBeProgramaticallyScrolled() const;
</span><span class="cx">     virtual void autoscroll(const IntPoint&amp;);
</span><span class="cx">     bool canAutoscroll() const;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (173013 => 173014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayer.cpp        2014-08-27 19:37:16 UTC (rev 173013)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp        2014-08-27 19:53:31 UTC (rev 173014)
</span><span class="lines">@@ -3065,6 +3065,16 @@
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool RenderLayer::hasScrollableOrRubberbandableAncestor()
+{
+    for (RenderLayer* nextLayer = parentLayerCrossFrame(this); nextLayer; nextLayer = parentLayerCrossFrame(nextLayer)) {
+        if (nextLayer-&gt;renderer().isBox() &amp;&amp; toRenderBox(nextLayer-&gt;renderer()).isScrollableOrRubberbandable())
+            return true;
+    }
+
+    return false;
+}
+
</ins><span class="cx"> #if ENABLE(CSS_SCROLL_SNAP)
</span><span class="cx"> void RenderLayer::updateSnapOffsets()
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayer.h (173013 => 173014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayer.h        2014-08-27 19:37:16 UTC (rev 173013)
+++ trunk/Source/WebCore/rendering/RenderLayer.h        2014-08-27 19:53:31 UTC (rev 173014)
</span><span class="lines">@@ -439,6 +439,7 @@
</span><span class="cx">     virtual Scrollbar* horizontalScrollbar() const override { return m_hBar.get(); }
</span><span class="cx">     virtual Scrollbar* verticalScrollbar() const override { return m_vBar.get(); }
</span><span class="cx">     virtual ScrollableArea* enclosingScrollableArea() const override;
</span><ins>+    virtual bool hasScrollableOrRubberbandableAncestor() override;
</ins><span class="cx"> #if ENABLE(CSS_SCROLL_SNAP)
</span><span class="cx">     virtual void updateSnapOffsets() override;
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderListBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderListBox.cpp (173013 => 173014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderListBox.cpp        2014-08-27 19:37:16 UTC (rev 173013)
+++ trunk/Source/WebCore/rendering/RenderListBox.cpp        2014-08-27 19:53:31 UTC (rev 173014)
</span><span class="lines">@@ -787,6 +787,11 @@
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool RenderListBox::hasScrollableOrRubberbandableAncestor()
+{
+    return enclosingLayer() &amp;&amp; enclosingLayer()-&gt;hasScrollableOrRubberbandableAncestor();
+}
+
</ins><span class="cx"> IntRect RenderListBox::scrollableAreaBoundingBox() const
</span><span class="cx"> {
</span><span class="cx">     return absoluteBoundingBoxRect();
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderListBoxh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderListBox.h (173013 => 173014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderListBox.h        2014-08-27 19:37:16 UTC (rev 173013)
+++ trunk/Source/WebCore/rendering/RenderListBox.h        2014-08-27 19:53:31 UTC (rev 173014)
</span><span class="lines">@@ -131,6 +131,7 @@
</span><span class="cx">     virtual bool forceUpdateScrollbarsOnMainThreadForPerformanceTesting() const override;
</span><span class="cx"> 
</span><span class="cx">     virtual ScrollableArea* enclosingScrollableArea() const override;
</span><ins>+    virtual bool hasScrollableOrRubberbandableAncestor() override;
</ins><span class="cx">     virtual IntRect scrollableAreaBoundingBox() const override;
</span><span class="cx"> 
</span><span class="cx">     // NOTE: This should only be called by the overriden setScrollOffset from ScrollableArea.
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderView.cpp (173013 => 173014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderView.cpp        2014-08-27 19:37:16 UTC (rev 173013)
+++ trunk/Source/WebCore/rendering/RenderView.cpp        2014-08-27 19:53:31 UTC (rev 173014)
</span><span class="lines">@@ -710,6 +710,14 @@
</span><span class="cx">         rect = LayoutRect(layer()-&gt;transform()-&gt;mapRect(pixelSnappedForPainting(rect, document().deviceScaleFactor())));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool RenderView::isScrollableOrRubberbandable() const
+{
+    // The main frame might be allowed to rubber-band even if there is no content to scroll to. This is unique to
+    // the main frame; subframes and overflow areas have to have content that can be scrolled to in order to rubber-band.
+    FrameView::Scrollability defineScrollable = frame().ownerElement() ? FrameView::Scrollability::Scrollable : FrameView::Scrollability::ScrollableOrRubberbandable;
+    return frameView().isScrollable(defineScrollable);
+}
+
</ins><span class="cx"> void RenderView::absoluteRects(Vector&lt;IntRect&gt;&amp; rects, const LayoutPoint&amp; accumulatedOffset) const
</span><span class="cx"> {
</span><span class="cx">     rects.append(pixelSnappedIntRect(accumulatedOffset, layer()-&gt;size()));
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderViewh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderView.h (173013 => 173014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderView.h        2014-08-27 19:37:16 UTC (rev 173013)
+++ trunk/Source/WebCore/rendering/RenderView.h        2014-08-27 19:53:31 UTC (rev 173014)
</span><span class="lines">@@ -303,6 +303,8 @@
</span><span class="cx">     friend class LayoutStateMaintainer;
</span><span class="cx">     friend class LayoutStateDisabler;
</span><span class="cx"> 
</span><ins>+    virtual bool isScrollableOrRubberbandable() const;
+
</ins><span class="cx">     void splitSelectionBetweenSubtrees(RenderObject* start, int startPos, RenderObject* end, int endPos, SelectionRepaintMode blockRepaintMode);
</span><span class="cx">     void clearSubtreeSelection(const SelectionSubtreeRoot&amp;, SelectionRepaintMode, OldSelectionData&amp;);
</span><span class="cx">     void updateSelectionForSubtrees(RenderSubtreesMap&amp;, SelectionRepaintMode);
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (173013 => 173014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-08-27 19:37:16 UTC (rev 173013)
+++ trunk/Source/WebKit2/ChangeLog        2014-08-27 19:53:31 UTC (rev 173014)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2014-08-27  Beth Dakin  &lt;bdakin@apple.com&gt;
+
+        overflow:scroll elements should not latch to the body if the body is 
+        overflow:hidden
+        https://bugs.webkit.org/show_bug.cgi?id=136273
+
+        Reviewed by Darin Adler.
+
+        New ScrollabeArea virtual function.
+        * WebProcess/Plugins/PDF/PDFPlugin.h:
+
</ins><span class="cx"> 2014-08-26  Matt Lilek  &lt;mrl@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Add WebKit SPI to control the navigator.standalone property
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessPluginsPDFPDFPluginh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Plugins/PDF/PDFPlugin.h (173013 => 173014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Plugins/PDF/PDFPlugin.h        2014-08-27 19:37:16 UTC (rev 173013)
+++ trunk/Source/WebKit2/WebProcess/Plugins/PDF/PDFPlugin.h        2014-08-27 19:53:31 UTC (rev 173014)
</span><span class="lines">@@ -175,6 +175,7 @@
</span><span class="cx">     // ScrollableArea functions.
</span><span class="cx">     virtual WebCore::IntRect scrollCornerRect() const override;
</span><span class="cx">     virtual WebCore::ScrollableArea* enclosingScrollableArea() const override;
</span><ins>+    virtual bool hasScrollableOrRubberbandableAncestor() override { return true; }
</ins><span class="cx">     virtual WebCore::IntRect scrollableAreaBoundingBox() const override;
</span><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></pre>
</div>
</div>

</body>
</html>