Title: [272477] trunk/Source/WebCore
Revision
272477
Author
[email protected]
Date
2021-02-07 14:10:39 -0800 (Sun, 07 Feb 2021)

Log Message

Remove a duplicate implementation of EventHandler::mouseDownMayStartSelect()
https://bugs.webkit.org/show_bug.cgi?id=221531

Reviewed by Tim Horton.

Remove the current `bool mouseDownMayStartSelect() const` method which just returns `m_mouseDownMayStartSelect`,
and make the current non-`const` version of the method `const` instead. Since `mouseDownMayStartSelect()` was
only invoked from non-const methods, the former `const` version was unused.

No change in behavior.

* page/EventHandler.cpp:
(WebCore::EventHandler::mouseDownMayStartSelect const):
(WebCore::EventHandler::mouseDownMayStartSelect): Deleted.
* page/EventHandler.h:
(WebCore::EventHandler::mouseDownMayStartSelect const): Deleted.
* page/Page.h:
(WebCore::Page::textInteractionEnabled const):

Make this getter `const`, so that we can call it in `mouseDownMayStartSelect() const`.

(WebCore::Page::textInteractionEnabled): Deleted.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (272476 => 272477)


--- trunk/Source/WebCore/ChangeLog	2021-02-07 20:25:24 UTC (rev 272476)
+++ trunk/Source/WebCore/ChangeLog	2021-02-07 22:10:39 UTC (rev 272477)
@@ -1,3 +1,28 @@
+2021-02-07  Wenson Hsieh  <[email protected]>
+
+        Remove a duplicate implementation of EventHandler::mouseDownMayStartSelect()
+        https://bugs.webkit.org/show_bug.cgi?id=221531
+
+        Reviewed by Tim Horton.
+
+        Remove the current `bool mouseDownMayStartSelect() const` method which just returns `m_mouseDownMayStartSelect`,
+        and make the current non-`const` version of the method `const` instead. Since `mouseDownMayStartSelect()` was
+        only invoked from non-const methods, the former `const` version was unused.
+
+        No change in behavior.
+
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::mouseDownMayStartSelect const):
+        (WebCore::EventHandler::mouseDownMayStartSelect): Deleted.
+        * page/EventHandler.h:
+        (WebCore::EventHandler::mouseDownMayStartSelect const): Deleted.
+        * page/Page.h:
+        (WebCore::Page::textInteractionEnabled const):
+
+        Make this getter `const`, so that we can call it in `mouseDownMayStartSelect() const`.
+
+        (WebCore::Page::textInteractionEnabled): Deleted.
+
 2021-02-07  Sam Weinig  <[email protected]>
 
         Differentiate between color spaces used to tag colors and color spaces used to tag destinations

Modified: trunk/Source/WebCore/page/EventHandler.cpp (272476 => 272477)


--- trunk/Source/WebCore/page/EventHandler.cpp	2021-02-07 20:25:24 UTC (rev 272476)
+++ trunk/Source/WebCore/page/EventHandler.cpp	2021-02-07 22:10:39 UTC (rev 272477)
@@ -701,9 +701,9 @@
     return node->canStartSelection() || Position::nodeIsUserSelectAll(node);
 }
 
-bool EventHandler::mouseDownMayStartSelect()
+bool EventHandler::mouseDownMayStartSelect() const
 {
-    Page* page = m_frame.page();
+    auto* page = m_frame.page();
     if (page && !page->textInteractionEnabled())
         return false;
 

Modified: trunk/Source/WebCore/page/EventHandler.h (272476 => 272477)


--- trunk/Source/WebCore/page/EventHandler.h	2021-02-07 20:25:24 UTC (rev 272476)
+++ trunk/Source/WebCore/page/EventHandler.h	2021-02-07 22:10:39 UTC (rev 272477)
@@ -394,8 +394,6 @@
     bool logicalScrollOverflow(ScrollLogicalDirection, ScrollGranularity, Node* startingNode = nullptr);
     
     bool shouldSwapScrollDirection(const HitTestResult&, const PlatformWheelEvent&) const;
-    
-    bool mouseDownMayStartSelect() const { return m_mouseDownMayStartSelect; }
 
     static bool isKeyboardOptionTab(KeyboardEvent&);
     static bool eventInvertsTabsToLinksClientCallResult(KeyboardEvent&);
@@ -528,8 +526,7 @@
     bool shouldSendMouseEventsToInactiveWindows() const;
 
     bool canMouseDownStartSelect(const MouseEventWithHitTestResults&);
-
-    bool mouseDownMayStartSelect();
+    bool mouseDownMayStartSelect() const;
     
     Frame& m_frame;
     RefPtr<Node> m_mousePressNode;

Modified: trunk/Source/WebCore/page/Page.h (272476 => 272477)


--- trunk/Source/WebCore/page/Page.h	2021-02-07 20:25:24 UTC (rev 272476)
+++ trunk/Source/WebCore/page/Page.h	2021-02-07 22:10:39 UTC (rev 272477)
@@ -832,7 +832,7 @@
 
     MonotonicTime lastRenderingUpdateTimestamp() const { return m_lastRenderingUpdateTimestamp; }
 
-    bool textInteractionEnabled() { return m_textInteractionEnabled; }
+    bool textInteractionEnabled() const { return m_textInteractionEnabled; }
     void setTextInteractionEnabled(bool value) { m_textInteractionEnabled = value; }
 
     LoadSchedulingMode loadSchedulingMode() const { return m_loadSchedulingMode; }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to