Title: [280122] trunk/Source/WebKit
Revision
280122
Author
[email protected]
Date
2021-07-20 19:47:42 -0700 (Tue, 20 Jul 2021)

Log Message

[iOS] Add SPI for internal clients to consult whether or not viewport quirks should be enabled
https://bugs.webkit.org/show_bug.cgi?id=228123
rdar://80397679

Reviewed by Dan Bernstein.

Rename the SPI added in r280119 from `-_needsSiteSpecificQuirks` to `-_needsSiteSpecificViewportQuirks`, to
clarify its intent (and importantly, to differentiate it from the existing WKPreferences SPI of the same name).

This distinction is important because this readonly property acts as a hint for WebKit clients to augment
certain viewport behaviors, whereas the readwrite WKPreferences property is a way for clients to indicate that
WebKit should opt in or out of site-specific quirks (unless overridden by Web Inspector).

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _needsSiteSpecificViewportQuirks]):
(-[WKWebView _needsSiteSpecificQuirks]): Deleted.
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::resetStateAfterProcessTermination):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didCommitLoad):
* WebProcess/WebPage/WebPage.h:

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (280121 => 280122)


--- trunk/Source/WebKit/ChangeLog	2021-07-21 01:02:58 UTC (rev 280121)
+++ trunk/Source/WebKit/ChangeLog	2021-07-21 02:47:42 UTC (rev 280122)
@@ -4,6 +4,33 @@
         https://bugs.webkit.org/show_bug.cgi?id=228123
         rdar://80397679
 
+        Reviewed by Dan Bernstein.
+
+        Rename the SPI added in r280119 from `-_needsSiteSpecificQuirks` to `-_needsSiteSpecificViewportQuirks`, to
+        clarify its intent (and importantly, to differentiate it from the existing WKPreferences SPI of the same name).
+
+        This distinction is important because this readonly property acts as a hint for WebKit clients to augment
+        certain viewport behaviors, whereas the readwrite WKPreferences property is a way for clients to indicate that
+        WebKit should opt in or out of site-specific quirks (unless overridden by Web Inspector).
+
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView _needsSiteSpecificViewportQuirks]):
+        (-[WKWebView _needsSiteSpecificQuirks]): Deleted.
+        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::resetStateAfterProcessTermination):
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/WebPageProxy.messages.in:
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::didCommitLoad):
+        * WebProcess/WebPage/WebPage.h:
+
+2021-07-20  Wenson Hsieh  <[email protected]>
+
+        [iOS] Add SPI for internal clients to consult whether or not viewport quirks should be enabled
+        https://bugs.webkit.org/show_bug.cgi?id=228123
+        rdar://80397679
+
         Reviewed by Tim Horton.
 
         Add support for an SPI property on WKWebView that indicates whether site-specific quirks should be enabled.

Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm (280121 => 280122)


--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm	2021-07-21 01:02:58 UTC (rev 280121)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm	2021-07-21 02:47:42 UTC (rev 280122)
@@ -2518,9 +2518,9 @@
     return true;
 }
 
-- (BOOL)_needsSiteSpecificQuirks
+- (BOOL)_needsSiteSpecificViewportQuirks
 {
-    return _page && _page->needsSiteSpecificQuirks();
+    return _page && _page->needsSiteSpecificViewportQuirks();
 }
 
 - (pid_t)_webProcessIdentifier

Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h (280121 => 280122)


--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h	2021-07-21 01:02:58 UTC (rev 280121)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h	2021-07-21 02:47:42 UTC (rev 280122)
@@ -412,7 +412,7 @@
 - (void)_suspendPage:(void (^)(BOOL))completionHandler WK_API_AVAILABLE(macos(12.0), ios(15.0));
 - (void)_resumePage:(void (^)(BOOL))completionHandler WK_API_AVAILABLE(macos(12.0), ios(15.0));
 
-@property (nonatomic, readonly) BOOL _needsSiteSpecificQuirks WK_API_AVAILABLE(macos(12.0), ios(15.0));
+@property (nonatomic, readonly) BOOL _needsSiteSpecificViewportQuirks WK_API_AVAILABLE(macos(12.0), ios(15.0));
 
 @end
 

Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.cpp (280121 => 280122)


