<!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>[243905] trunk/Source/WebCore</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/243905">243905</a></dd>
<dt>Author</dt> <dd>simon.fraser@apple.com</dd>
<dt>Date</dt> <dd>2019-04-04 14:10:29 -0700 (Thu, 04 Apr 2019)</dd>
</dl>

<h3>Log Message</h3>
<pre>Move "inProgrammaticScroll" down to ScrollableArea
https://bugs.webkit.org/show_bug.cgi?id=196614

Reviewed by Zalan Bujtas.

A future patch will need to update "inProgrammaticScroll" on RenderLayers, so push
inProgrammaticScroll() down to ScrollableArea.

ScrollableArea already has "isScrolledProgrammatically", which I rename to "scrollShouldClearLatchedState"
to reduce confusion. It might be possible to remove this in future with some refactoring.

Sadly we can no longer use SetForScope<> in FrameView after this change so add some manual save/restore code.

* dom/Element.cpp:
(WebCore::Element::setScrollLeft):
(WebCore::Element::setScrollTop):
* page/EventHandler.cpp:
(WebCore::EventHandler::completeWidgetWheelEvent):
(WebCore::EventHandler::handleWheelEvent):
* page/FrameView.cpp:
(WebCore::FrameView::setFrameRect):
(WebCore::FrameView::topContentInsetDidChange):
(WebCore::FrameView::updateLayoutViewport):
(WebCore::FrameView::setScrollPosition):
(WebCore::FrameView::setWasScrolledByUser):
* page/FrameView.h:
* platform/ScrollView.h:
(WebCore::ScrollView::inProgrammaticScroll const): Deleted.
* platform/ScrollableArea.cpp:
(WebCore::ScrollableArea::ScrollableArea):
* platform/ScrollableArea.h:
(WebCore::ScrollableArea::inProgrammaticScroll const):
(WebCore::ScrollableArea::setInProgrammaticScroll):
(WebCore::ScrollableArea::scrollShouldClearLatchedState const):
(WebCore::ScrollableArea::setScrollShouldClearLatchedState):
(WebCore::ScrollableArea::isScrolledProgrammatically const): Deleted.
(WebCore::ScrollableArea::setScrolledProgrammatically): Deleted.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoredomElementcpp">trunk/Source/WebCore/dom/Element.cpp</a></li>
<li><a href="#trunkSourceWebCorepageEventHandlercpp">trunk/Source/WebCore/page/EventHandler.cpp</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="#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>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (243904 => 243905)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2019-04-04 20:54:02 UTC (rev 243904)
+++ trunk/Source/WebCore/ChangeLog      2019-04-04 21:10:29 UTC (rev 243905)
</span><span class="lines">@@ -1,3 +1,43 @@
</span><ins>+2019-04-04  Simon Fraser  <simon.fraser@apple.com>
+
+        Move "inProgrammaticScroll" down to ScrollableArea
+        https://bugs.webkit.org/show_bug.cgi?id=196614
+
+        Reviewed by Zalan Bujtas.
+
+        A future patch will need to update "inProgrammaticScroll" on RenderLayers, so push
+        inProgrammaticScroll() down to ScrollableArea.
+
+        ScrollableArea already has "isScrolledProgrammatically", which I rename to "scrollShouldClearLatchedState"
+        to reduce confusion. It might be possible to remove this in future with some refactoring.
+
+        Sadly we can no longer use SetForScope<> in FrameView after this change so add some manual save/restore code.
+
+        * dom/Element.cpp:
+        (WebCore::Element::setScrollLeft):
+        (WebCore::Element::setScrollTop):
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::completeWidgetWheelEvent):
+        (WebCore::EventHandler::handleWheelEvent):
+        * page/FrameView.cpp:
+        (WebCore::FrameView::setFrameRect):
+        (WebCore::FrameView::topContentInsetDidChange):
+        (WebCore::FrameView::updateLayoutViewport):
+        (WebCore::FrameView::setScrollPosition):
+        (WebCore::FrameView::setWasScrolledByUser):
+        * page/FrameView.h:
+        * platform/ScrollView.h:
+        (WebCore::ScrollView::inProgrammaticScroll const): Deleted.
+        * platform/ScrollableArea.cpp:
+        (WebCore::ScrollableArea::ScrollableArea):
+        * platform/ScrollableArea.h:
+        (WebCore::ScrollableArea::inProgrammaticScroll const):
+        (WebCore::ScrollableArea::setInProgrammaticScroll):
+        (WebCore::ScrollableArea::scrollShouldClearLatchedState const):
+        (WebCore::ScrollableArea::setScrollShouldClearLatchedState):
+        (WebCore::ScrollableArea::isScrolledProgrammatically const): Deleted.
+        (WebCore::ScrollableArea::setScrolledProgrammatically): Deleted.
+
</ins><span class="cx"> 2019-04-04  Sihui Liu  <sihui_liu@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Leak of UniqueIDBDatabase in network process running layout tests
</span></span></pre></div>
<a id="trunkSourceWebCoredomElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Element.cpp (243904 => 243905)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Element.cpp     2019-04-04 20:54:02 UTC (rev 243904)
+++ trunk/Source/WebCore/dom/Element.cpp        2019-04-04 21:10:29 UTC (rev 243905)
</span><span class="lines">@@ -1140,7 +1140,7 @@
</span><span class="cx">     if (auto* renderer = renderBox()) {
</span><span class="cx">         renderer->setScrollLeft(static_cast<int>(newLeft * renderer->style().effectiveZoom()), ScrollType::Programmatic);
</span><span class="cx">         if (auto* scrollableArea = renderer->layer())
</span><del>-            scrollableArea->setScrolledProgrammatically(true);
</del><ins>+            scrollableArea->setScrollShouldClearLatchedState(true);
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1157,7 +1157,7 @@
</span><span class="cx">     if (auto* renderer = renderBox()) {
</span><span class="cx">         renderer->setScrollTop(static_cast<int>(newTop * renderer->style().effectiveZoom()), ScrollType::Programmatic);
</span><span class="cx">         if (auto* scrollableArea = renderer->layer())
</span><del>-            scrollableArea->setScrolledProgrammatically(true);
</del><ins>+            scrollableArea->setScrollShouldClearLatchedState(true);
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepageEventHandlercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/EventHandler.cpp (243904 => 243905)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/EventHandler.cpp       2019-04-04 20:54:02 UTC (rev 243904)
+++ trunk/Source/WebCore/page/EventHandler.cpp  2019-04-04 21:10:29 UTC (rev 243905)
</span><span class="lines">@@ -2749,7 +2749,7 @@
</span><span class="cx">         return false;
</span><span class="cx">     
</span><span class="cx">     if (scrollableArea)
</span><del>-        scrollableArea->setScrolledProgrammatically(false);
</del><ins>+        scrollableArea->setScrollShouldClearLatchedState(false);
</ins><span class="cx"> 
</span><span class="cx">     platformNotifyIfEndGesture(event, scrollableArea);
</span><span class="cx"> 
</span><span class="lines">@@ -2812,10 +2812,10 @@
</span><span class="cx"> 
</span><span class="cx">         if (!element->dispatchWheelEvent(adjustedEvent)) {
</span><span class="cx">             m_isHandlingWheelEvent = false;
</span><del>-            if (scrollableArea && scrollableArea->isScrolledProgrammatically()) {
</del><ins>+            if (scrollableArea && scrollableArea->scrollShouldClearLatchedState()) {
</ins><span class="cx">                 // Web developer is controlling scrolling, so don't attempt to latch.
</span><span class="cx">                 clearLatchedState();
</span><del>-                scrollableArea->setScrolledProgrammatically(false);
</del><ins>+                scrollableArea->setScrollShouldClearLatchedState(false);
</ins><span class="cx">             }
</span><span class="cx"> 
</span><span class="cx">             platformNotifyIfEndGesture(adjustedEvent, scrollableArea);
</span><span class="lines">@@ -2824,7 +2824,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (scrollableArea)
</span><del>-        scrollableArea->setScrolledProgrammatically(false);
</del><ins>+        scrollableArea->setScrollShouldClearLatchedState(false);
</ins><span class="cx"> 
</span><span class="cx">     bool handledEvent = platformCompleteWheelEvent(adjustedEvent, scrollableContainer.get(), scrollableArea);
</span><span class="cx">     platformNotifyIfEndGesture(adjustedEvent, scrollableArea);
</span></span></pre></div>
<a id="trunkSourceWebCorepageFrameViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/FrameView.cpp (243904 => 243905)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/FrameView.cpp  2019-04-04 20:54:02 UTC (rev 243904)
+++ trunk/Source/WebCore/page/FrameView.cpp     2019-04-04 21:10:29 UTC (rev 243905)
</span><span class="lines">@@ -460,7 +460,8 @@
</span><span class="cx">     if (newRect == oldRect)
</span><span class="cx">         return;
</span><span class="cx">     // Every scroll that happens as the result of frame size change is programmatic.
</span><del>-    SetForScope<bool> changeInProgrammaticScroll(m_inProgrammaticScroll, true);
</del><ins>+    bool wasInProgrammaticScroll = inProgrammaticScroll();
+    setInProgrammaticScroll(true);
</ins><span class="cx">     ScrollView::setFrameRect(newRect);
</span><span class="cx"> 
</span><span class="cx">     updateScrollableAreaSet();
</span><span class="lines">@@ -474,6 +475,7 @@
</span><span class="cx">         frame().page()->pageOverlayController().didChangeViewSize();
</span><span class="cx"> 
</span><span class="cx">     viewportContentsChanged();
</span><ins>+    setInProgrammaticScroll(wasInProgrammaticScroll);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool FrameView::scheduleAnimation()
</span><span class="lines">@@ -1090,7 +1092,8 @@
</span><span class="cx">     
</span><span class="cx">     layoutContext().layout();
</span><span class="cx">     // Every scroll that happens as the result of content inset change is programmatic.
</span><del>-    SetForScope<bool> changeInProgrammaticScroll(m_inProgrammaticScroll, true);
</del><ins>+    bool wasInProgrammaticScroll = inProgrammaticScroll();
+    setInProgrammaticScroll(true);
</ins><span class="cx">     updateScrollbars(scrollPosition());
</span><span class="cx">     if (renderView->usesCompositing())
</span><span class="cx">         renderView->compositor().frameViewDidChangeSize();
</span><span class="lines">@@ -1097,6 +1100,8 @@
</span><span class="cx"> 
</span><span class="cx">     if (TiledBacking* tiledBacking = this->tiledBacking())
</span><span class="cx">         tiledBacking->setTopContentInset(newTopContentInset);
</span><ins>+
+    setInProgrammaticScroll(wasInProgrammaticScroll);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void FrameView::topContentDirectionDidChange()
</span><span class="lines">@@ -1670,7 +1675,7 @@
</span><span class="cx">     LOG_WITH_STREAM(Scrolling, stream << "stable origins: min: " << minStableLayoutViewportOrigin() << " max: "<< maxStableLayoutViewportOrigin());
</span><span class="cx">     
</span><span class="cx">     if (m_layoutViewportOverrideRect) {
</span><del>-        if (m_inProgrammaticScroll) {
</del><ins>+        if (inProgrammaticScroll()) {
</ins><span class="cx">             LOG_WITH_STREAM(Scrolling, stream << "computing new override layout viewport because of programmatic scrolling");
</span><span class="cx">             LayoutPoint newOrigin = computeLayoutViewportOrigin(visualViewportRect(), minStableLayoutViewportOrigin(), maxStableLayoutViewportOrigin(), layoutViewport, StickToDocumentBounds);
</span><span class="cx">             setLayoutViewportOverrideRect(LayoutRect(newOrigin, m_layoutViewportOverrideRect.value().size()));
</span><span class="lines">@@ -2274,7 +2279,9 @@
</span><span class="cx"> {
</span><span class="cx">     LOG_WITH_STREAM(Scrolling, stream << "FrameView::setScrollPosition " << scrollPosition << " , clearing anchor");
</span><span class="cx"> 
</span><del>-    SetForScope<bool> changeInProgrammaticScroll(m_inProgrammaticScroll, true);
</del><ins>+    bool wasInProgrammaticScroll = inProgrammaticScroll();
+    setInProgrammaticScroll(true);
+
</ins><span class="cx">     m_maintainScrollPositionAnchor = nullptr;
</span><span class="cx">     m_shouldScrollToFocusedElement = false;
</span><span class="cx">     m_delayedScrollToFocusedElementTimer.stop();
</span><span class="lines">@@ -2282,6 +2289,8 @@
</span><span class="cx">     if (page && page->expectsWheelEventTriggers())
</span><span class="cx">         scrollAnimator().setWheelEventTestTrigger(page->testTrigger());
</span><span class="cx">     ScrollView::setScrollPosition(scrollPosition);
</span><ins>+
+    setInProgrammaticScroll(wasInProgrammaticScroll);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void FrameView::resetScrollAnchor()
</span><span class="lines">@@ -4100,7 +4109,7 @@
</span><span class="cx"> 
</span><span class="cx">     m_shouldScrollToFocusedElement = false;
</span><span class="cx">     m_delayedScrollToFocusedElementTimer.stop();
</span><del>-    if (m_inProgrammaticScroll)
</del><ins>+    if (inProgrammaticScroll())
</ins><span class="cx">         return;
</span><span class="cx">     m_maintainScrollPositionAnchor = nullptr;
</span><span class="cx">     if (m_wasScrolledByUser == wasScrolledByUser)
</span></span></pre></div>
<a id="trunkSourceWebCorepageFrameViewh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/FrameView.h (243904 => 243905)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/FrameView.h    2019-04-04 20:54:02 UTC (rev 243904)
+++ trunk/Source/WebCore/page/FrameView.h       2019-04-04 21:10:29 UTC (rev 243905)
</span><span class="lines">@@ -555,9 +555,6 @@
</span><span class="cx">     const Pagination& pagination() const;
</span><span class="cx">     void setPagination(const Pagination&);
</span><span class="cx">     
</span><del>-    bool inProgrammaticScroll() const final { return m_inProgrammaticScroll; }
-    void setInProgrammaticScroll(bool programmaticScroll) { m_inProgrammaticScroll = programmaticScroll; }
-
</del><span class="cx"> #if ENABLE(CSS_DEVICE_ADAPTATION)
</span><span class="cx">     IntSize initialViewportSize() const { return m_initialViewportSize; }
</span><span class="cx">     void setInitialViewportSize(const IntSize& size) { m_initialViewportSize = size; }
</span><span class="lines">@@ -923,7 +920,6 @@
</span><span class="cx"> 
</span><span class="cx">     bool m_isTrackingRepaints { false }; // Used for testing.
</span><span class="cx">     bool m_wasScrolledByUser { false };
</span><del>-    bool m_inProgrammaticScroll { false };
</del><span class="cx">     bool m_shouldScrollToFocusedElement { false };
</span><span class="cx"> 
</span><span class="cx">     bool m_isPainting { false };
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformScrollViewh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ScrollView.h (243904 => 243905)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ScrollView.h       2019-04-04 20:54:02 UTC (rev 243904)
+++ trunk/Source/WebCore/platform/ScrollView.h  2019-04-04 21:10:29 UTC (rev 243905)
</span><span class="lines">@@ -196,8 +196,6 @@
</span><span class="cx">     LegacyTileCache* legacyTileCache();
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    virtual bool inProgrammaticScroll() const { return false; }
-
</del><span class="cx">     // Size available for view contents, including content inset areas. Not affected by zooming.
</span><span class="cx">     IntSize sizeForVisibleContent(VisibleContentRectIncludesScrollbars = ExcludeScrollbars) const;
</span><span class="cx">     // FIXME: remove this. It's only used for the incorrectly behaving ScrollView::unobscuredContentRectInternal().
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformScrollableAreacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ScrollableArea.cpp (243904 => 243905)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ScrollableArea.cpp 2019-04-04 20:54:02 UTC (rev 243904)
+++ trunk/Source/WebCore/platform/ScrollableArea.cpp    2019-04-04 21:10:29 UTC (rev 243905)
</span><span class="lines">@@ -66,7 +66,8 @@
</span><span class="cx">     , m_horizontalScrollElasticity(ScrollElasticityNone)
</span><span class="cx">     , m_scrollbarOverlayStyle(ScrollbarOverlayStyleDefault)
</span><span class="cx">     , m_scrollOriginChanged(false)
</span><del>-    , m_scrolledProgrammatically(false)
</del><ins>+    , m_inProgrammaticScroll(false)
+    , m_scrollShouldClearLatchedState(false)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformScrollableAreah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ScrollableArea.h (243904 => 243905)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ScrollableArea.h   2019-04-04 20:54:02 UTC (rev 243904)
+++ trunk/Source/WebCore/platform/ScrollableArea.h      2019-04-04 21:10:29 UTC (rev 243905)
</span><span class="lines">@@ -228,9 +228,12 @@
</span><span class="cx">     WEBCORE_EXPORT virtual bool scrolledToLeft() const;
</span><span class="cx">     WEBCORE_EXPORT virtual bool scrolledToRight() const;
</span><span class="cx"> 
</span><del>-    bool isScrolledProgrammatically() const { return m_scrolledProgrammatically; }
-    void setScrolledProgrammatically(bool state) { m_scrolledProgrammatically = state; }
</del><ins>+    bool inProgrammaticScroll() const { return m_inProgrammaticScroll; }
+    void setInProgrammaticScroll(bool inProgrammaticScroll) { m_inProgrammaticScroll = inProgrammaticScroll; }
</ins><span class="cx"> 
</span><ins>+    bool scrollShouldClearLatchedState() const { return m_scrollShouldClearLatchedState; }
+    void setScrollShouldClearLatchedState(bool shouldClear) { m_scrollShouldClearLatchedState = shouldClear; }
+
</ins><span class="cx">     enum VisibleContentRectIncludesScrollbars { ExcludeScrollbars, IncludeScrollbars };
</span><span class="cx">     enum VisibleContentRectBehavior {
</span><span class="cx">         ContentsVisibleRect,
</span><span class="lines">@@ -391,7 +394,8 @@
</span><span class="cx">     unsigned m_scrollbarOverlayStyle : 2; // ScrollbarOverlayStyle
</span><span class="cx"> 
</span><span class="cx">     unsigned m_scrollOriginChanged : 1;
</span><del>-    unsigned m_scrolledProgrammatically : 1;
</del><ins>+    unsigned m_inProgrammaticScroll : 1;
+    unsigned m_scrollShouldClearLatchedState : 1;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre>
</div>
</div>

</body>
</html>