<!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>[180615] 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/180615">180615</a></dd>
<dt>Author</dt> <dd>simon.fraser@apple.com</dd>
<dt>Date</dt> <dd>2015-02-24 21:35:38 -0800 (Tue, 24 Feb 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Clarify some resizing terminology in ScrollView/FrameView
https://bugs.webkit.org/show_bug.cgi?id=141996

Reviewed by Zalan Bujtas.

ScrollableArea/ScrollView/FrameView had some confusing terminology around
contentsResized/visibleContentsResized/fixedLayoutSizeChanged.

Clarify this by distinguishing between:
1. Available size changes because of
    i) non-overlay scrollbar presence
   ii) ScrollableArea frame change
2. Removing fixedLayoutSizeChanged() and just treating it like an
   available size change.

contentsResized() is relegated to simply being a hook that allows Mac to
flash overlay scrollbars.

The confusingly named visibleContentsResized() is now updateContentsSize(),
and is the way that a ScrollableArea tells its subclasss that it should recompute
the size of the contents (i.e. do a layout).

Source/WebCore:

* page/FrameView.cpp:
(WebCore::FrameView::setContentsSize): No longer mysteriously skip the
FrameView implementation of contentsResized(), which used to do a setNeedsLayout()
which we didn't want to do from setContentsSize(), which itself happens as a result of layout.
(WebCore::FrameView::adjustViewSize): Whitespace.
(WebCore::FrameView::layout): Ditto.
(WebCore::FrameView::availableContentSizeChanged): Called on frame size change, or scrollbar
change.
(WebCore::FrameView::updateContentsSize): This actually does the layout.
(WebCore::FrameView::scrollbarStyleChanged): Always call the base class;  ScrollView::scrollbarStyleChanged
will bail if not a forced update.
(WebCore::FrameView::setCustomFixedPositionLayoutRect): Forces a layout via updateContentsSize() now.
(WebCore::FrameView::contentsResized): Deleted.
(WebCore::FrameView::fixedLayoutSizeChanged): Deleted.
(WebCore::FrameView::visibleContentsResized): Deleted.
* page/FrameView.h:
* platform/ScrollView.cpp:
(WebCore::ScrollView::setFixedLayoutSize): Calls availableContentSizeChanged() now.
(WebCore::ScrollView::setUseFixedLayout): Ditto.
(WebCore::ScrollView::availableContentSizeChanged): Update scrollbars if that's not
the reason we are being called.
(WebCore::ScrollView::updateScrollbars): contentsResized() was the thing that caused setNeedsLayout();
replace it with availableContentSizeChanged(). visibleContentsResized() did the layout, and
replace with updateContentsSize().
(WebCore::ScrollView::setFrameRect): Call availableContentSizeChanged() now. This takes care of
updating scrollbars, so no need to explicitly do that.
(WebCore::ScrollView::scrollbarStyleChanged): Call the base class.
(WebCore::ScrollView::fixedLayoutSizeChanged): Deleted.
* platform/ScrollView.h:
* platform/ScrollableArea.cpp:
(WebCore::ScrollableArea::availableContentSizeChanged): Call scrollAnimator-&gt;contentsResized()
to flash the scrollbars.
(WebCore::ScrollableArea::scrolledToRight):
(WebCore::ScrollableArea::scrollbarStyleChanged): Call availableContentSizeChanged() since
scrollbar style affects available space.
* platform/ScrollableArea.h:
(WebCore::ScrollableArea::updateContentsSize):
(WebCore::ScrollableArea::scrollbarStyleChanged): Deleted.

Source/WebKit2:

* WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::scrollbarStyleChanged): Call the base class method,
which takes care of</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="#trunkSourceWebCoreplatformScrollViewcpp">trunk/Source/WebCore/platform/ScrollView.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformScrollViewh">trunk/Source/WebCore/platform/ScrollView.h</a></li>
<li><a href="#trunkSourceWebCoreplatformScrollableAreacpp">trunk/Source/WebCore/platform/ScrollableArea.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformScrollableAreah">trunk/Source/WebCore/platform/ScrollableArea.h</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2WebProcessPluginsPDFPDFPluginmm">trunk/Source/WebKit2/WebProcess/Plugins/PDF/PDFPlugin.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (180614 => 180615)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-02-25 05:11:36 UTC (rev 180614)
+++ trunk/Source/WebCore/ChangeLog        2015-02-25 05:35:38 UTC (rev 180615)
</span><span class="lines">@@ -1,3 +1,66 @@
</span><ins>+2015-02-24  Simon Fraser  &lt;simon.fraser@apple.com&gt;
+
+        Clarify some resizing terminology in ScrollView/FrameView
+        https://bugs.webkit.org/show_bug.cgi?id=141996
+
+        Reviewed by Zalan Bujtas.
+
+        ScrollableArea/ScrollView/FrameView had some confusing terminology around
+        contentsResized/visibleContentsResized/fixedLayoutSizeChanged.
+        
+        Clarify this by distinguishing between:
+        1. Available size changes because of
+            i) non-overlay scrollbar presence
+           ii) ScrollableArea frame change
+        2. Removing fixedLayoutSizeChanged() and just treating it like an
+           available size change.
+           
+        contentsResized() is relegated to simply being a hook that allows Mac to
+        flash overlay scrollbars.
+        
+        The confusingly named visibleContentsResized() is now updateContentsSize(),
+        and is the way that a ScrollableArea tells its subclasss that it should recompute
+        the size of the contents (i.e. do a layout).
+
+        * page/FrameView.cpp:
+        (WebCore::FrameView::setContentsSize): No longer mysteriously skip the
+        FrameView implementation of contentsResized(), which used to do a setNeedsLayout()
+        which we didn't want to do from setContentsSize(), which itself happens as a result of layout.
+        (WebCore::FrameView::adjustViewSize): Whitespace.
+        (WebCore::FrameView::layout): Ditto.
+        (WebCore::FrameView::availableContentSizeChanged): Called on frame size change, or scrollbar
+        change.
+        (WebCore::FrameView::updateContentsSize): This actually does the layout.
+        (WebCore::FrameView::scrollbarStyleChanged): Always call the base class;  ScrollView::scrollbarStyleChanged
+        will bail if not a forced update.
+        (WebCore::FrameView::setCustomFixedPositionLayoutRect): Forces a layout via updateContentsSize() now.
+        (WebCore::FrameView::contentsResized): Deleted.
+        (WebCore::FrameView::fixedLayoutSizeChanged): Deleted.
+        (WebCore::FrameView::visibleContentsResized): Deleted.
+        * page/FrameView.h:
+        * platform/ScrollView.cpp:
+        (WebCore::ScrollView::setFixedLayoutSize): Calls availableContentSizeChanged() now.
+        (WebCore::ScrollView::setUseFixedLayout): Ditto.
+        (WebCore::ScrollView::availableContentSizeChanged): Update scrollbars if that's not
+        the reason we are being called.
+        (WebCore::ScrollView::updateScrollbars): contentsResized() was the thing that caused setNeedsLayout();
+        replace it with availableContentSizeChanged(). visibleContentsResized() did the layout, and
+        replace with updateContentsSize().
+        (WebCore::ScrollView::setFrameRect): Call availableContentSizeChanged() now. This takes care of
+        updating scrollbars, so no need to explicitly do that.
+        (WebCore::ScrollView::scrollbarStyleChanged): Call the base class.
+        (WebCore::ScrollView::fixedLayoutSizeChanged): Deleted.
+        * platform/ScrollView.h:
+        * platform/ScrollableArea.cpp:
+        (WebCore::ScrollableArea::availableContentSizeChanged): Call scrollAnimator-&gt;contentsResized()
+        to flash the scrollbars.
+        (WebCore::ScrollableArea::scrolledToRight):
+        (WebCore::ScrollableArea::scrollbarStyleChanged): Call availableContentSizeChanged() since
+        scrollbar style affects available space.
+        * platform/ScrollableArea.h:
+        (WebCore::ScrollableArea::updateContentsSize):
+        (WebCore::ScrollableArea::scrollbarStyleChanged): Deleted.
+
</ins><span class="cx"> 2015-02-24  Ryosuke Niwa  &lt;rniwa@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed Mavericks build attempt fix after r180609.
</span></span></pre></div>
<a id="trunkSourceWebCorepageFrameViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/FrameView.cpp (180614 => 180615)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/FrameView.cpp        2015-02-25 05:11:36 UTC (rev 180614)
+++ trunk/Source/WebCore/page/FrameView.cpp        2015-02-25 05:35:38 UTC (rev 180615)
</span><span class="lines">@@ -566,7 +566,7 @@
</span><span class="cx">     m_deferSetNeedsLayoutCount++;
</span><span class="cx"> 
</span><span class="cx">     ScrollView::setContentsSize(size);
</span><del>-    ScrollView::contentsResized();
</del><ins>+    contentsResized();
</ins><span class="cx">     
</span><span class="cx">     Page* page = frame().page();
</span><span class="cx">     if (!page)
</span><span class="lines">@@ -597,7 +597,7 @@
</span><span class="cx">     const IntRect rect = renderView-&gt;documentRect();
</span><span class="cx">     const IntSize&amp; size = rect.size();
</span><span class="cx">     ScrollView::setScrollOrigin(IntPoint(-rect.x(), -rect.y()), !frame().document()-&gt;printing(), size == contentsSize());
</span><del>-    
</del><ins>+
</ins><span class="cx">     setContentsSize(size);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1276,7 +1276,6 @@
</span><span class="cx">             }
</span><span class="cx"> 
</span><span class="cx">             LayoutSize oldSize = m_size;
</span><del>-
</del><span class="cx">             m_size = layoutSize();
</span><span class="cx"> 
</span><span class="cx">             if (oldSize != m_size) {
</span><span class="lines">@@ -2290,27 +2289,18 @@
</span><span class="cx">     return countRenderedCharactersInRenderObjectWithThreshold(*m_frame-&gt;contentRenderer(), threshold) &gt;= threshold;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void FrameView::contentsResized()
</del><ins>+void FrameView::availableContentSizeChanged(AvailableSizeChangeReason reason)
</ins><span class="cx"> {
</span><del>-    ScrollView::contentsResized();
</del><span class="cx">     setNeedsLayout();
</span><ins>+    ScrollView::availableContentSizeChanged(reason);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void FrameView::fixedLayoutSizeChanged()
-{
-    // Can be triggered before the view is set, see comment in FrameView::visibleContentsResized().
-    // An ASSERT is triggered when a view schedules a layout before being attached to a frame.
-    if (!frame().view())
-        return;
-    ScrollView::fixedLayoutSizeChanged();
-}
-
</del><span class="cx"> bool FrameView::shouldLayoutAfterContentsResized() const
</span><span class="cx"> {
</span><span class="cx">     return !useFixedLayout() || useCustomFixedPositionLayoutRect();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void FrameView::visibleContentsResized()
</del><ins>+void FrameView::updateContentsSize()
</ins><span class="cx"> {
</span><span class="cx">     // We check to make sure the view is attached to a frame() as this method can
</span><span class="cx">     // be triggered before the view is attached by Frame::createView(...) setting
</span><span class="lines">@@ -3493,8 +3483,7 @@
</span><span class="cx"> 
</span><span class="cx">     frame().page()-&gt;chrome().client().recommendedScrollbarStyleDidChange(newStyle);
</span><span class="cx"> 
</span><del>-    if (forceUpdate)
-        ScrollView::scrollbarStyleChanged(newStyle, forceUpdate);
</del><ins>+    ScrollView::scrollbarStyleChanged(newStyle, forceUpdate);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void FrameView::notifyPageThatContentAreaWillPaint() const
</span><span class="lines">@@ -4466,7 +4455,7 @@
</span><span class="cx">         return;
</span><span class="cx">     m_useCustomFixedPositionLayoutRect = true;
</span><span class="cx">     m_customFixedPositionLayoutRect = rect;
</span><del>-    visibleContentsResized();
</del><ins>+    updateContentsSize();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool FrameView::updateFixedPositionLayoutRect()
</span></span></pre></div>
<a id="trunkSourceWebCorepageFrameViewh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/FrameView.h (180614 => 180615)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/FrameView.h        2015-02-25 05:11:36 UTC (rev 180614)
+++ trunk/Source/WebCore/page/FrameView.h        2015-02-25 05:35:38 UTC (rev 180615)
</span><span class="lines">@@ -580,10 +580,9 @@
</span><span class="cx">     WEBCORE_EXPORT void adjustTiledBackingCoverage();
</span><span class="cx"> 
</span><span class="cx">     virtual void repaintContentRectangle(const IntRect&amp;) override;
</span><del>-    virtual void contentsResized() override;
-    virtual void visibleContentsResized() override;
</del><ins>+    virtual void updateContentsSize() override;
+    virtual void availableContentSizeChanged(AvailableSizeChangeReason) override;
</ins><span class="cx">     virtual void addedOrRemovedScrollbar() override;
</span><del>-    virtual void fixedLayoutSizeChanged() override;
</del><span class="cx"> 
</span><span class="cx">     virtual void delegatesScrollingDidChange() override;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformScrollViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ScrollView.cpp (180614 => 180615)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ScrollView.cpp        2015-02-25 05:11:36 UTC (rev 180614)
+++ trunk/Source/WebCore/platform/ScrollView.cpp        2015-02-25 05:35:38 UTC (rev 180615)
</span><span class="lines">@@ -346,7 +346,7 @@
</span><span class="cx">         return;
</span><span class="cx">     m_fixedLayoutSize = newSize;
</span><span class="cx">     if (m_useFixedLayout)
</span><del>-        fixedLayoutSizeChanged();
</del><ins>+        availableContentSizeChanged(AvailableSizeChangeReason::AreaSizeChanged);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool ScrollView::useFixedLayout() const
</span><span class="lines">@@ -360,13 +360,14 @@
</span><span class="cx">         return;
</span><span class="cx">     m_useFixedLayout = enable;
</span><span class="cx">     if (!m_fixedLayoutSize.isEmpty())
</span><del>-        fixedLayoutSizeChanged();
</del><ins>+        availableContentSizeChanged(AvailableSizeChangeReason::AreaSizeChanged);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void ScrollView::fixedLayoutSizeChanged()
</del><ins>+void ScrollView::availableContentSizeChanged(AvailableSizeChangeReason reason)
</ins><span class="cx"> {
</span><del>-    updateScrollbars(scrollOffset());
-    contentsResized();
</del><ins>+    ScrollableArea::availableContentSizeChanged(reason);
+    if (reason != AvailableSizeChangeReason::ScrollbarsChanged)
+        updateScrollbars(scrollOffset());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> IntSize ScrollView::contentsSize() const
</span><span class="lines">@@ -600,11 +601,11 @@
</span><span class="cx">     bool hasOverlayScrollbars = (!m_horizontalScrollbar || m_horizontalScrollbar-&gt;isOverlayScrollbar()) &amp;&amp; (!m_verticalScrollbar || m_verticalScrollbar-&gt;isOverlayScrollbar());
</span><span class="cx"> 
</span><span class="cx">     // If we came in here with the view already needing a layout, then go ahead and do that
</span><del>-    // first.  (This will be the common case, e.g., when the page changes due to window resizing for example).
</del><ins>+    // first. (This will be the common case, e.g., when the page changes due to window resizing for example).
</ins><span class="cx">     // This layout will not re-enter updateScrollbars and does not count towards our max layout pass total.
</span><span class="cx">     if (!m_scrollbarsSuppressed &amp;&amp; !hasOverlayScrollbars) {
</span><span class="cx">         m_inUpdateScrollbars = true;
</span><del>-        visibleContentsResized();
</del><ins>+        updateContentsSize();
</ins><span class="cx">         m_inUpdateScrollbars = false;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -696,8 +697,8 @@
</span><span class="cx">         const unsigned cMaxUpdateScrollbarsPass = 2;
</span><span class="cx">         if ((sendContentResizedNotification || needAnotherPass) &amp;&amp; m_updateScrollbarsPass &lt; cMaxUpdateScrollbarsPass) {
</span><span class="cx">             m_updateScrollbarsPass++;
</span><del>-            contentsResized();
-            visibleContentsResized();
</del><ins>+            availableContentSizeChanged(AvailableSizeChangeReason::ScrollbarsChanged);
+            updateContentsSize();
</ins><span class="cx">             IntSize newDocSize = totalContentsSize();
</span><span class="cx">             if (newDocSize == docSize) {
</span><span class="cx">                 // The layout with the new scroll state had no impact on
</span><span class="lines">@@ -1047,13 +1048,10 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     Widget::setFrameRect(newRect);
</span><del>-
</del><span class="cx">     frameRectsChanged();
</span><del>-
-    updateScrollbars(scrollOffset());
-
</del><ins>+    
</ins><span class="cx">     if (!m_useFixedLayout &amp;&amp; oldRect.size() != newRect.size())
</span><del>-        contentsResized();
</del><ins>+        availableContentSizeChanged(AvailableSizeChangeReason::AreaSizeChanged);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void ScrollView::frameRectsChanged()
</span><span class="lines">@@ -1162,12 +1160,12 @@
</span><span class="cx">     return !scrollCornerRect().isEmpty();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void ScrollView::scrollbarStyleChanged(ScrollbarStyle, bool forceUpdate)
</del><ins>+void ScrollView::scrollbarStyleChanged(ScrollbarStyle newStyle, bool forceUpdate)
</ins><span class="cx"> {
</span><ins>+    ScrollableArea::scrollbarStyleChanged(newStyle, forceUpdate);
</ins><span class="cx">     if (!forceUpdate)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    contentsResized();
</del><span class="cx">     updateScrollbars(scrollOffset());
</span><span class="cx">     positionScrollbarLayers();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformScrollViewh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ScrollView.h (180614 => 180615)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ScrollView.h        2015-02-25 05:11:36 UTC (rev 180614)
+++ trunk/Source/WebCore/platform/ScrollView.h        2015-02-25 05:35:38 UTC (rev 180615)
</span><span class="lines">@@ -389,10 +389,9 @@
</span><span class="cx"> 
</span><span class="cx">     virtual void paintOverhangAreas(GraphicsContext*, const IntRect&amp; horizontalOverhangArea, const IntRect&amp; verticalOverhangArea, const IntRect&amp; dirtyRect);
</span><span class="cx"> 
</span><del>-    virtual void visibleContentsResized() = 0;
</del><ins>+    virtual void availableContentSizeChanged(AvailableSizeChangeReason) override;
</ins><span class="cx">     virtual void addedOrRemovedScrollbar() = 0;
</span><span class="cx">     virtual void delegatesScrollingDidChange() { }
</span><del>-    virtual void fixedLayoutSizeChanged();
</del><span class="cx"> 
</span><span class="cx">     // These functions are used to create/destroy scrollbars.
</span><span class="cx">     // They return true if the scrollbar was added or removed.
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformScrollableAreacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ScrollableArea.cpp (180614 => 180615)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ScrollableArea.cpp        2015-02-25 05:11:36 UTC (rev 180614)
+++ trunk/Source/WebCore/platform/ScrollableArea.cpp        2015-02-25 05:35:38 UTC (rev 180615)
</span><span class="lines">@@ -314,6 +314,12 @@
</span><span class="cx">         scrollAnimator-&gt;contentsResized();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void ScrollableArea::availableContentSizeChanged(AvailableSizeChangeReason)
+{
+    if (ScrollAnimator* scrollAnimator = existingScrollAnimator())
+        scrollAnimator-&gt;contentsResized(); // This flashes overlay scrollbars.
+}
+
</ins><span class="cx"> bool ScrollableArea::hasOverlayScrollbars() const
</span><span class="cx"> {
</span><span class="cx">     return (verticalScrollbar() &amp;&amp; verticalScrollbar()-&gt;isOverlayScrollbar())
</span><span class="lines">@@ -479,6 +485,11 @@
</span><span class="cx">     return scrollPosition().x() &gt;= maximumScrollPosition().x();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void ScrollableArea::scrollbarStyleChanged(ScrollbarStyle, bool)
+{
+    availableContentSizeChanged(AvailableSizeChangeReason::ScrollbarsChanged);
+}
+
</ins><span class="cx"> IntSize ScrollableArea::totalContentsSize() const
</span><span class="cx"> {
</span><span class="cx">     IntSize totalContentsSize = contentsSize();
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformScrollableAreah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ScrollableArea.h (180614 => 180615)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ScrollableArea.h        2015-02-25 05:11:36 UTC (rev 180614)
+++ trunk/Source/WebCore/platform/ScrollableArea.h        2015-02-25 05:35:38 UTC (rev 180615)
</span><span class="lines">@@ -112,6 +112,15 @@
</span><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT virtual void contentsResized();
</span><span class="cx"> 
</span><ins>+    // Force the contents to recompute their size (i.e. do layout).
+    virtual void updateContentsSize() { }
+
+    enum class AvailableSizeChangeReason {
+        ScrollbarsChanged,
+        AreaSizeChanged
+    };
+    WEBCORE_EXPORT virtual void availableContentSizeChanged(AvailableSizeChangeReason);
+
</ins><span class="cx">     bool hasOverlayScrollbars() const;
</span><span class="cx">     WEBCORE_EXPORT virtual void setScrollbarOverlayStyle(ScrollbarOverlayStyle);
</span><span class="cx">     ScrollbarOverlayStyle scrollbarOverlayStyle() const { return static_cast&lt;ScrollbarOverlayStyle&gt;(m_scrollbarOverlayStyle); }
</span><span class="lines">@@ -201,7 +210,7 @@
</span><span class="cx">     WEBCORE_EXPORT IntSize totalContentsSize() const;
</span><span class="cx"> 
</span><span class="cx">     virtual bool shouldSuspendScrollAnimations() const { return true; }
</span><del>-    virtual void scrollbarStyleChanged(ScrollbarStyle, bool /*forceUpdate*/) { }
</del><ins>+    WEBCORE_EXPORT virtual void scrollbarStyleChanged(ScrollbarStyle /*newStyle*/, bool /*forceUpdate*/);
</ins><span class="cx">     virtual void setVisibleScrollerThumbRect(const IntRect&amp;) { }
</span><span class="cx">     
</span><span class="cx">     // Note that this only returns scrollable areas that can actually be scrolled.
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (180614 => 180615)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-02-25 05:11:36 UTC (rev 180614)
+++ trunk/Source/WebKit2/ChangeLog        2015-02-25 05:35:38 UTC (rev 180615)
</span><span class="lines">@@ -1,5 +1,33 @@
</span><span class="cx"> 2015-02-24  Simon Fraser  &lt;simon.fraser@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Clarify some resizing terminology in ScrollView/FrameView
+        https://bugs.webkit.org/show_bug.cgi?id=141996
+
+        Reviewed by Zalan Bujtas.
+
+        ScrollableArea/ScrollView/FrameView had some confusing terminology around
+        contentsResized/visibleContentsResized/fixedLayoutSizeChanged.
+        
+        Clarify this by distinguishing between:
+        1. Available size changes because of
+            i) non-overlay scrollbar presence
+           ii) ScrollableArea frame change
+        2. Removing fixedLayoutSizeChanged() and just treating it like an
+           available size change.
+           
+        contentsResized() is relegated to simply being a hook that allows Mac to
+        flash overlay scrollbars.
+        
+        The confusingly named visibleContentsResized() is now updateContentsSize(),
+        and is the way that a ScrollableArea tells its subclasss that it should recompute
+        the size of the contents (i.e. do a layout).
+
+        * WebProcess/Plugins/PDF/PDFPlugin.mm:
+        (WebKit::PDFPlugin::scrollbarStyleChanged): Call the base class method,
+        which takes care of 
+
+2015-02-24  Simon Fraser  &lt;simon.fraser@apple.com&gt;
+
</ins><span class="cx">         Use an enum for scrollbar style
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=141985
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessPluginsPDFPDFPluginmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Plugins/PDF/PDFPlugin.mm (180614 => 180615)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Plugins/PDF/PDFPlugin.mm        2015-02-25 05:11:36 UTC (rev 180614)
+++ trunk/Source/WebKit2/WebProcess/Plugins/PDF/PDFPlugin.mm        2015-02-25 05:35:38 UTC (rev 180615)
</span><span class="lines">@@ -724,7 +724,7 @@
</span><span class="cx"> ScrollableArea* PDFPlugin::enclosingScrollableArea() const
</span><span class="cx"> {
</span><span class="cx">     // FIXME: Walk up the frame tree and look for a scrollable parent frame or RenderLayer.
</span><del>-    return 0;
</del><ins>+    return nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> IntRect PDFPlugin::scrollableAreaBoundingBox() const
</span><span class="lines">@@ -797,10 +797,9 @@
</span><span class="cx">     IntPoint newScrollOffset = IntPoint(m_scrollOffset).shrunkTo(maximumScrollPosition());
</span><span class="cx">     setScrollOffset(newScrollOffset);
</span><span class="cx">     
</span><ins>+    ScrollableArea::scrollbarStyleChanged(style, forceUpdate);
</ins><span class="cx">     // As size of the content area changes, scrollbars may need to appear or to disappear.
</span><span class="cx">     updateScrollbars();
</span><del>-    
-    ScrollableArea::contentsResized();
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PDFPlugin::addArchiveResource()
</span></span></pre>
</div>
</div>

</body>
</html>