<!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>[285640] 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/285640">285640</a></dd>
<dt>Author</dt> <dd>nmouchtaris@apple.com</dd>
<dt>Date</dt> <dd>2021-11-11 10:31:29 -0800 (Thu, 11 Nov 2021)</dd>
</dl>

<h3>Log Message</h3>
<pre>Make scroll granularity an enum class
https://bugs.webkit.org/show_bug.cgi?id=232641

Reviewed by Cameron McCormack.

Source/WebCore:

* dom/Element.cpp:
(WebCore::Element::scrollByLines):
(WebCore::Element::scrollByPages):
* editing/EditorCommand.cpp:
(WebCore::executeScrollPageBackward):
(WebCore::executeScrollPageForward):
(WebCore::executeScrollLineUp):
(WebCore::executeScrollLineDown):
(WebCore::executeScrollToBeginningOfDocument):
(WebCore::executeScrollToEndOfDocument):
* page/EventHandler.cpp:
(WebCore::wheelGranularityToScrollGranularity):
(WebCore::EventHandler::logicalScrollRecursively):
(WebCore::EventHandler::defaultSpaceEventHandler):
(WebCore::EventHandler::scrollDistance):
* page/FrameView.cpp:
(WebCore::FrameView::adjustScrollStepForFixedContent):
* platform/KeyboardScrollingAnimator.cpp:
(WebCore::KeyboardScrollingAnimator::scrollDistance const):
(WebCore::KeyboardScrollingAnimator::keyboardScrollForKeyboardEvent const):
(WebCore::KeyboardScrollingAnimator::beginKeyboardScrollGesture):
* platform/ScrollAnimator.cpp:
(WebCore::ScrollAnimator::handleWheelEvent):
* platform/ScrollTypes.h:
* platform/ScrollableArea.cpp:
(WebCore::ScrollableArea::scroll):
* platform/Scrollbar.cpp:
(WebCore::Scrollbar::pressedPartScrollGranularity):
* platform/ios/ScrollAnimatorIOS.mm:
(WebCore::ScrollAnimatorIOS::handleTouchEvent):
* platform/win/PopupMenuWin.cpp:
(WebCore::PopupMenuWin::wndProc):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::logicalScroll):

Source/WebKit:

* Scripts/webkit/messages.py:
(headers_for_type):
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView keyboardScrollViewAnimator:distanceForIncrement:inDirection:]):
* UIProcess/ios/WKKeyboardScrollingAnimator.mm:
(-[WKKeyboardScrollingAnimator keyboardScrollForEvent:]):
(-[WKKeyboardScrollingAnimator beginWithEvent:]):
(-[WKKeyboardScrollViewAnimator distanceForIncrement:inDirection:]):
* UIProcess/win/WebPopupMenuProxyWin.cpp:
(WebKit::WebPopupMenuProxyWin::onMouseWheel):
* UIProcess/win/WebView.cpp:
(WebKit::WebView::onHorizontalScroll):
(WebKit::WebView::onVerticalScroll):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::scrollBy):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/gtk/WebPageGtk.cpp:
(WebKit::WebPage::performDefaultBehaviorForKeyEvent):
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::performNonEditingBehaviorForSelector):
* WebProcess/WebPage/win/WebPageWin.cpp:
(WebKit::WebPage::performDefaultBehaviorForKeyEvent):

Source/WebKitLegacy/mac:

* WebView/WebFrameView.mm:
(-[WebFrameView _scrollToBeginningOfDocument]):
(-[WebFrameView _scrollToEndOfDocument]):
(-[WebFrameView _pageVertically:]):
(-[WebFrameView _pageHorizontally:]):
(-[WebFrameView _scrollLineVertically:]):
(-[WebFrameView _scrollLineHorizontally:]):

Source/WebKitLegacy/win:

