Title: [247926] trunk/Source
Revision
247926
Author
[email protected]
Date
2019-07-29 15:48:30 -0700 (Mon, 29 Jul 2019)

Log Message

[ContentChangeObserver] didFinishContentChangeObserving should include the type of content change.
https://bugs.webkit.org/show_bug.cgi?id=200247
<rdar://problem/53681149>

Reviewed by Simon Fraser.

Source/WebCore:

Now we don't have to query the content change observer for the type of the change in the callback.

* loader/EmptyClients.h:
* page/ChromeClient.h:
* page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::adjustObservedState):
* page/ios/EventHandlerIOS.mm:
(WebCore::EventHandler::mouseMoved):

Source/WebKit:

* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
(WebKit::WebChromeClient::didFinishContentChangeObserving):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::didFinishContentChangeObserving):

Source/WebKitLegacy/ios:

* WebCoreSupport/WebChromeClientIOS.h:
* WebCoreSupport/WebChromeClientIOS.mm:
(WebChromeClientIOS::didFinishContentChangeObserving):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (247925 => 247926)


--- trunk/Source/WebCore/ChangeLog	2019-07-29 22:26:58 UTC (rev 247925)
+++ trunk/Source/WebCore/ChangeLog	2019-07-29 22:48:30 UTC (rev 247926)
@@ -1,3 +1,20 @@
+2019-07-29  Zalan Bujtas  <[email protected]>
+
+        [ContentChangeObserver] didFinishContentChangeObserving should include the type of content change.
+        https://bugs.webkit.org/show_bug.cgi?id=200247
+        <rdar://problem/53681149>
+
+        Reviewed by Simon Fraser.
+
+        Now we don't have to query the content change observer for the type of the change in the callback.
+
+        * loader/EmptyClients.h:
+        * page/ChromeClient.h:
+        * page/ios/ContentChangeObserver.cpp:
+        (WebCore::ContentChangeObserver::adjustObservedState):
+        * page/ios/EventHandlerIOS.mm:
+        (WebCore::EventHandler::mouseMoved):
+
 2019-07-29  Sergei Glazunov  <[email protected]>
 
         The maximum subframe count check should not be skipped for empty URLs.

Modified: trunk/Source/WebCore/loader/EmptyClients.h (247925 => 247926)


--- trunk/Source/WebCore/loader/EmptyClients.h	2019-07-29 22:26:58 UTC (rev 247925)
+++ trunk/Source/WebCore/loader/EmptyClients.h	2019-07-29 22:48:30 UTC (rev 247926)
@@ -169,7 +169,7 @@
 #if PLATFORM(IOS_FAMILY)
     void didReceiveMobileDocType(bool) final { }
     void setNeedsScrollNotifications(Frame&, bool) final { }
-    void didFinishContentChangeObserving(Frame&) final { }
+    void didFinishContentChangeObserving(Frame&, WKContentChange) final { }
     void notifyRevealedSelectionByScrollingFrame(Frame&) final { }
     void didLayout(LayoutType) final { }
     void didStartOverflowScroll() final { }

Modified: trunk/Source/WebCore/page/ChromeClient.h (247925 => 247926)


--- trunk/Source/WebCore/page/ChromeClient.h	2019-07-29 22:26:58 UTC (rev 247925)
+++ trunk/Source/WebCore/page/ChromeClient.h	2019-07-29 22:48:30 UTC (rev 247926)
@@ -59,6 +59,7 @@
 
 #if PLATFORM(IOS_FAMILY)
 #include "PlatformLayer.h"
+#include "WKContentObservation.h"
 #define NSResponder WAKResponder
 #ifndef __OBJC__
 class WAKResponder;
@@ -246,7 +247,7 @@
 #if PLATFORM(IOS_FAMILY)
     virtual void didReceiveMobileDocType(bool) = 0;
     virtual void setNeedsScrollNotifications(Frame&, bool) = 0;
-    virtual void didFinishContentChangeObserving(Frame&) = 0;
+    virtual void didFinishContentChangeObserving(Frame&, WKContentChange) = 0;
     virtual void notifyRevealedSelectionByScrollingFrame(Frame&) = 0;
 
     enum LayoutType { NormalLayout, Scroll };

Modified: trunk/Source/WebCore/page/ios/ContentChangeObserver.cpp (247925 => 247926)


--- trunk/Source/WebCore/page/ios/ContentChangeObserver.cpp	2019-07-29 22:26:58 UTC (rev 247925)
+++ trunk/Source/WebCore/page/ios/ContentChangeObserver.cpp	2019-07-29 22:48:30 UTC (rev 247926)
@@ -491,7 +491,7 @@
         LOG_WITH_STREAM(ContentObservation, stream << "adjustStateAndNotifyContentChangeIfNeeded: sending observedContentChange ->" << observedContentChange());
         ASSERT(m_document.page());
         ASSERT(m_document.frame());