--- trunk/Source/WebKit/UIProcess/WebPageProxy.cpp	2021-07-21 01:02:58 UTC (rev 280121)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.cpp	2021-07-21 02:47:42 UTC (rev 280122)
@@ -7640,7 +7640,7 @@
             automationSession->terminate();
     }
 
-    m_needsSiteSpecificQuirks = true;
+    m_needsSiteSpecificViewportQuirks = true;
 }
 
 void WebPageProxy::provisionalProcessDidTerminate()

Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.h (280121 => 280122)


--- trunk/Source/WebKit/UIProcess/WebPageProxy.h	2021-07-21 01:02:58 UTC (rev 280121)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.h	2021-07-21 02:47:42 UTC (rev 280122)
@@ -1960,8 +1960,8 @@
     WKQuickLookPreviewController *quickLookPreviewController() const { return m_quickLookPreviewController.get(); }
 #endif
 
-    bool needsSiteSpecificQuirks() const { return m_needsSiteSpecificQuirks; }
-    void setNeedsSiteSpecificQuirks(bool value) { m_needsSiteSpecificQuirks = value; }
+    bool needsSiteSpecificViewportQuirks() const { return m_needsSiteSpecificViewportQuirks; }
+    void setNeedsSiteSpecificViewportQuirks(bool value) { m_needsSiteSpecificViewportQuirks = value; }
 
 private:
     WebPageProxy(PageClient&, WebProcessProxy&, Ref<API::PageConfiguration>&&);
@@ -3080,7 +3080,7 @@
     RetainPtr<WKQuickLookPreviewController> m_quickLookPreviewController;
 #endif
 
-    bool m_needsSiteSpecificQuirks { true };
+    bool m_needsSiteSpecificViewportQuirks { true };
 };
 
 #ifdef __OBJC__

Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in (280121 => 280122)


--- trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in	2021-07-21 01:02:58 UTC (rev 280121)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in	2021-07-21 02:47:42 UTC (rev 280122)
@@ -413,7 +413,7 @@
     ShowDataDetectorsUIForPositionInformation(struct WebKit::InteractionInformationAtPosition information)
 #endif
 
-    SetNeedsSiteSpecificQuirks(bool needsSiteSpecificQuirks)
+    SetNeedsSiteSpecificViewportQuirks(bool value)
 
     DidChangeInspectorFrontendCount(uint64_t count)
 

Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp (280121 => 280122)


--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp	2021-07-21 01:02:58 UTC (rev 280121)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp	2021-07-21 02:47:42 UTC (rev 280122)
@@ -6273,10 +6273,10 @@
     if (!frame->isMainFrame())
         return;
 
-    bool needsSiteSpecificQuirks = frame->coreFrame()->settings().needsSiteSpecificQuirks();
-    if (m_needsSiteSpecificQuirks != needsSiteSpecificQuirks) {
-        m_needsSiteSpecificQuirks = needsSiteSpecificQuirks;
-        send(Messages::WebPageProxy::SetNeedsSiteSpecificQuirks(needsSiteSpecificQuirks));
+    bool needsSiteSpecificViewportQuirks = frame->coreFrame()->settings().needsSiteSpecificQuirks();
+    if (m_needsSiteSpecificViewportQuirks != needsSiteSpecificViewportQuirks) {
+        m_needsSiteSpecificViewportQuirks = needsSiteSpecificViewportQuirks;
+        send(Messages::WebPageProxy::SetNeedsSiteSpecificViewportQuirks(needsSiteSpecificViewportQuirks));
     }
 
     if (m_drawingArea)

Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.h (280121 => 280122)


--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.h	2021-07-21 01:02:58 UTC (rev 280121)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.h	2021-07-21 02:47:42 UTC (rev 280122)
@@ -2379,7 +2379,7 @@
     WebCore::HighlightVisibility m_appHighlightsVisible { false };
 #endif
 
-    bool m_needsSiteSpecificQuirks { true };
+    bool m_needsSiteSpecificViewportQuirks { true };
 };
 
 #if !PLATFORM(IOS_FAMILY)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to