* WebView.cpp:
(WebView::verticalScroll):
(WebView::horizontalScroll):
(WebView::keyDown):</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="#trunkSourceWebCoreeditingEditorCommandcpp">trunk/Source/WebCore/editing/EditorCommand.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="#trunkSourceWebCoreplatformKeyboardScrollingAnimatorcpp">trunk/Source/WebCore/platform/KeyboardScrollingAnimator.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformScrollAnimatorcpp">trunk/Source/WebCore/platform/ScrollAnimator.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformScrollTypesh">trunk/Source/WebCore/platform/ScrollTypes.h</a></li>
<li><a href="#trunkSourceWebCoreplatformScrollableAreacpp">trunk/Source/WebCore/platform/ScrollableArea.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformScrollbarcpp">trunk/Source/WebCore/platform/Scrollbar.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformiosScrollAnimatorIOSmm">trunk/Source/WebCore/platform/ios/ScrollAnimatorIOS.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformwinPopupMenuWincpp">trunk/Source/WebCore/platform/win/PopupMenuWin.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBoxcpp">trunk/Source/WebCore/rendering/RenderBox.cpp</a></li>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitScriptswebkitmessagespy">trunk/Source/WebKit/Scripts/webkit/messages.py</a></li>
<li><a href="#trunkSourceWebKitUIProcessiosWKContentViewInteractionmm">trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm</a></li>
<li><a href="#trunkSourceWebKitUIProcessiosWKKeyboardScrollingAnimatormm">trunk/Source/WebKit/UIProcess/ios/WKKeyboardScrollingAnimator.mm</a></li>
<li><a href="#trunkSourceWebKitUIProcesswinWebPopupMenuProxyWincpp">trunk/Source/WebKit/UIProcess/win/WebPopupMenuProxyWin.cpp</a></li>
<li><a href="#trunkSourceWebKitUIProcesswinWebViewcpp">trunk/Source/WebKit/UIProcess/win/WebView.cpp</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebPageWebPagecpp">trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebPageWebPageh">trunk/Source/WebKit/WebProcess/WebPage/WebPage.h</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebPageWebPagemessagesin">trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebPagegtkWebPageGtkcpp">trunk/Source/WebKit/WebProcess/WebPage/gtk/WebPageGtk.cpp</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebPagemacWebPageMacmm">trunk/Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebPagewinWebPageWincpp">trunk/Source/WebKit/WebProcess/WebPage/win/WebPageWin.cpp</a></li>
<li><a href="#trunkSourceWebKitLegacymacChangeLog">trunk/Source/WebKitLegacy/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitLegacymacWebViewWebFrameViewmm">trunk/Source/WebKitLegacy/mac/WebView/WebFrameView.mm</a></li>
<li><a href="#trunkSourceWebKitLegacywinChangeLog">trunk/Source/WebKitLegacy/win/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitLegacywinWebViewcpp">trunk/Source/WebKitLegacy/win/WebView.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (285639 => 285640)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2021-11-11 18:29:14 UTC (rev 285639)
+++ trunk/Source/WebCore/ChangeLog      2021-11-11 18:31:29 UTC (rev 285640)
</span><span class="lines">@@ -1,3 +1,45 @@
</span><ins>+2021-11-11  Nikolaos Mouchtaris  <nmouchtaris@apple.com>
+
+        Make scroll granularity an enum class
+        https://bugs.webkit.org/show_bug.cgi?id=232641
+
+        Reviewed by Cameron McCormack.
+
+        * dom/Element.cpp:
+        (WebCore::Element::scrollByLines):
+        (WebCore::Element::scrollByPages):
+        * editing/EditorCommand.cpp:
+        (WebCore::executeScrollPageBackward):
+        (WebCore::executeScrollPageForward):
+        (WebCore::executeScrollLineUp):
+        (WebCore::executeScrollLineDown):
+        (WebCore::executeScrollToBeginningOfDocument):
+        (WebCore::executeScrollToEndOfDocument):
+        * page/EventHandler.cpp:
+        (WebCore::wheelGranularityToScrollGranularity):
+        (WebCore::EventHandler::logicalScrollRecursively):
+        (WebCore::EventHandler::defaultSpaceEventHandler):
+        (WebCore::EventHandler::scrollDistance):
+        * page/FrameView.cpp:
+        (WebCore::FrameView::adjustScrollStepForFixedContent):
+        * platform/KeyboardScrollingAnimator.cpp:
+        (WebCore::KeyboardScrollingAnimator::scrollDistance const):
+        (WebCore::KeyboardScrollingAnimator::keyboardScrollForKeyboardEvent const):
+        (WebCore::KeyboardScrollingAnimator::beginKeyboardScrollGesture):
+        * platform/ScrollAnimator.cpp:
+        (WebCore::ScrollAnimator::handleWheelEvent):
+        * platform/ScrollTypes.h:
+        * platform/ScrollableArea.cpp:
+        (WebCore::ScrollableArea::scroll):
+        * platform/Scrollbar.cpp:
+        (WebCore::Scrollbar::pressedPartScrollGranularity):
+        * platform/ios/ScrollAnimatorIOS.mm:
+        (WebCore::ScrollAnimatorIOS::handleTouchEvent):
+        * platform/win/PopupMenuWin.cpp:
+        (WebCore::PopupMenuWin::wndProc):
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::logicalScroll):
+
</ins><span class="cx"> 2021-11-11  Alexey Shvayka  <ashvayka@apple.com>
</span><span class="cx"> 
</span><span class="cx">         JSCallbackData should use lexical global object for errors and lifecycle
</span></span></pre></div>
<a id="trunkSourceWebCoredomElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Element.cpp (285639 => 285640)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Element.cpp     2021-11-11 18:29:14 UTC (rev 285639)
+++ trunk/Source/WebCore/dom/Element.cpp        2021-11-11 18:31:29 UTC (rev 285640)
</span><span class="lines">@@ -1128,12 +1128,12 @@
</span><span class="cx"> 
</span><span class="cx"> void Element::scrollByLines(int lines)
</span><span class="cx"> {
</span><del>-    scrollByUnits(lines, ScrollByLine);
</del><ins>+    scrollByUnits(lines, ScrollGranularity::Line);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Element::scrollByPages(int pages)
</span><span class="cx"> {
</span><del>-    scrollByUnits(pages, ScrollByPage);
</del><ins>+    scrollByUnits(pages, ScrollGranularity::Page);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static double localZoomForRenderer(const RenderElement& renderer)
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingEditorCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/EditorCommand.cpp (285639 => 285640)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/EditorCommand.cpp   2021-11-11 18:29:14 UTC (rev 285639)
+++ trunk/Source/WebCore/editing/EditorCommand.cpp      2021-11-11 18:31:29 UTC (rev 285640)
</span><span class="lines">@@ -989,32 +989,32 @@
</span><span class="cx"> 
</span><span class="cx"> static bool executeScrollPageBackward(Frame& frame, Event*, EditorCommandSource, const String&)
</span><span class="cx"> {
</span><del>-    return frame.eventHandler().logicalScrollRecursively(ScrollBlockDirectionBackward, ScrollByPage);
</del><ins>+    return frame.eventHandler().logicalScrollRecursively(ScrollBlockDirectionBackward, ScrollGranularity::Page);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static bool executeScrollPageForward(Frame& frame, Event*, EditorCommandSource, const String&)
</span><span class="cx"> {
</span><del>-    return frame.eventHandler().logicalScrollRecursively(ScrollBlockDirectionForward, ScrollByPage);
</del><ins>+    return frame.eventHandler().logicalScrollRecursively(ScrollBlockDirectionForward, ScrollGranularity::Page);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static bool executeScrollLineUp(Frame& frame, Event*, EditorCommandSource, const String&)
</span><span class="cx"> {
</span><del>-    return frame.eventHandler().scrollRecursively(ScrollUp, ScrollByLine);
</del><ins>+    return frame.eventHandler().scrollRecursively(ScrollUp, ScrollGranularity::Line);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static bool executeScrollLineDown(Frame& frame, Event*, EditorCommandSource, const String&)
</span><span class="cx"> {
</span><del>-    return frame.eventHandler().scrollRecursively(ScrollDown, ScrollByLine);
</del><ins>+    return frame.eventHandler().scrollRecursively(ScrollDown, ScrollGranularity::Line);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static bool executeScrollToBeginningOfDocument(Frame& frame, Event*, EditorCommandSource, const String&)
</span><span class="cx"> {
</span><del>-    return frame.eventHandler().logicalScrollRecursively(ScrollBlockDirectionBackward, ScrollByDocument);
</del><ins>+    return frame.eventHandler().logicalScrollRecursively(ScrollBlockDirectionBackward, ScrollGranularity::Document);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static bool executeScrollToEndOfDocument(Frame& frame, Event*, EditorCommandSource, const String&)
</span><span class="cx"> {
</span><del>-    return frame.eventHandler().logicalScrollRecursively(ScrollBlockDirectionForward, ScrollByDocument);
</del><ins>+    return frame.eventHandler().logicalScrollRecursively(ScrollBlockDirectionForward, ScrollGranularity::Document);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static bool executeSelectAll(Frame& frame, Event*, EditorCommandSource, const String&)
</span></span></pre></div>
<a id="trunkSourceWebCorepageEventHandlercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/EventHandler.cpp (285639 => 285640)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/EventHandler.cpp       2021-11-11 18:29:14 UTC (rev 285639)
+++ trunk/Source/WebCore/page/EventHandler.cpp  2021-11-11 18:31:29 UTC (rev 285640)
</span><span class="lines">@@ -298,13 +298,13 @@
</span><span class="cx"> {
</span><span class="cx">     switch (deltaMode) {
</span><span class="cx">     case WheelEvent::DOM_DELTA_PAGE:
</span><del>-        return ScrollByPage;
</del><ins>+        return ScrollGranularity::Page;
</ins><span class="cx">     case WheelEvent::DOM_DELTA_LINE:
</span><del>-        return ScrollByLine;
</del><ins>+        return ScrollGranularity::Line;
</ins><span class="cx">     case WheelEvent::DOM_DELTA_PIXEL:
</span><del>-        return ScrollByPixel;
</del><ins>+        return ScrollGranularity::Pixel;
</ins><span class="cx">     default:
</span><del>-        return ScrollByPixel;
</del><ins>+        return ScrollGranularity::Pixel;
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1287,7 +1287,7 @@
</span><span class="cx">     bool scrolled = false;
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx">     // Mac also resets the scroll position in the inline direction.
</span><del>-    if (granularity == ScrollByDocument && view && view->logicalScroll(ScrollInlineDirectionBackward, ScrollByDocument))
</del><ins>+    if (granularity == ScrollGranularity::Document && view && view->logicalScroll(ScrollInlineDirectionBackward, ScrollGranularity::Document))
</ins><span class="cx">         scrolled = true;
</span><span class="cx"> #endif
</span><span class="cx">     if (view && view->logicalScroll(direction, granularity))
</span><span class="lines">@@ -4248,7 +4248,7 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     ScrollLogicalDirection direction = event.shiftKey() ? ScrollBlockDirectionBackward : ScrollBlockDirectionForward;
</span><del>-    if (logicalScrollOverflow(direction, ScrollByPage)) {
</del><ins>+    if (logicalScrollOverflow(direction, ScrollGranularity::Page)) {
</ins><span class="cx">         event.setDefaultHandled();
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="lines">@@ -4257,7 +4257,7 @@
</span><span class="cx">     if (!view)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    bool defaultHandled = m_frame.settings().eventHandlerDrivenSmoothKeyboardScrollingEnabled() ? startKeyboardScrolling(event) : view->logicalScroll(direction, ScrollByPage);
</del><ins>+    bool defaultHandled = m_frame.settings().eventHandlerDrivenSmoothKeyboardScrollingEnabled() ? startKeyboardScrolling(event) : view->logicalScroll(direction, ScrollGranularity::Page);
</ins><span class="cx">     if (defaultHandled)
</span><span class="cx">         event.setDefaultHandled();
</span><span class="cx"> }
</span><span class="lines">@@ -4299,13 +4299,13 @@
</span><span class="cx">     }();
</span><span class="cx"> 
</span><span class="cx">     switch (granularity) {
</span><del>-    case ScrollGranularity::ScrollByLine:
</del><ins>+    case ScrollGranularity::Line:
</ins><span class="cx">         return scrollbar->lineStep();
</span><del>-    case ScrollGranularity::ScrollByPage:
</del><ins>+    case ScrollGranularity::Page:
</ins><span class="cx">         return scrollbar->pageStep();
</span><del>-    case ScrollGranularity::ScrollByDocument:
</del><ins>+    case ScrollGranularity::Document:
</ins><span class="cx">         return scrollbar->totalSize();
</span><del>-    case ScrollGranularity::ScrollByPixel:
</del><ins>+    case ScrollGranularity::Pixel:
</ins><span class="cx">         return scrollbar->pixelStep();
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepageFrameViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/FrameView.cpp (285639 => 285640)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/FrameView.cpp  2021-11-11 18:29:14 UTC (rev 285639)
+++ trunk/Source/WebCore/page/FrameView.cpp     2021-11-11 18:31:29 UTC (rev 285640)
</span><span class="lines">@@ -3836,7 +3836,7 @@
</span><span class="cx"> 
</span><span class="cx"> float FrameView::adjustScrollStepForFixedContent(float step, ScrollbarOrientation orientation, ScrollGranularity granularity)
</span><span class="cx"> {
</span><del>-    if (granularity != ScrollByPage || orientation == ScrollbarOrientation::Horizontal)
</del><ins>+    if (granularity != ScrollGranularity::Page || orientation == ScrollbarOrientation::Horizontal)
</ins><span class="cx">         return step;
</span><span class="cx"> 
</span><span class="cx">     TrackedRendererListHashSet* positionedObjects = nullptr;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformKeyboardScrollingAnimatorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/KeyboardScrollingAnimator.cpp (285639 => 285640)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/KeyboardScrollingAnimator.cpp      2021-11-11 18:29:14 UTC (rev 285639)
+++ trunk/Source/WebCore/platform/KeyboardScrollingAnimator.cpp 2021-11-11 18:31:29 UTC (rev 285640)
</span><span class="lines">@@ -155,13 +155,13 @@
</span><span class="cx"> 
</span><span class="cx">     if (scrollbar) {
</span><span class="cx">         switch (granularity) {
</span><del>-        case ScrollGranularity::ScrollByLine:
</del><ins>+        case ScrollGranularity::Line:
</ins><span class="cx">             return scrollbar->lineStep();
</span><del>-        case ScrollGranularity::ScrollByPage:
</del><ins>+        case ScrollGranularity::Page:
</ins><span class="cx">             return scrollbar->pageStep();
</span><del>-        case ScrollGranularity::ScrollByDocument:
</del><ins>+        case ScrollGranularity::Document:
</ins><span class="cx">             return scrollbar->totalSize();
</span><del>-        case ScrollGranularity::ScrollByPixel:
</del><ins>+        case ScrollGranularity::Pixel:
</ins><span class="cx">             return scrollbar->pixelStep();
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -202,18 +202,18 @@
</span><span class="cx">         switch (key.value()) {
</span><span class="cx">         case KeyboardScrollingKey::LeftArrow:
</span><span class="cx">         case KeyboardScrollingKey::RightArrow:
</span><del>-            return event.altKey() ? ScrollGranularity::ScrollByPage : ScrollGranularity::ScrollByLine;
</del><ins>+            return event.altKey() ? ScrollGranularity::Page : ScrollGranularity::Line;
</ins><span class="cx">         case KeyboardScrollingKey::UpArrow:
</span><span class="cx">         case KeyboardScrollingKey::DownArrow:
</span><span class="cx">             if (event.metaKey())
</span><del>-                return ScrollGranularity::ScrollByDocument;
</del><ins>+                return ScrollGranularity::Document;
</ins><span class="cx">             if (event.altKey())
</span><del>-                return ScrollGranularity::ScrollByPage;
-            return ScrollGranularity::ScrollByLine;
</del><ins>+                return ScrollGranularity::Page;
+            return ScrollGranularity::Line;
</ins><span class="cx">         case KeyboardScrollingKey::Space:
</span><span class="cx">         case KeyboardScrollingKey::PageUp:
</span><span class="cx">         case KeyboardScrollingKey::PageDown:
</span><del>-            return ScrollGranularity::ScrollByPage;
</del><ins>+            return ScrollGranularity::Page;
</ins><span class="cx">         };
</span><span class="cx">         RELEASE_ASSERT_NOT_REACHED();
</span><span class="cx">     }();
</span><span class="lines">@@ -267,7 +267,7 @@
</span><span class="cx">     if (m_scrollTriggeringKeyIsPressed)
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    if (m_currentKeyboardScroll->granularity == ScrollGranularity::ScrollByDocument) {
</del><ins>+    if (m_currentKeyboardScroll->granularity == ScrollGranularity::Document) {
</ins><span class="cx">         m_velocity = { };
</span><span class="cx">         stopKeyboardScrollAnimation();
</span><span class="cx">         auto newPosition = IntPoint(m_scrollAnimator.currentPosition() + m_currentKeyboardScroll->offset);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformScrollAnimatorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ScrollAnimator.cpp (285639 => 285640)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ScrollAnimator.cpp 2021-11-11 18:29:14 UTC (rev 285639)
+++ trunk/Source/WebCore/platform/ScrollAnimator.cpp    2021-11-11 18:31:29 UTC (rev 285640)
</span><span class="lines">@@ -217,7 +217,7 @@
</span><span class="cx">                 if (negative)
</span><span class="cx">                     deltaY = -deltaY;
</span><span class="cx">             }
</span><del>-            scroll(ScrollbarOrientation::Vertical, ScrollByPixel, verticalScrollbar->pixelStep(), -deltaY, behavior);
</del><ins>+            scroll(ScrollbarOrientation::Vertical, ScrollGranularity::Pixel, verticalScrollbar->pixelStep(), -deltaY, behavior);
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         if (deltaX) {
</span><span class="lines">@@ -227,7 +227,7 @@
</span><span class="cx">                 if (negative)
</span><span class="cx">                     deltaX = -deltaX;
</span><span class="cx">             }
</span><del>-            scroll(ScrollbarOrientation::Horizontal, ScrollByPixel, horizontalScrollbar->pixelStep(), -deltaX, behavior);
</del><ins>+            scroll(ScrollbarOrientation::Horizontal, ScrollGranularity::Pixel, horizontalScrollbar->pixelStep(), -deltaX, behavior);
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx">     return handled;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformScrollTypesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ScrollTypes.h (285639 => 285640)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ScrollTypes.h      2021-11-11 18:29:14 UTC (rev 285639)
+++ trunk/Source/WebCore/platform/ScrollTypes.h 2021-11-11 18:31:29 UTC (rev 285640)
</span><span class="lines">@@ -130,11 +130,11 @@
</span><span class="cx">     return ScrollUp;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-enum ScrollGranularity : uint8_t {
-    ScrollByLine,
-    ScrollByPage,
-    ScrollByDocument,
-    ScrollByPixel
</del><ins>+enum class ScrollGranularity : uint8_t {
+    Line,
+    Page,
+    Document,
+    Pixel
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> enum class ScrollElasticity : uint8_t {
</span><span class="lines">@@ -330,4 +330,13 @@
</span><span class="cx">     >;
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+template<> struct EnumTraits<WebCore::ScrollGranularity> {
+    using values = EnumValues<
+        WebCore::ScrollGranularity,
+        WebCore::ScrollGranularity::Line,
+        WebCore::ScrollGranularity::Page,
+        WebCore::ScrollGranularity::Document,
+        WebCore::ScrollGranularity::Pixel
+    >;
+};
</ins><span class="cx"> } // namespace WTF
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformScrollableAreacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ScrollableArea.cpp (285639 => 285640)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ScrollableArea.cpp 2021-11-11 18:29:14 UTC (rev 285639)
+++ trunk/Source/WebCore/platform/ScrollableArea.cpp    2021-11-11 18:31:29 UTC (rev 285640)
</span><span class="lines">@@ -113,16 +113,16 @@
</span><span class="cx"> 
</span><span class="cx">     float step = 0;
</span><span class="cx">     switch (granularity) {
</span><del>-    case ScrollByLine:
</del><ins>+    case ScrollGranularity::Line:
</ins><span class="cx">         step = scrollbar->lineStep();
</span><span class="cx">         break;
</span><del>-    case ScrollByPage:
</del><ins>+    case ScrollGranularity::Page:
</ins><span class="cx">         step = scrollbar->pageStep();
</span><span class="cx">         break;
</span><del>-    case ScrollByDocument:
</del><ins>+    case ScrollGranularity::Document:
</ins><span class="cx">         step = scrollbar->totalSize();
</span><span class="cx">         break;
</span><del>-    case ScrollByPixel:
</del><ins>+    case ScrollGranularity::Pixel:
</ins><span class="cx">         step = scrollbar->pixelStep();
</span><span class="cx">         break;
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformScrollbarcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/Scrollbar.cpp (285639 => 285640)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/Scrollbar.cpp      2021-11-11 18:29:14 UTC (rev 285639)
+++ trunk/Source/WebCore/platform/Scrollbar.cpp 2021-11-11 18:31:29 UTC (rev 285640)
</span><span class="lines">@@ -234,8 +234,8 @@
</span><span class="cx"> ScrollGranularity Scrollbar::pressedPartScrollGranularity()
</span><span class="cx"> {
</span><span class="cx">     if (m_pressedPart == BackButtonStartPart || m_pressedPart == BackButtonEndPart ||  m_pressedPart == ForwardButtonStartPart || m_pressedPart == ForwardButtonEndPart)
</span><del>-        return ScrollByLine;
-    return ScrollByPage;
</del><ins>+        return ScrollGranularity::Line;
+    return ScrollGranularity::Page;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Scrollbar::moveThumb(int pos, bool draggingDocument)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformiosScrollAnimatorIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ios/ScrollAnimatorIOS.mm (285639 => 285640)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/ScrollAnimatorIOS.mm   2021-11-11 18:29:14 UTC (rev 285639)
+++ trunk/Source/WebCore/platform/ios/ScrollAnimatorIOS.mm      2021-11-11 18:31:29 UTC (rev 285640)
</span><span class="lines">@@ -139,13 +139,13 @@
</span><span class="cx">     // Horizontal
</span><span class="cx">     if (m_touchScrollAxisLatch != AxisLatchVertical) {
</span><span class="cx">         int delta = touchDelta.width();
</span><del>-        handled |= m_scrollableAreaForTouchSequence->scroll(delta < 0 ? ScrollLeft : ScrollRight, ScrollByPixel, abs(delta));
</del><ins>+        handled |= m_scrollableAreaForTouchSequence->scroll(delta < 0 ? ScrollLeft : ScrollRight, ScrollGranularity::Pixel, abs(delta));
</ins><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     // Vertical
</span><span class="cx">     if (m_touchScrollAxisLatch != AxisLatchHorizontal) {
</span><span class="cx">         int delta = touchDelta.height();
</span><del>-        handled |= m_scrollableAreaForTouchSequence->scroll(delta < 0 ? ScrollUp : ScrollDown, ScrollByPixel, abs(delta));
</del><ins>+        handled |= m_scrollableAreaForTouchSequence->scroll(delta < 0 ? ScrollUp : ScrollDown, ScrollGranularity::Pixel, abs(delta));
</ins><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     // Return false until we manage to scroll at all, and then keep returning true until the gesture ends.
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformwinPopupMenuWincpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/win/PopupMenuWin.cpp (285639 => 285640)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/win/PopupMenuWin.cpp       2021-11-11 18:29:14 UTC (rev 285639)
+++ trunk/Source/WebCore/platform/win/PopupMenuWin.cpp  2021-11-11 18:31:29 UTC (rev 285640)
</span><span class="lines">@@ -1060,7 +1060,7 @@
</span><span class="cx">                     --i;
</span><span class="cx">             }
</span><span class="cx"> 
</span><del>-            ScrollableArea::scroll(i > 0 ? ScrollUp : ScrollDown, ScrollByLine, abs(i));
</del><ins>+            ScrollableArea::scroll(i > 0 ? ScrollUp : ScrollDown, ScrollGranularity::Line, abs(i));
</ins><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (285639 => 285640)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBox.cpp     2021-11-11 18:29:14 UTC (rev 285639)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp        2021-11-11 18:31:29 UTC (rev 285640)
</span><span class="lines">@@ -929,8 +929,8 @@
</span><span class="cx">     if (auto* scrollableArea = layer() ? layer()->scrollableArea() : nullptr) {
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx">         // On Mac only we reset the inline direction position when doing a document scroll (e.g., hitting Home/End).
</span><del>-        if (granularity == ScrollByDocument)
-            scrolled = scrollableArea->scroll(logicalToPhysical(ScrollInlineDirectionBackward, isHorizontalWritingMode(), style().isFlippedBlocksWritingMode()), ScrollByDocument, multiplier);
</del><ins>+        if (granularity == ScrollGranularity::Document)
+            scrolled = scrollableArea->scroll(logicalToPhysical(ScrollInlineDirectionBackward, isHorizontalWritingMode(), style().isFlippedBlocksWritingMode()), ScrollGranularity::Document, multiplier);
</ins><span class="cx"> #endif
</span><span class="cx">         if (scrollableArea->scroll(logicalToPhysical(direction, isHorizontalWritingMode(), style().isFlippedBlocksWritingMode()), granularity, multiplier))
</span><span class="cx">             scrolled = true;
</span></span></pre></div>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (285639 => 285640)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog    2021-11-11 18:29:14 UTC (rev 285639)
+++ trunk/Source/WebKit/ChangeLog       2021-11-11 18:31:29 UTC (rev 285640)
</span><span class="lines">@@ -1,3 +1,34 @@
</span><ins>+2021-11-11  Nikolaos Mouchtaris  <nmouchtaris@apple.com>
+
+        Make scroll granularity an enum class
+        https://bugs.webkit.org/show_bug.cgi?id=232641
+
+        Reviewed by Cameron McCormack.
+
+        * Scripts/webkit/messages.py:
+        (headers_for_type):
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView keyboardScrollViewAnimator:distanceForIncrement:inDirection:]):
+        * UIProcess/ios/WKKeyboardScrollingAnimator.mm:
+        (-[WKKeyboardScrollingAnimator keyboardScrollForEvent:]):
+        (-[WKKeyboardScrollingAnimator beginWithEvent:]):
+        (-[WKKeyboardScrollViewAnimator distanceForIncrement:inDirection:]):
+        * UIProcess/win/WebPopupMenuProxyWin.cpp:
+        (WebKit::WebPopupMenuProxyWin::onMouseWheel):
+        * UIProcess/win/WebView.cpp:
+        (WebKit::WebView::onHorizontalScroll):
+        (WebKit::WebView::onVerticalScroll):
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::scrollBy):
+        * WebProcess/WebPage/WebPage.h:
+        * WebProcess/WebPage/WebPage.messages.in:
+        * WebProcess/WebPage/gtk/WebPageGtk.cpp:
+        (WebKit::WebPage::performDefaultBehaviorForKeyEvent):
+        * WebProcess/WebPage/mac/WebPageMac.mm:
+        (WebKit::WebPage::performNonEditingBehaviorForSelector):
+        * WebProcess/WebPage/win/WebPageWin.cpp:
+        (WebKit::WebPage::performDefaultBehaviorForKeyEvent):
+
</ins><span class="cx"> 2021-11-11  Carlos Garcia Campos  <cgarcia@igalia.com>
</span><span class="cx"> 
</span><span class="cx">         Drop support for <object usemap> making <object> interactive
</span></span></pre></div>
<a id="trunkSourceWebKitScriptswebkitmessagespy"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Scripts/webkit/messages.py (285639 => 285640)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Scripts/webkit/messages.py   2021-11-11 18:29:14 UTC (rev 285639)
+++ trunk/Source/WebKit/Scripts/webkit/messages.py      2021-11-11 18:31:29 UTC (rev 285640)
</span><span class="lines">@@ -763,6 +763,7 @@
</span><span class="cx">         'WebCore::RouteSharingPolicy': ['<WebCore/AudioSession.h>'],
</span><span class="cx">         'WebCore::SWServerConnectionIdentifier': ['<WebCore/ServiceWorkerTypes.h>'],
</span><span class="cx">         'WebCore::SameSiteStrictEnforcementEnabled': ['<WebCore/NetworkStorageSession.h>'],
</span><ins>+        'WebCore::ScrollGranularity': ['<WebCore/ScrollTypes.h>'],
</ins><span class="cx">         'WebCore::SecurityPolicyViolationEventInit': ['<WebCore/SecurityPolicyViolationEvent.h>'],
</span><span class="cx">         'WebCore::SelectionDirection': ['<WebCore/VisibleSelection.h>'],
</span><span class="cx">         'WebCore::SelectionGeometry': ['"EditorState.h"'],
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessiosWKContentViewInteractionmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (285639 => 285640)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm    2021-11-11 18:29:14 UTC (rev 285639)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm       2021-11-11 18:31:29 UTC (rev 285640)
</span><span class="lines">@@ -5932,17 +5932,17 @@
</span><span class="cx">     BOOL directionIsHorizontal = direction == WebCore::ScrollDirection::ScrollLeft || direction == WebCore::ScrollDirection::ScrollRight;
</span><span class="cx"> 
</span><span class="cx">     switch (increment) {
</span><del>-    case WebCore::ScrollGranularity::ScrollByDocument: {
</del><ins>+    case WebCore::ScrollGranularity::Document: {
</ins><span class="cx">         CGSize documentSize = [self convertRect:self.bounds toView:self.webView].size;
</span><span class="cx">         return directionIsHorizontal ? documentSize.width : documentSize.height;
</span><span class="cx">     }
</span><del>-    case WebCore::ScrollGranularity::ScrollByPage: {
</del><ins>+    case WebCore::ScrollGranularity::Page: {
</ins><span class="cx">         CGSize pageSize = [self convertSize:CGSizeMake(0, WebCore::Scrollbar::pageStep(_page->unobscuredContentRect().height(), self.bounds.size.height)) toView:self.webView];
</span><span class="cx">         return directionIsHorizontal ? pageSize.width : pageSize.height;
</span><span class="cx">     }
</span><del>-    case WebCore::ScrollGranularity::ScrollByLine:
</del><ins>+    case WebCore::ScrollGranularity::Line:
</ins><span class="cx">         return [self convertSize:CGSizeMake(0, WebCore::Scrollbar::pixelsPerLineStep()) toView:self.webView].height;
</span><del>-    case WebCore::ScrollGranularity::ScrollByPixel:
</del><ins>+    case WebCore::ScrollGranularity::Pixel:
</ins><span class="cx">         return 0;
</span><span class="cx">     }
</span><span class="cx">     ASSERT_NOT_REACHED();
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessiosWKKeyboardScrollingAnimatormm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/ios/WKKeyboardScrollingAnimator.mm (285639 => 285640)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/ios/WKKeyboardScrollingAnimator.mm 2021-11-11 18:29:14 UTC (rev 285639)
+++ trunk/Source/WebKit/UIProcess/ios/WKKeyboardScrollingAnimator.mm    2021-11-11 18:31:29 UTC (rev 285640)
</span><span class="lines">@@ -219,22 +219,22 @@
</span><span class="cx">         case Key::LeftArrow:
</span><span class="cx">         case Key::RightArrow:
</span><span class="cx">             if (altPressed)
</span><del>-                return WebCore::ScrollGranularity::ScrollByPage;
-            return WebCore::ScrollGranularity::ScrollByLine;
</del><ins>+                return WebCore::ScrollGranularity::Page;
+            return WebCore::ScrollGranularity::Line;
</ins><span class="cx">         case Key::UpArrow:
</span><span class="cx">         case Key::DownArrow:
</span><span class="cx">             if (altPressed)
</span><del>-                return WebCore::ScrollGranularity::ScrollByPage;
</del><ins>+                return WebCore::ScrollGranularity::Page;
</ins><span class="cx">             if (cmdPressed)
</span><del>-                return WebCore::ScrollGranularity::ScrollByDocument;
-            return WebCore::ScrollGranularity::ScrollByLine;
</del><ins>+                return WebCore::ScrollGranularity::Document;
+            return WebCore::ScrollGranularity::Line;
</ins><span class="cx">         case Key::PageUp:
</span><span class="cx">         case Key::PageDown:
</span><span class="cx">         case Key::Space:
</span><del>-            return WebCore::ScrollGranularity::ScrollByPage;
</del><ins>+            return WebCore::ScrollGranularity::Page;
</ins><span class="cx">         case Key::Other:
</span><span class="cx">             ASSERT_NOT_REACHED();
</span><del>-            return WebCore::ScrollGranularity::ScrollByLine;
</del><ins>+            return WebCore::ScrollGranularity::Line;
</ins><span class="cx">         };
</span><span class="cx">     }();
</span><span class="cx"> 
</span><span class="lines">@@ -293,7 +293,7 @@
</span><span class="cx">     _scrollTriggeringKeyIsPressed = YES;
</span><span class="cx">     _currentScroll = scroll;
</span><span class="cx"> 
</span><del>-    if (scroll->granularity == WebCore::ScrollGranularity::ScrollByDocument) {
</del><ins>+    if (scroll->granularity == WebCore::ScrollGranularity::Document) {
</ins><span class="cx">         _velocity = { };
</span><span class="cx">         [self stopAnimatedScroll];
</span><span class="cx">         [self stopDisplayLink];
</span><span class="lines">@@ -545,13 +545,13 @@
</span><span class="cx"> 
</span><span class="cx">     if (!_delegateRespondsToDistanceForIncrement) {
</span><span class="cx">         switch (increment) {
</span><del>-        case WebCore::ScrollGranularity::ScrollByDocument:
</del><ins>+        case WebCore::ScrollGranularity::Document:
</ins><span class="cx">             return directionIsHorizontal ? scrollView.contentSize.width : scrollView.contentSize.height;
</span><del>-        case WebCore::ScrollGranularity::ScrollByPage:
</del><ins>+        case WebCore::ScrollGranularity::Page:
</ins><span class="cx">             return (directionIsHorizontal ? scrollView.frame.size.width : scrollView.frame.size.height) * defaultPageScrollFraction;
</span><del>-        case WebCore::ScrollGranularity::ScrollByLine:
</del><ins>+        case WebCore::ScrollGranularity::Line:
</ins><span class="cx">             return defaultLineScrollHeight * scrollView.zoomScale;
</span><del>-        case WebCore::ScrollGranularity::ScrollByPixel:
</del><ins>+        case WebCore::ScrollGranularity::Pixel:
</ins><span class="cx">             return 0;
</span><span class="cx">         }
</span><span class="cx">         ASSERT_NOT_REACHED();
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcesswinWebPopupMenuProxyWincpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/win/WebPopupMenuProxyWin.cpp (285639 => 285640)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/win/WebPopupMenuProxyWin.cpp       2021-11-11 18:29:14 UTC (rev 285639)
+++ trunk/Source/WebKit/UIProcess/win/WebPopupMenuProxyWin.cpp  2021-11-11 18:31:29 UTC (rev 285640)
</span><span class="lines">@@ -763,7 +763,7 @@
</span><span class="cx">             --i;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    ScrollableArea::scroll(i > 0 ? ScrollUp : ScrollDown, ScrollByLine, abs(i));
</del><ins>+    ScrollableArea::scroll(i > 0 ? ScrollUp : ScrollDown, ScrollGranularity::Line, abs(i));
</ins><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcesswinWebViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/win/WebView.cpp (285639 => 285640)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/win/WebView.cpp    2021-11-11 18:29:14 UTC (rev 285639)
+++ trunk/Source/WebKit/UIProcess/win/WebView.cpp       2021-11-11 18:31:29 UTC (rev 285640)
</span><span class="lines">@@ -401,19 +401,19 @@
</span><span class="cx">     ScrollGranularity granularity;
</span><span class="cx">     switch (LOWORD(wParam)) {
</span><span class="cx">     case SB_LINELEFT:
</span><del>-        granularity = ScrollByLine;
</del><ins>+        granularity = ScrollGranularity::Line;
</ins><span class="cx">         direction = ScrollLeft;
</span><span class="cx">         break;
</span><span class="cx">     case SB_LINERIGHT:
</span><del>-        granularity = ScrollByLine;
</del><ins>+        granularity = ScrollGranularity::Line;
</ins><span class="cx">         direction = ScrollRight;
</span><span class="cx">         break;
</span><span class="cx">     case SB_PAGELEFT:
</span><del>-        granularity = ScrollByDocument;
</del><ins>+        granularity = ScrollGranularity::Document;
</ins><span class="cx">         direction = ScrollLeft;
</span><span class="cx">         break;
</span><span class="cx">     case SB_PAGERIGHT:
</span><del>-        granularity = ScrollByDocument;
</del><ins>+        granularity = ScrollGranularity::Document;
</ins><span class="cx">         direction = ScrollRight;
</span><span class="cx">         break;
</span><span class="cx">     default:
</span><span class="lines">@@ -433,19 +433,19 @@
</span><span class="cx">     ScrollGranularity granularity;
</span><span class="cx">     switch (LOWORD(wParam)) {
</span><span class="cx">     case SB_LINEDOWN:
</span><del>-        granularity = ScrollByLine;
</del><ins>+        granularity = ScrollGranularity::Line;
</ins><span class="cx">         direction = ScrollDown;
</span><span class="cx">         break;
</span><span class="cx">     case SB_LINEUP:
</span><del>-        granularity = ScrollByLine;
</del><ins>+        granularity = ScrollGranularity::Line;
</ins><span class="cx">         direction = ScrollUp;
</span><span class="cx">         break;
</span><span class="cx">     case SB_PAGEDOWN:
</span><del>-        granularity = ScrollByDocument;
</del><ins>+        granularity = ScrollGranularity::Document;
</ins><span class="cx">         direction = ScrollDown;
</span><span class="cx">         break;
</span><span class="cx">     case SB_PAGEUP:
</span><del>-        granularity = ScrollByDocument;
</del><ins>+        granularity = ScrollGranularity::Document;
</ins><span class="cx">         direction = ScrollUp;
</span><span class="cx">         break;
</span><span class="cx">     default:
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebPageWebPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp (285639 => 285640)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp       2021-11-11 18:29:14 UTC (rev 285639)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp  2021-11-11 18:31:29 UTC (rev 285640)
</span><span class="lines">@@ -3305,7 +3305,7 @@
</span><span class="cx">     return page->userInputBridge().logicalScrollRecursively(direction, granularity);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool WebPage::scrollBy(uint32_t scrollDirection, uint32_t scrollGranularity)
</del><ins>+bool WebPage::scrollBy(uint32_t scrollDirection, WebCore::ScrollGranularity scrollGranularity)
</ins><span class="cx"> {
</span><span class="cx">     return scroll(m_page.get(), static_cast<ScrollDirection>(scrollDirection), static_cast<ScrollGranularity>(scrollGranularity));
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebPageWebPageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.h (285639 => 285640)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.h 2021-11-11 18:29:14 UTC (rev 285639)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.h    2021-11-11 18:31:29 UTC (rev 285640)
</span><span class="lines">@@ -383,7 +383,7 @@
</span><span class="cx"> 
</span><span class="cx">     void scrollMainFrameIfNotAtMaxScrollPosition(const WebCore::IntSize& scrollOffset);
</span><span class="cx"> 
</span><del>-    bool scrollBy(uint32_t scrollDirection, uint32_t scrollGranularity);
</del><ins>+    bool scrollBy(uint32_t scrollDirection, WebCore::ScrollGranularity);
</ins><span class="cx"> 
</span><span class="cx">     void centerSelectionInVisibleArea();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebPageWebPagemessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in (285639 => 285640)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in       2021-11-11 18:29:14 UTC (rev 285639)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in  2021-11-11 18:31:29 UTC (rev 285640)
</span><span class="lines">@@ -168,7 +168,7 @@
</span><span class="cx">     DidEndDateTimePicker();
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    ScrollBy(uint32_t scrollDirection, uint32_t scrollGranularity)
</del><ins>+    ScrollBy(uint32_t scrollDirection, enum:uint8_t WebCore::ScrollGranularity scrollGranularity)
</ins><span class="cx">     CenterSelectionInVisibleArea()
</span><span class="cx"> 
</span><span class="cx">     GoToBackForwardItem(uint64_t navigationID, struct WebCore::BackForwardItemIdentifier backForwardItemID, enum:uint8_t WebCore::FrameLoadType backForwardType, enum:uint8_t WebCore::ShouldTreatAsContinuingLoad shouldTreatAsContinuingLoad, std::optional<WebKit::WebsitePoliciesData> websitePolicies, bool lastNavigationWasAppInitiated)
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebPagegtkWebPageGtkcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebPage/gtk/WebPageGtk.cpp (285639 => 285640)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebPage/gtk/WebPageGtk.cpp        2021-11-11 18:29:14 UTC (rev 285639)
+++ trunk/Source/WebKit/WebProcess/WebPage/gtk/WebPageGtk.cpp   2021-11-11 18:31:29 UTC (rev 285640)
</span><span class="lines">@@ -104,31 +104,31 @@
</span><span class="cx"> 
</span><span class="cx">     switch (keyboardEvent.windowsVirtualKeyCode()) {
</span><span class="cx">     case VK_SPACE:
</span><del>-        scroll(m_page.get(), keyboardEvent.shiftKey() ? ScrollUp : ScrollDown, ScrollByPage);
</del><ins>+        scroll(m_page.get(), keyboardEvent.shiftKey() ? ScrollUp : ScrollDown, ScrollGranularity::Page);
</ins><span class="cx">         break;
</span><span class="cx">     case VK_LEFT:
</span><del>-        scroll(m_page.get(), ScrollLeft, ScrollByLine);
</del><ins>+        scroll(m_page.get(), ScrollLeft, ScrollGranularity::Line);
</ins><span class="cx">         break;
</span><span class="cx">     case VK_RIGHT:
</span><del>-        scroll(m_page.get(), ScrollRight, ScrollByLine);
</del><ins>+        scroll(m_page.get(), ScrollRight, ScrollGranularity::Line);
</ins><span class="cx">         break;
</span><span class="cx">     case VK_UP:
</span><del>-        scroll(m_page.get(), ScrollUp, ScrollByLine);
</del><ins>+        scroll(m_page.get(), ScrollUp, ScrollGranularity::Line);
</ins><span class="cx">         break;
</span><span class="cx">     case VK_DOWN:
</span><del>-        scroll(m_page.get(), ScrollDown, ScrollByLine);
</del><ins>+        scroll(m_page.get(), ScrollDown, ScrollGranularity::Line);
</ins><span class="cx">         break;
</span><span class="cx">     case VK_HOME:
</span><del>-        scroll(m_page.get(), ScrollUp, ScrollByDocument);
</del><ins>+        scroll(m_page.get(), ScrollUp, ScrollGranularity::Document);
</ins><span class="cx">         break;
</span><span class="cx">     case VK_END:
</span><del>-        scroll(m_page.get(), ScrollDown, ScrollByDocument);
</del><ins>+        scroll(m_page.get(), ScrollDown, ScrollGranularity::Document);
</ins><span class="cx">         break;
</span><span class="cx">     case VK_PRIOR:
</span><del>-        scroll(m_page.get(), ScrollUp, ScrollByPage);
</del><ins>+        scroll(m_page.get(), ScrollUp, ScrollGranularity::Page);
</ins><span class="cx">         break;
</span><span class="cx">     case VK_NEXT:
</span><del>-        scroll(m_page.get(), ScrollDown, ScrollByPage);
</del><ins>+        scroll(m_page.get(), ScrollDown, ScrollGranularity::Page);
</ins><span class="cx">         break;
</span><span class="cx">     default:
</span><span class="cx">         return false;
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebPagemacWebPageMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm (285639 => 285640)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm 2021-11-11 18:29:14 UTC (rev 285639)
+++ trunk/Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm    2021-11-11 18:31:29 UTC (rev 285640)
</span><span class="lines">@@ -467,27 +467,27 @@
</span><span class="cx">     
</span><span class="cx">     if (!frame->settings().eventHandlerDrivenSmoothKeyboardScrollingEnabled()) {
</span><span class="cx">         if (selector == "moveUp:")
</span><del>-            didPerformAction = scroll(m_page.get(), ScrollUp, ScrollByLine);
</del><ins>+            didPerformAction = scroll(m_page.get(), ScrollUp, ScrollGranularity::Line);
</ins><span class="cx">         else if (selector == "moveToBeginningOfParagraph:")
</span><del>-            didPerformAction = scroll(m_page.get(), ScrollUp, ScrollByPage);
</del><ins>+            didPerformAction = scroll(m_page.get(), ScrollUp, ScrollGranularity::Page);
</ins><span class="cx">         else if (selector == "moveToBeginningOfDocument:") {
</span><del>-            didPerformAction = scroll(m_page.get(), ScrollUp, ScrollByDocument);
-            didPerformAction |= scroll(m_page.get(), ScrollLeft, ScrollByDocument);
</del><ins>+            didPerformAction = scroll(m_page.get(), ScrollUp, ScrollGranularity::Document);
+            didPerformAction |= scroll(m_page.get(), ScrollLeft, ScrollGranularity::Document);
</ins><span class="cx">         } else if (selector == "moveDown:")
</span><del>-            didPerformAction = scroll(m_page.get(), ScrollDown, ScrollByLine);
</del><ins>+            didPerformAction = scroll(m_page.get(), ScrollDown, ScrollGranularity::Line);
</ins><span class="cx">         else if (selector == "moveToEndOfParagraph:")
</span><del>-            didPerformAction = scroll(m_page.get(), ScrollDown, ScrollByPage);
</del><ins>+            didPerformAction = scroll(m_page.get(), ScrollDown, ScrollGranularity::Page);
</ins><span class="cx">         else if (selector == "moveToEndOfDocument:") {
</span><del>-            didPerformAction = scroll(m_page.get(), ScrollDown, ScrollByDocument);
-            didPerformAction |= scroll(m_page.get(), ScrollLeft, ScrollByDocument);
</del><ins>+            didPerformAction = scroll(m_page.get(), ScrollDown, ScrollGranularity::Document);
+            didPerformAction |= scroll(m_page.get(), ScrollLeft, ScrollGranularity::Document);
</ins><span class="cx">         } else if (selector == "moveLeft:")
</span><del>-            didPerformAction = scroll(m_page.get(), ScrollLeft, ScrollByLine);
</del><ins>+            didPerformAction = scroll(m_page.get(), ScrollLeft, ScrollGranularity::Line);
</ins><span class="cx">         else if (selector == "moveWordLeft:")
</span><del>-            didPerformAction = scroll(m_page.get(), ScrollLeft, ScrollByPage);
</del><ins>+            didPerformAction = scroll(m_page.get(), ScrollLeft, ScrollGranularity::Page);
</ins><span class="cx">         else if (selector == "moveRight:")
</span><del>-            didPerformAction = scroll(m_page.get(), ScrollRight, ScrollByLine);
</del><ins>+            didPerformAction = scroll(m_page.get(), ScrollRight, ScrollGranularity::Line);
</ins><span class="cx">         else if (selector == "moveWordRight:")
</span><del>-            didPerformAction = scroll(m_page.get(), ScrollRight, ScrollByPage);
</del><ins>+            didPerformAction = scroll(m_page.get(), ScrollRight, ScrollGranularity::Page);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (selector == "moveToLeftEndOfLine:")
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebPagewinWebPageWincpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebPage/win/WebPageWin.cpp (285639 => 285640)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebPage/win/WebPageWin.cpp        2021-11-11 18:29:14 UTC (rev 285639)
+++ trunk/Source/WebKit/WebProcess/WebPage/win/WebPageWin.cpp   2021-11-11 18:31:29 UTC (rev 285640)
</span><span class="lines">@@ -75,28 +75,28 @@
</span><span class="cx"> 
</span><span class="cx">     switch (keyboardEvent.windowsVirtualKeyCode()) {
</span><span class="cx">     case VK_LEFT:
</span><del>-        scroll(m_page.get(), ScrollLeft, ScrollByLine);
</del><ins>+        scroll(m_page.get(), ScrollLeft, ScrollGranularity::Line);
</ins><span class="cx">         break;
</span><span class="cx">     case VK_RIGHT:
</span><del>-        scroll(m_page.get(), ScrollRight, ScrollByLine);
</del><ins>+        scroll(m_page.get(), ScrollRight, ScrollGranularity::Line);
</ins><span class="cx">         break;
</span><span class="cx">     case VK_UP:
</span><del>-        scroll(m_page.get(), ScrollUp, ScrollByLine);
</del><ins>+        scroll(m_page.get(), ScrollUp, ScrollGranularity::Line);
</ins><span class="cx">         break;
</span><span class="cx">     case VK_DOWN:
</span><del>-        scroll(m_page.get(), ScrollDown, ScrollByLine);
</del><ins>+        scroll(m_page.get(), ScrollDown, ScrollGranularity::Line);
</ins><span class="cx">         break;
</span><span class="cx">     case VK_HOME:
</span><del>-        scroll(m_page.get(), ScrollUp, ScrollByDocument);
</del><ins>+        scroll(m_page.get(), ScrollUp, ScrollGranularity::Document);
</ins><span class="cx">         break;
</span><span class="cx">     case VK_END:
</span><del>-        scroll(m_page.get(), ScrollDown, ScrollByDocument);
</del><ins>+        scroll(m_page.get(), ScrollDown, ScrollGranularity::Document);
</ins><span class="cx">         break;
</span><span class="cx">     case VK_PRIOR:
</span><del>-        scroll(m_page.get(), ScrollUp, ScrollByPage);
</del><ins>+        scroll(m_page.get(), ScrollUp, ScrollGranularity::Page);
</ins><span class="cx">         break;
</span><span class="cx">     case VK_NEXT:
</span><del>-        scroll(m_page.get(), ScrollDown, ScrollByPage);
</del><ins>+        scroll(m_page.get(), ScrollDown, ScrollGranularity::Page);
</ins><span class="cx">         break;
</span><span class="cx">     default:
</span><span class="cx">         return false;
</span></span></pre></div>
<a id="trunkSourceWebKitLegacymacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (285639 => 285640)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKitLegacy/mac/ChangeLog  2021-11-11 18:29:14 UTC (rev 285639)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog     2021-11-11 18:31:29 UTC (rev 285640)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2021-11-11  Nikolaos Mouchtaris  <nmouchtaris@apple.com>
+
+        Make scroll granularity an enum class
+        https://bugs.webkit.org/show_bug.cgi?id=232641
+
+        Reviewed by Cameron McCormack.
+
+        * WebView/WebFrameView.mm:
+        (-[WebFrameView _scrollToBeginningOfDocument]):
+        (-[WebFrameView _scrollToEndOfDocument]):
+        (-[WebFrameView _pageVertically:]):
+        (-[WebFrameView _pageHorizontally:]):
+        (-[WebFrameView _scrollLineVertically:]):
+        (-[WebFrameView _scrollLineHorizontally:]):
+
</ins><span class="cx"> 2021-11-11  Sam Weinig  <weinig@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Factor platform specific code out of HTMLModelElement
</span></span></pre></div>
<a id="trunkSourceWebKitLegacymacWebViewWebFrameViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKitLegacy/mac/WebView/WebFrameView.mm (285639 => 285640)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKitLegacy/mac/WebView/WebFrameView.mm    2021-11-11 18:29:14 UTC (rev 285639)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebFrameView.mm       2021-11-11 18:31:29 UTC (rev 285640)
</span><span class="lines">@@ -633,7 +633,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (BOOL)_scrollToBeginningOfDocument
</span><span class="cx"> {
</span><del>-    if ([self _scrollOverflowInDirection:WebCore::ScrollUp granularity:WebCore::ScrollByDocument])
</del><ins>+    if ([self _scrollOverflowInDirection:WebCore::ScrollUp granularity:WebCore::ScrollGranularity::Document])
</ins><span class="cx">         return YES;
</span><span class="cx">     if (![self _isScrollable])
</span><span class="cx">         return NO;
</span><span class="lines">@@ -645,7 +645,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (BOOL)_scrollToEndOfDocument
</span><span class="cx"> {
</span><del>-    if ([self _scrollOverflowInDirection:WebCore::ScrollDown granularity:WebCore::ScrollByDocument])
</del><ins>+    if ([self _scrollOverflowInDirection:WebCore::ScrollDown granularity:WebCore::ScrollGranularity::Document])
</ins><span class="cx">         return YES;
</span><span class="cx">     if (![self _isScrollable])
</span><span class="cx">         return NO;
</span><span class="lines">@@ -742,7 +742,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (BOOL)_pageVertically:(BOOL)up
</span><span class="cx"> {
</span><del>-    if ([self _scrollOverflowInDirection:up ? WebCore::ScrollUp : WebCore::ScrollDown granularity:WebCore::ScrollByPage])
</del><ins>+    if ([self _scrollOverflowInDirection:up ? WebCore::ScrollUp : WebCore::ScrollDown granularity:WebCore::ScrollGranularity::Page])
</ins><span class="cx">         return YES;
</span><span class="cx">     
</span><span class="cx">     if (![self _isScrollable])
</span><span class="lines">@@ -754,7 +754,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (BOOL)_pageHorizontally:(BOOL)left
</span><span class="cx"> {
</span><del>-    if ([self _scrollOverflowInDirection:left ? WebCore::ScrollLeft : WebCore::ScrollRight granularity:WebCore::ScrollByPage])
</del><ins>+    if ([self _scrollOverflowInDirection:left ? WebCore::ScrollLeft : WebCore::ScrollRight granularity:WebCore::ScrollGranularity::Page])
</ins><span class="cx">         return YES;
</span><span class="cx"> 
</span><span class="cx">     if (![self _isScrollable])
</span><span class="lines">@@ -776,7 +776,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (BOOL)_scrollLineVertically:(BOOL)up
</span><span class="cx"> {
</span><del>-    if ([self _scrollOverflowInDirection:up ? WebCore::ScrollUp : WebCore::ScrollDown granularity:WebCore::ScrollByLine])
</del><ins>+    if ([self _scrollOverflowInDirection:up ? WebCore::ScrollUp : WebCore::ScrollDown granularity:WebCore::ScrollGranularity::Line])
</ins><span class="cx">         return YES;
</span><span class="cx"> 
</span><span class="cx">     if (![self _isScrollable])
</span><span class="lines">@@ -788,7 +788,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (BOOL)_scrollLineHorizontally:(BOOL)left
</span><span class="cx"> {
</span><del>-    if ([self _scrollOverflowInDirection:left ? WebCore::ScrollLeft : WebCore::ScrollRight granularity:WebCore::ScrollByLine])
</del><ins>+    if ([self _scrollOverflowInDirection:left ? WebCore::ScrollLeft : WebCore::ScrollRight granularity:WebCore::ScrollGranularity::Line])
</ins><span class="cx">         return YES;
</span><span class="cx"> 
</span><span class="cx">     if (![self _isScrollable])
</span></span></pre></div>
<a id="trunkSourceWebKitLegacywinChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKitLegacy/win/ChangeLog (285639 => 285640)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKitLegacy/win/ChangeLog  2021-11-11 18:29:14 UTC (rev 285639)
+++ trunk/Source/WebKitLegacy/win/ChangeLog     2021-11-11 18:31:29 UTC (rev 285640)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2021-11-11  Nikolaos Mouchtaris  <nmouchtaris@apple.com>
+
+        Make scroll granularity an enum class
+        https://bugs.webkit.org/show_bug.cgi?id=232641
+
+        Reviewed by Cameron McCormack.
+
+        * WebView.cpp:
+        (WebView::verticalScroll):
+        (WebView::horizontalScroll):
+        (WebView::keyDown):
+
</ins><span class="cx"> 2021-11-11  Sam Weinig  <weinig@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Factor platform specific code out of HTMLModelElement
</span></span></pre></div>
<a id="trunkSourceWebKitLegacywinWebViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKitLegacy/win/WebView.cpp (285639 => 285640)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKitLegacy/win/WebView.cpp        2021-11-11 18:29:14 UTC (rev 285639)
+++ trunk/Source/WebKitLegacy/win/WebView.cpp   2021-11-11 18:31:29 UTC (rev 285640)
</span><span class="lines">@@ -2085,19 +2085,19 @@
</span><span class="cx">     ScrollGranularity granularity;
</span><span class="cx">     switch (LOWORD(wParam)) {
</span><span class="cx">     case SB_LINEDOWN:
</span><del>-        granularity = ScrollByLine;
</del><ins>+        granularity = ScrollGranularity::Line;
</ins><span class="cx">         direction = ScrollDown;
</span><span class="cx">         break;
</span><span class="cx">     case SB_LINEUP:
</span><del>-        granularity = ScrollByLine;
</del><ins>+        granularity = ScrollGranularity::Line;
</ins><span class="cx">         direction = ScrollUp;
</span><span class="cx">         break;
</span><span class="cx">     case SB_PAGEDOWN:
</span><del>-        granularity = ScrollByDocument;
</del><ins>+        granularity = ScrollGranularity::Document;
</ins><span class="cx">         direction = ScrollDown;
</span><span class="cx">         break;
</span><span class="cx">     case SB_PAGEUP:
</span><del>-        granularity = ScrollByDocument;
</del><ins>+        granularity = ScrollGranularity::Document;
</ins><span class="cx">         direction = ScrollUp;
</span><span class="cx">         break;
</span><span class="cx">     default:
</span><span class="lines">@@ -2115,19 +2115,19 @@
</span><span class="cx">     ScrollGranularity granularity;
</span><span class="cx">     switch (LOWORD(wParam)) {
</span><span class="cx">     case SB_LINELEFT:
</span><del>-        granularity = ScrollByLine;
</del><ins>+        granularity = ScrollGranularity::Line;
</ins><span class="cx">         direction = ScrollLeft;
</span><span class="cx">         break;
</span><span class="cx">     case SB_LINERIGHT:
</span><del>-        granularity = ScrollByLine;
</del><ins>+        granularity = ScrollGranularity::Line;
</ins><span class="cx">         direction = ScrollRight;
</span><span class="cx">         break;
</span><span class="cx">     case SB_PAGELEFT:
</span><del>-        granularity = ScrollByDocument;
</del><ins>+        granularity = ScrollGranularity::Document;
</ins><span class="cx">         direction = ScrollLeft;
</span><span class="cx">         break;
</span><span class="cx">     case SB_PAGERIGHT:
</span><del>-        granularity = ScrollByDocument;
</del><ins>+        granularity = ScrollGranularity::Document;
</ins><span class="cx">         direction = ScrollRight;
</span><span class="cx">         break;
</span><span class="cx">     default:
</span><span class="lines">@@ -2360,35 +2360,35 @@
</span><span class="cx">     ScrollGranularity granularity { };
</span><span class="cx">     switch (virtualKeyCode) {
</span><span class="cx">         case VK_LEFT:
</span><del>-            granularity = ScrollByLine;
</del><ins>+            granularity = ScrollGranularity::Line;
</ins><span class="cx">             direction = ScrollLeft;
</span><span class="cx">             break;
</span><span class="cx">         case VK_RIGHT:
</span><del>-            granularity = ScrollByLine;
</del><ins>+            granularity = ScrollGranularity::Line;
</ins><span class="cx">             direction = ScrollRight;
</span><span class="cx">             break;
</span><span class="cx">         case VK_UP:
</span><del>-            granularity = ScrollByLine;
</del><ins>+            granularity = ScrollGranularity::Line;
</ins><span class="cx">             direction = ScrollUp;
</span><span class="cx">             break;
</span><span class="cx">         case VK_DOWN:
</span><del>-            granularity = ScrollByLine;
</del><ins>+            granularity = ScrollGranularity::Line;
</ins><span class="cx">             direction = ScrollDown;
</span><span class="cx">             break;
</span><span class="cx">         case VK_HOME:
</span><del>-            granularity = ScrollByDocument;
</del><ins>+            granularity = ScrollGranularity::Document;
</ins><span class="cx">             direction = ScrollUp;
</span><span class="cx">             break;
</span><span class="cx">         case VK_END:
</span><del>-            granularity = ScrollByDocument;
</del><ins>+            granularity = ScrollGranularity::Document;
</ins><span class="cx">             direction = ScrollDown;
</span><span class="cx">             break;
</span><span class="cx">         case VK_PRIOR:
</span><del>-            granularity = ScrollByPage;
</del><ins>+            granularity = ScrollGranularity::Page;
</ins><span class="cx">             direction = ScrollUp;
</span><span class="cx">             break;
</span><span class="cx">         case VK_NEXT:
</span><del>-            granularity = ScrollByPage;
</del><ins>+            granularity = ScrollGranularity::Page;
</ins><span class="cx">             direction = ScrollDown;
</span><span class="cx">             break;
</span><span class="cx">         default:
</span></span></pre>
</div>
</div>

</body>
</html>