-        m_document.page()->chrome().client().didFinishContentChangeObserving(*m_document.frame());
+        m_document.page()->chrome().client().didFinishContentChangeObserving(*m_document.frame(), observedContentChange());
     };
 
     switch (event) {

Modified: trunk/Source/WebCore/page/ios/EventHandlerIOS.mm (247925 => 247926)


--- trunk/Source/WebCore/page/ios/EventHandlerIOS.mm	2019-07-29 22:26:58 UTC (rev 247925)
+++ trunk/Source/WebCore/page/ios/EventHandlerIOS.mm	2019-07-29 22:48:30 UTC (rev 247926)
@@ -503,7 +503,7 @@
         callOnMainThread([protectedFrame = makeRef(m_frame)] {
             // This is called by WebKitLegacy only.
             if (auto* document = protectedFrame->document())
-                document->page()->chrome().client().didFinishContentChangeObserving(*document->frame());
+                document->page()->chrome().client().didFinishContentChangeObserving(*document->frame(), document->contentChangeObserver().observedContentChange());
         });
     }
 

Modified: trunk/Source/WebKit/ChangeLog (247925 => 247926)


--- trunk/Source/WebKit/ChangeLog	2019-07-29 22:26:58 UTC (rev 247925)
+++ trunk/Source/WebKit/ChangeLog	2019-07-29 22:48:30 UTC (rev 247926)
@@ -1,3 +1,18 @@
+2019-07-29  Zalan Bujtas  <[email protected]>
+
+        [ContentChangeObserver] didFinishContentChangeObserving should include the type of content change.
+        https://bugs.webkit.org/show_bug.cgi?id=200247
+        <rdar://problem/53681149>
+
+        Reviewed by Simon Fraser.
+
+        * WebProcess/WebCoreSupport/WebChromeClient.h:
+        * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
+        (WebKit::WebChromeClient::didFinishContentChangeObserving):
+        * WebProcess/WebPage/WebPage.h:
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::WebPage::didFinishContentChangeObserving):
+
 2019-07-29  Youenn Fablet  <[email protected]>
 
         REGRESSION: WebSockets no longer work in Service Workers

Modified: trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h (247925 => 247926)


--- trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h	2019-07-29 22:26:58 UTC (rev 247925)
+++ trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h	2019-07-29 22:48:30 UTC (rev 247926)
@@ -161,7 +161,7 @@
 #if PLATFORM(IOS_FAMILY)
     void didReceiveMobileDocType(bool) final;
     void setNeedsScrollNotifications(WebCore::Frame&, bool) final;
-    void didFinishContentChangeObserving(WebCore::Frame&) final;
+    void didFinishContentChangeObserving(WebCore::Frame&, WKContentChange) final;
     void notifyRevealedSelectionByScrollingFrame(WebCore::Frame&) final;
     bool isStopping() final;
 

Modified: trunk/Source/WebKit/WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm (247925 => 247926)


--- trunk/Source/WebKit/WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm	2019-07-29 22:26:58 UTC (rev 247925)
+++ trunk/Source/WebKit/WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm	2019-07-29 22:48:30 UTC (rev 247926)
@@ -66,9 +66,9 @@
     notImplemented();
 }
 
-void WebChromeClient::didFinishContentChangeObserving(WebCore::Frame&)
+void WebChromeClient::didFinishContentChangeObserving(WebCore::Frame&, WKContentChange observedContentChange)
 {
-    m_page.didFinishContentChangeObserving();
+    m_page.didFinishContentChangeObserving(observedContentChange);
 }
 
 void WebChromeClient::notifyRevealedSelectionByScrollingFrame(WebCore::Frame&)

Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.h (247925 => 247926)


--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.h	2019-07-29 22:26:58 UTC (rev 247925)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.h	2019-07-29 22:48:30 UTC (rev 247926)
@@ -102,6 +102,7 @@
 #include "WebPageMessages.h"
 #include <WebCore/IntPointHash.h>
 #include <WebCore/ViewportConfiguration.h>
+#include <WebCore/WKContentObservation.h>
 #endif
 
 #if ENABLE(APPLICATION_MANIFEST)
@@ -956,7 +957,7 @@
     void applicationDidFinishSnapshottingAfterEnteringBackground();
     void applicationWillEnterForeground(bool isSuspendedUnderLock);
     void applicationDidBecomeActive();
-    void didFinishContentChangeObserving();
+    void didFinishContentChangeObserving(WKContentChange);
 
     bool platformPrefersTextLegibilityBasedZoomScaling() const;
     const WebCore::ViewportConfiguration& viewportConfiguration() const { return m_viewportConfiguration; }

