[ContentChangeObserver] Simplify content observation API by removing explicit DOMTime...
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 26 Feb 2019 18:37:09 +0000 (18:37 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 26 Feb 2019 18:37:09 +0000 (18:37 +0000)
https://bugs.webkit.org/show_bug.cgi?id=195023
<rdar://problem/48381885>

Reviewed by Tim Horton.

Source/WebCore:

In the future we might decide that certain activities don't require DOMTimer observation, but that should
be internal to ContentChangeObserver.

* page/ios/ContentChangeObserver.h:
* page/ios/ContentChangeObserver.mm:
(WebCore::ContentChangeObserver::startObservingContentChanges):
(WebCore::ContentChangeObserver::stopObservingContentChanges):
* page/ios/EventHandlerIOS.mm:
(WebCore::EventHandler::mouseMoved):

Source/WebKit:

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::handleSyntheticClick):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242094 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/page/ios/ContentChangeObserver.h
Source/WebCore/page/ios/ContentChangeObserver.mm
Source/WebCore/page/ios/EventHandlerIOS.mm
Source/WebKit/ChangeLog
Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm

index f01b70b..508bc0b 100644 (file)
@@ -1,5 +1,23 @@
 2019-02-26  Zalan Bujtas  <zalan@apple.com>
 
+        [ContentChangeObserver] Simplify content observation API by removing explicit DOMTimer observation.
+        https://bugs.webkit.org/show_bug.cgi?id=195023
+        <rdar://problem/48381885>
+
+        Reviewed by Tim Horton.
+
+        In the future we might decide that certain activities don't require DOMTimer observation, but that should
+        be internal to ContentChangeObserver.
+
+        * page/ios/ContentChangeObserver.h:
+        * page/ios/ContentChangeObserver.mm:
+        (WebCore::ContentChangeObserver::startObservingContentChanges):
+        (WebCore::ContentChangeObserver::stopObservingContentChanges):
+        * page/ios/EventHandlerIOS.mm:
+        (WebCore::EventHandler::mouseMoved):
+
+2019-02-26  Zalan Bujtas  <zalan@apple.com>
+
         [ContentChangeObserver] Move observing logic from Document::updateStyleIfNeeded to ContentChangeObserver
         https://bugs.webkit.org/show_bug.cgi?id=195032
         <rdar://problem/48388063>
index 6db24b6..6ea1f40 100644 (file)
@@ -49,9 +49,6 @@ public:
     WEBCORE_EXPORT void startObservingContentChanges();
     WEBCORE_EXPORT void stopObservingContentChanges();
 
-    WEBCORE_EXPORT void startObservingDOMTimerScheduling();
-    WEBCORE_EXPORT void stopObservingDOMTimerScheduling();
-
     bool isObservingStyleRecalcScheduling();
 
     void setShouldObserveNextStyleRecalc(bool);
@@ -77,6 +74,9 @@ public:
     };
 
 private:
+    void startObservingDOMTimerScheduling();
+    void stopObservingDOMTimerScheduling();
+
     void addObservedDOMTimer(const DOMTimer&);
     bool isObservingDOMTimerScheduling();
     void removeObservedDOMTimer(const DOMTimer&);
index 789a5aa..d2ae307 100644 (file)
@@ -122,11 +122,13 @@ void ContentChangeObserver::removeDOMTimer(const DOMTimer& timer)
 
 void ContentChangeObserver::startObservingContentChanges()
 {
+    startObservingDOMTimerScheduling();
     WKStartObservingContentChanges();
 }
 
 void ContentChangeObserver::stopObservingContentChanges()
 {
+    stopObservingDOMTimerScheduling();
     WKStopObservingContentChanges();
 }
 
index b8c8cef..de989ce 100644 (file)
@@ -497,14 +497,12 @@ void EventHandler::mouseMoved(WebEvent *event)
 
     auto& contentChangeObserver = document.page()->contentChangeObserver();
     contentChangeObserver.startObservingContentChanges();
-    contentChangeObserver.startObservingDOMTimerScheduling();
 
     CurrentEventScope scope(event);
     event.wasHandled = mouseMoved(currentPlatformMouseEvent());
 
     // Run style recalc to be able to capture content changes as the result of the mouse move event.
     document.updateStyleIfNeeded();
-    contentChangeObserver.stopObservingDOMTimerScheduling();
     contentChangeObserver.stopObservingContentChanges();
 
     END_BLOCK_OBJC_EXCEPTIONS;
index 1bb2026..7914022 100644 (file)
@@ -1,3 +1,14 @@
+2019-02-26  Zalan Bujtas  <zalan@apple.com>
+
+        [ContentChangeObserver] Simplify content observation API by removing explicit DOMTimer observation.
+        https://bugs.webkit.org/show_bug.cgi?id=195023
+        <rdar://problem/48381885>
+
+        Reviewed by Tim Horton.
+
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::WebPage::handleSyntheticClick):
+
 2019-02-26  Takashi Komori  <Takashi.Komori@sony.com>
 
         [Curl] Load HTTP body of 401 response when AuthenticationChange is cancelled.
index 90c230b..5197fe2 100644 (file)
@@ -543,7 +543,6 @@ void WebPage::handleSyntheticClick(Node* nodeRespondingToClick, const WebCore::F
 
     LOG_WITH_STREAM(ContentObservation, stream << "handleSyntheticClick: node(" << nodeRespondingToClick << ") " << location);
     contentChangeObserver.startObservingContentChanges();
-    contentChangeObserver.startObservingDOMTimerScheduling();
 
     // FIXME: Pass caps lock state.
     bool shiftKey = modifiers.contains(WebEvent::Modifier::ShiftKey);
@@ -553,7 +552,6 @@ void WebPage::handleSyntheticClick(Node* nodeRespondingToClick, const WebCore::F
     mainframe.eventHandler().mouseMoved(PlatformMouseEvent(roundedAdjustedPoint, roundedAdjustedPoint, NoButton, PlatformEvent::MouseMoved, 0, shiftKey, ctrlKey, altKey, metaKey, WallTime::now(), WebCore::ForceAtClick, WebCore::NoTap));
     mainframe.document()->updateStyleIfNeeded();
 
-    contentChangeObserver.stopObservingDOMTimerScheduling();
     contentChangeObserver.stopObservingContentChanges();
 
     m_pendingSyntheticClickNode = nullptr;