Modified: trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm (247925 => 247926)


--- trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm	2019-07-29 22:26:58 UTC (rev 247925)
+++ trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm	2019-07-29 22:48:30 UTC (rev 247926)
@@ -732,12 +732,11 @@
     });
 }
 
-void WebPage::didFinishContentChangeObserving()
+void WebPage::didFinishContentChangeObserving(WKContentChange observedContentChange)
 {
     LOG_WITH_STREAM(ContentObservation, stream << "didFinishContentChangeObserving: pending target node(" << m_pendingSyntheticClickNode << ")");
     if (!m_pendingSyntheticClickNode)
         return;
-    auto observedContentChange = m_pendingSyntheticClickNode->document().contentChangeObserver().observedContentChange();
     callOnMainThread([protectedThis = makeRefPtr(this), targetNode = Ref<Node>(*m_pendingSyntheticClickNode), originalDocument = makeWeakPtr(m_pendingSyntheticClickNode->document()), observedContentChange, location = m_pendingSyntheticClickLocation, modifiers = m_pendingSyntheticClickModifiers, pointerId = m_pendingSyntheticClickPointerId] {
         if (protectedThis->m_isClosed || !protectedThis->corePage())
             return;

Modified: trunk/Source/WebKitLegacy/ios/ChangeLog (247925 => 247926)


--- trunk/Source/WebKitLegacy/ios/ChangeLog	2019-07-29 22:26:58 UTC (rev 247925)
+++ trunk/Source/WebKitLegacy/ios/ChangeLog	2019-07-29 22:48:30 UTC (rev 247926)
@@ -1,5 +1,17 @@
 2019-07-29  Zalan Bujtas  <[email protected]>
 
+        [ContentChangeObserver] didFinishContentChangeObserving should include the type of content change.
+        https://bugs.webkit.org/show_bug.cgi?id=200247
+        <rdar://problem/53681149>
+
+        Reviewed by Simon Fraser.
+
+        * WebCoreSupport/WebChromeClientIOS.h:
+        * WebCoreSupport/WebChromeClientIOS.mm:
+        (WebChromeClientIOS::didFinishContentChangeObserving):
+
+2019-07-29  Zalan Bujtas  <[email protected]>
+
         [ContentChangeObserver] ChromeClient::observedContentChange() name is misleading
         https://bugs.webkit.org/show_bug.cgi?id=200238
         <rdar://problem/53677038>

Modified: trunk/Source/WebKitLegacy/ios/WebCoreSupport/WebChromeClientIOS.h (247925 => 247926)


--- trunk/Source/WebKitLegacy/ios/WebCoreSupport/WebChromeClientIOS.h	2019-07-29 22:26:58 UTC (rev 247925)
+++ trunk/Source/WebKitLegacy/ios/WebCoreSupport/WebChromeClientIOS.h	2019-07-29 22:48:30 UTC (rev 247926)
@@ -55,7 +55,7 @@
 
     void didReceiveMobileDocType(bool) final;
     void setNeedsScrollNotifications(WebCore::Frame&, bool) final;
-    void didFinishContentChangeObserving(WebCore::Frame&) final;
+    void didFinishContentChangeObserving(WebCore::Frame&, WKContentChange) final;
     WebCore::FloatSize screenSize() const final;
     WebCore::FloatSize availableScreenSize() const final;
     WebCore::FloatSize overrideScreenSize() const final;

Modified: trunk/Source/WebKitLegacy/ios/WebCoreSupport/WebChromeClientIOS.mm (247925 => 247926)


--- trunk/Source/WebKitLegacy/ios/WebCoreSupport/WebChromeClientIOS.mm	2019-07-29 22:26:58 UTC (rev 247925)
+++ trunk/Source/WebKitLegacy/ios/WebCoreSupport/WebChromeClientIOS.mm	2019-07-29 22:48:30 UTC (rev 247926)
@@ -182,11 +182,11 @@
     [[webView() _UIKitDelegateForwarder] webView:webView() needsScrollNotifications:[NSNumber numberWithBool:flag] forFrame:kit(&frame)];
 }
 
-void WebChromeClientIOS::didFinishContentChangeObserving(WebCore::Frame& frame)
+void WebChromeClientIOS::didFinishContentChangeObserving(WebCore::Frame& frame, WKContentChange observedContentChange)
 {
     if (!frame.document())
         return;
-    [[webView() _UIKitDelegateForwarder] webView:webView() didObserveDeferredContentChange:frame.document()->contentChangeObserver().observedContentChange() forFrame:kit(&frame)];
+    [[webView() _UIKitDelegateForwarder] webView:webView() didObserveDeferredContentChange:observedContentChange forFrame:kit(&frame)];
 }
 
 static inline NSString *nameForViewportFitValue(ViewportFit value)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to