[ContentChangeObserver] Add a setting to be able to turn content change observation...
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 Mar 2019 00:36:42 +0000 (00:36 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 Mar 2019 00:36:42 +0000 (00:36 +0000)
https://bugs.webkit.org/show_bug.cgi?id=195353
<rdar://problem/48626394>

Reviewed by Simon Fraser.

Source/WebCore:

Move content observation tests to a dedicated directory.

Tests: fast/events/touch/ios/content-observation/click-instead-of-hover-simple.html
       fast/events/touch/ios/content-observation/hover-when-style-change-is-async.html
       fast/events/touch/ios/content-observation/stuck-with-hover-state.html
       fast/events/touch/ios/content-observation/style-recalc-schedule-and-force-relalc.html
       fast/events/touch/ios/content-observation/visibility-change-happens-at-the-second-timer.html

* page/Settings.yaml:
* page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::didInstallDOMTimer):
(WebCore::ContentChangeObserver::isNotifyContentChangeAllowed const):
* page/ios/ContentChangeObserver.h:
(WebCore::ContentChangeObserver::isNotifyContentChangeAllowed const): Deleted.
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::resetToConsistentState):

Source/WebKit:

* Shared/WebPreferences.yaml:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetContentChangeObserverEnabled):
(WKPreferencesGetContentChangeObserverEnabled):
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _contentChangeObserverEnabled]):
(-[WKPreferences _setContentChangeObserverEnabled:]):
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::handleSyntheticClick):

Source/WebKitLegacy/mac:

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences contentChangeObserverEnabled]):
(-[WebPreferences setContentChangeObserverEnabled:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Tools:

* WebKitTestRunner/ios/TestControllerIOS.mm:
(WTR::TestController::platformResetPreferencesToConsistentValues):

LayoutTests:

* fast/events/touch/ios/content-observation/click-instead-of-hover-simple-expected.txt: Renamed from LayoutTests/fast/events/touch/ios/click-instead-of-hover-simple-expected.txt.
* fast/events/touch/ios/content-observation/click-instead-of-hover-simple.html: Renamed from LayoutTests/fast/events/touch/ios/click-instead-of-hover-simple.html.
* fast/events/touch/ios/content-observation/hover-when-style-change-is-async-expected.txt: Renamed from LayoutTests/fast/events/touch/ios/hover-when-style-change-is-async-expected.txt.
* fast/events/touch/ios/content-observation/hover-when-style-change-is-async.html: Renamed from LayoutTests/fast/events/touch/ios/hover-when-style-change-is-async.html.
* fast/events/touch/ios/content-observation/stuck-with-hover-state-expected.txt: Renamed from LayoutTests/fast/events/touch/ios/stuck-with-hover-state-expected.txt.
* fast/events/touch/ios/content-observation/stuck-with-hover-state.html: Renamed from LayoutTests/fast/events/touch/ios/stuck-with-hover-state.html.
* fast/events/touch/ios/content-observation/style-recalc-schedule-and-force-relalc-expected.txt: Renamed from LayoutTests/fast/events/touch/ios/style-recalc-schedule-and-force-relalc-expected.txt.
* fast/events/touch/ios/content-observation/style-recalc-schedule-and-force-relalc.html: Renamed from LayoutTests/fast/events/touch/ios/style-recalc-schedule-and-force-relalc.html.
* fast/events/touch/ios/content-observation/visibility-change-happens-at-the-second-timer-expected.txt: Renamed from LayoutTests/fast/events/touch/ios/visibility-change-happens-at-the-second-timer-expected.txt.
* fast/events/touch/ios/content-observation/visibility-change-happens-at-the-second-timer.html: Renamed from LayoutTests/fast/events/touch/ios/visibility-change-happens-at-the-second-timer.html.

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

31 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/events/touch/ios/content-observation/click-instead-of-hover-simple-expected.txt [moved from LayoutTests/fast/events/touch/ios/click-instead-of-hover-simple-expected.txt with 100% similarity]
LayoutTests/fast/events/touch/ios/content-observation/click-instead-of-hover-simple.html [moved from LayoutTests/fast/events/touch/ios/click-instead-of-hover-simple.html with 86% similarity]
LayoutTests/fast/events/touch/ios/content-observation/hover-when-style-change-is-async-expected.txt [moved from LayoutTests/fast/events/touch/ios/hover-when-style-change-is-async-expected.txt with 100% similarity]
LayoutTests/fast/events/touch/ios/content-observation/hover-when-style-change-is-async.html [moved from LayoutTests/fast/events/touch/ios/hover-when-style-change-is-async.html with 90% similarity]
LayoutTests/fast/events/touch/ios/content-observation/stuck-with-hover-state-expected.txt [moved from LayoutTests/fast/events/touch/ios/stuck-with-hover-state-expected.txt with 100% similarity]
LayoutTests/fast/events/touch/ios/content-observation/stuck-with-hover-state.html [moved from LayoutTests/fast/events/touch/ios/stuck-with-hover-state.html with 85% similarity]
LayoutTests/fast/events/touch/ios/content-observation/style-recalc-schedule-and-force-relalc-expected.txt [moved from LayoutTests/fast/events/touch/ios/style-recalc-schedule-and-force-relalc-expected.txt with 100% similarity]
LayoutTests/fast/events/touch/ios/content-observation/style-recalc-schedule-and-force-relalc.html [moved from LayoutTests/fast/events/touch/ios/style-recalc-schedule-and-force-relalc.html with 90% similarity]
LayoutTests/fast/events/touch/ios/content-observation/visibility-change-happens-at-the-second-timer-expected.txt [moved from LayoutTests/fast/events/touch/ios/visibility-change-happens-at-the-second-timer-expected.txt with 100% similarity]
LayoutTests/fast/events/touch/ios/content-observation/visibility-change-happens-at-the-second-timer.html [moved from LayoutTests/fast/events/touch/ios/visibility-change-happens-at-the-second-timer.html with 91% similarity]
Source/WebCore/ChangeLog
Source/WebCore/page/Settings.yaml
Source/WebCore/page/SettingsBase.cpp
Source/WebCore/page/SettingsBase.h
Source/WebCore/page/ios/ContentChangeObserver.cpp
Source/WebCore/page/ios/ContentChangeObserver.h
Source/WebKit/ChangeLog
Source/WebKit/Shared/WebPreferences.yaml
Source/WebKit/UIProcess/API/C/WKPreferences.cpp
Source/WebKit/UIProcess/API/C/WKPreferencesRefPrivate.h
Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm
Source/WebKit/UIProcess/API/Cocoa/WKPreferencesPrivate.h
Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h
Source/WebKitLegacy/mac/WebView/WebPreferences.mm
Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h
Source/WebKitLegacy/mac/WebView/WebView.mm
Tools/ChangeLog
Tools/WebKitTestRunner/ios/TestControllerIOS.mm

index e880240..d3fb796 100644 (file)
@@ -1,3 +1,22 @@
+2019-03-07  Zalan Bujtas  <zalan@apple.com>
+
+        [ContentChangeObserver] Add a setting to be able to turn content change observation on/off
+        https://bugs.webkit.org/show_bug.cgi?id=195353
+        <rdar://problem/48626394>
+
+        Reviewed by Simon Fraser.
+
+        * fast/events/touch/ios/content-observation/click-instead-of-hover-simple-expected.txt: Renamed from LayoutTests/fast/events/touch/ios/click-instead-of-hover-simple-expected.txt.
+        * fast/events/touch/ios/content-observation/click-instead-of-hover-simple.html: Renamed from LayoutTests/fast/events/touch/ios/click-instead-of-hover-simple.html.
+        * fast/events/touch/ios/content-observation/hover-when-style-change-is-async-expected.txt: Renamed from LayoutTests/fast/events/touch/ios/hover-when-style-change-is-async-expected.txt.
+        * fast/events/touch/ios/content-observation/hover-when-style-change-is-async.html: Renamed from LayoutTests/fast/events/touch/ios/hover-when-style-change-is-async.html.
+        * fast/events/touch/ios/content-observation/stuck-with-hover-state-expected.txt: Renamed from LayoutTests/fast/events/touch/ios/stuck-with-hover-state-expected.txt.
+        * fast/events/touch/ios/content-observation/stuck-with-hover-state.html: Renamed from LayoutTests/fast/events/touch/ios/stuck-with-hover-state.html.
+        * fast/events/touch/ios/content-observation/style-recalc-schedule-and-force-relalc-expected.txt: Renamed from LayoutTests/fast/events/touch/ios/style-recalc-schedule-and-force-relalc-expected.txt.
+        * fast/events/touch/ios/content-observation/style-recalc-schedule-and-force-relalc.html: Renamed from LayoutTests/fast/events/touch/ios/style-recalc-schedule-and-force-relalc.html.
+        * fast/events/touch/ios/content-observation/visibility-change-happens-at-the-second-timer-expected.txt: Renamed from LayoutTests/fast/events/touch/ios/visibility-change-happens-at-the-second-timer-expected.txt.
+        * fast/events/touch/ios/content-observation/visibility-change-happens-at-the-second-timer.html: Renamed from LayoutTests/fast/events/touch/ios/visibility-change-happens-at-the-second-timer.html.
+
 2019-03-07  Ross Kirsling  <ross.kirsling@sony.com>
 
         [WinCairo] Unreviewed test gardening.
@@ -1,7 +1,7 @@
 <html>
 <head>
 <title>This test that we trigger click when hover would not display non-clickable content.</title>
-<script src="../../../../resources/basic-gestures.js"></script>
+<script src="../../../../../resources/basic-gestures.js"></script>
 <style>
 #tapthis {
     width: 400px;
@@ -13,6 +13,8 @@
 async function test() {
     if (!window.testRunner || !testRunner.runUIScript)
         return;
+    if (window.internals)
+        internals.settings.setContentChangeObserverEnabled(true);
 
     testRunner.dumpAsText();
     testRunner.waitUntilDone();
@@ -1,7 +1,7 @@
 <html>
 <head>
 <title>This test that we trigger hover when the content change is async.</title>
-<script src="../../../../resources/basic-gestures.js"></script>
+<script src="../../../../../resources/basic-gestures.js"></script>
 <style>
 #tapthis {
     width: 400px;
@@ -20,6 +20,8 @@
 async function test() {
     if (!window.testRunner || !testRunner.runUIScript)
         return;
+    if (window.internals)
+        internals.settings.setContentChangeObserverEnabled(true);
 
     testRunner.dumpAsText();
     testRunner.waitUntilDone();
@@ -1,7 +1,7 @@
 <html>
 <head>
 <title>This test that we trigger click when hover would not display non-clickable content.</title>
-<script src="../../../../resources/basic-gestures.js"></script>
+<script src="../../../../../resources/basic-gestures.js"></script>
 <style>
 #tapthis {
     width: 400px;
@@ -13,6 +13,8 @@
 async function test() {
     if (!window.testRunner || !testRunner.runUIScript)
         return;
+    if (window.internals)
+        internals.settings.setContentChangeObserverEnabled(true);
 
     testRunner.dumpAsText();
     testRunner.waitUntilDone();
@@ -1,7 +1,7 @@
 <html>
 <head>
 <title>This test that we trigger hover when the content change starts as async but it turns into a sync style recalc.</title>
-<script src="../../../../resources/basic-gestures.js"></script>
+<script src="../../../../../resources/basic-gestures.js"></script>
 <style>
 #tapthis {
     width: 400px;
@@ -20,6 +20,8 @@
 async function test() {
     if (!window.testRunner || !testRunner.runUIScript)
         return;
+    if (window.internals)
+        internals.settings.setContentChangeObserverEnabled(true);
 
     testRunner.waitUntilDone();
     testRunner.dumpAsText();
@@ -1,7 +1,7 @@
 <html>
 <head>
 <title>This tests the case when the second timer triggers visible content change</title>
-<script src="../../../../resources/basic-gestures.js"></script>
+<script src="../../../../../resources/basic-gestures.js"></script>
 <style>
 #tapthis {
     width: 400px;
@@ -20,6 +20,8 @@
 async function test() {
     if (!window.testRunner || !testRunner.runUIScript)
         return;
+       if (window.internals)
+               internals.settings.setContentChangeObserverEnabled(true);
 
     testRunner.waitUntilDone();
     testRunner.dumpAsText();
index bf58e5d..3337e91 100644 (file)
@@ -1,3 +1,28 @@
+2019-03-07  Zalan Bujtas  <zalan@apple.com>
+
+        [ContentChangeObserver] Add a setting to be able to turn content change observation on/off
+        https://bugs.webkit.org/show_bug.cgi?id=195353
+        <rdar://problem/48626394>
+
+        Reviewed by Simon Fraser.
+
+        Move content observation tests to a dedicated directory.
+
+        Tests: fast/events/touch/ios/content-observation/click-instead-of-hover-simple.html
+               fast/events/touch/ios/content-observation/hover-when-style-change-is-async.html
+               fast/events/touch/ios/content-observation/stuck-with-hover-state.html
+               fast/events/touch/ios/content-observation/style-recalc-schedule-and-force-relalc.html
+               fast/events/touch/ios/content-observation/visibility-change-happens-at-the-second-timer.html
+
+        * page/Settings.yaml:
+        * page/ios/ContentChangeObserver.cpp:
+        (WebCore::ContentChangeObserver::didInstallDOMTimer):
+        (WebCore::ContentChangeObserver::isNotifyContentChangeAllowed const):
+        * page/ios/ContentChangeObserver.h:
+        (WebCore::ContentChangeObserver::isNotifyContentChangeAllowed const): Deleted.
+        * testing/InternalSettings.cpp:
+        (WebCore::InternalSettings::resetToConsistentState):
+
 2019-03-07  John Wilander  <wilander@apple.com>
 
         Make sure an empty host matches the internal representation "nullOrigin" in WebCore::RegistrableDomain::matches()
index 303d7f8..58d93c9 100644 (file)
@@ -446,6 +446,9 @@ simpleLineLayoutDebugBordersEnabled:
   initial: false
   onChange: setNeedsRecalcStyleInAllFrames
 
+contentChangeObserverEnabled:
+  initial: defaultContentChangeObserverEnabled()
+
 subpixelCSSOMElementMetricsEnabled:
   initial: false
 
index 2f6e4dc..3d59d30 100644 (file)
@@ -107,6 +107,15 @@ bool SettingsBase::defaultDownloadableBinaryFontsEnabled()
 #endif
 }
 
+bool SettingsBase::defaultContentChangeObserverEnabled()
+{
+#if PLATFORM(IOS_FAMILY)
+    return true;
+#else
+    return false;
+#endif
+}
+
 #if !PLATFORM(COCOA)
 const String& SettingsBase::defaultMediaContentTypesRequiringHardwareSupport()
 {
index 57531a1..3533b8f 100644 (file)
@@ -115,6 +115,7 @@ public:
     WEBCORE_EXPORT static bool defaultTextAutosizingEnabled();
     WEBCORE_EXPORT static float defaultMinimumZoomFontSize();
     WEBCORE_EXPORT static bool defaultDownloadableBinaryFontsEnabled();
+    WEBCORE_EXPORT static bool defaultContentChangeObserverEnabled();
 
 #if ENABLE(MEDIA_SOURCE)
     WEBCORE_EXPORT static bool platformDefaultMediaSourceEnabled();
index 27190c8..f0d5815 100644 (file)
@@ -33,6 +33,7 @@
 #include "Logging.h"
 #include "NodeRenderStyle.h"
 #include "Page.h"
+#include "Settings.h"
 
 namespace WebCore {
 
@@ -43,6 +44,8 @@ ContentChangeObserver::ContentChangeObserver(Document& document)
 
 void ContentChangeObserver::didInstallDOMTimer(const DOMTimer& timer, Seconds timeout, bool singleShot)
 {
+    if (!m_document.settings().contentChangeObserverEnabled())
+        return;
     if (m_document.activeDOMObjectsAreSuspended())
         return;
     if (timeout > 250_ms || !singleShot)
@@ -176,6 +179,13 @@ bool ContentChangeObserver::hasDeterminateState() const
     return observedContentChange() == WKContentNoChange && !hasPendingActivity();
 }
 
+#if !ASSERT_DISABLED
+bool ContentChangeObserver::isNotifyContentChangeAllowed() const
+{
+    return m_document.settings().contentChangeObserverEnabled() && !m_mouseMovedIsBeingDispatched;
+}
+#endif
+
 void ContentChangeObserver::adjustObservedState(Event event)
 {
     auto notifyContentChangeIfNeeded = [&] {
index e31cd02..102aca4 100644 (file)
@@ -117,7 +117,7 @@ private:
 
     bool hasPendingActivity() const { return hasObservedDOMTimer() || m_document.hasPendingStyleRecalc(); }
 #if !ASSERT_DISABLED
-    bool isNotifyContentChangeAllowed() const { return !m_mouseMovedIsBeingDispatched; }
+    bool isNotifyContentChangeAllowed() const;
 #endif
 
     enum class Event {
index 7cf442e..2772444 100644 (file)
@@ -1,3 +1,23 @@
+2019-03-07  Zalan Bujtas  <zalan@apple.com>
+
+        [ContentChangeObserver] Add a setting to be able to turn content change observation on/off
+        https://bugs.webkit.org/show_bug.cgi?id=195353
+        <rdar://problem/48626394>
+
+        Reviewed by Simon Fraser.
+
+        * Shared/WebPreferences.yaml:
+        * UIProcess/API/C/WKPreferences.cpp:
+        (WKPreferencesSetContentChangeObserverEnabled):
+        (WKPreferencesGetContentChangeObserverEnabled):
+        * UIProcess/API/C/WKPreferencesRefPrivate.h:
+        * UIProcess/API/Cocoa/WKPreferences.mm:
+        (-[WKPreferences _contentChangeObserverEnabled]):
+        (-[WKPreferences _setContentChangeObserverEnabled:]):
+        * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::WebPage::handleSyntheticClick):
+
 2019-03-07  Andy Estes  <aestes@apple.com>
 
         [Apple Pay] Untangle PKPaymentAuthorizationViewController from WebPaymentCoordinatorProxy
index a1dd895..4e981f8 100644 (file)
@@ -484,6 +484,11 @@ SimpleLineLayoutEnabled:
   type: bool
   defaultValue: true
 
+ContentChangeObserverEnabled:
+  type: bool
+  defaultValue: true
+  condition: PLATFORM(IOS_FAMILY)
+
 SubpixelCSSOMElementMetricsEnabled:
   type: bool
   defaultValue: false
index cfd7ed6..2df3a97 100644 (file)
@@ -1350,6 +1350,16 @@ bool WKPreferencesGetSimpleLineLayoutDebugBordersEnabled(WKPreferencesRef prefer
     return toImpl(preferencesRef)->simpleLineLayoutDebugBordersEnabled();
 }
 
+void WKPreferencesSetContentChangeObserverEnabled(WKPreferencesRef preferencesRef, bool flag)
+{
+    toImpl(preferencesRef)->setContentChangeObserverEnabled(flag);
+}
+
+bool WKPreferencesGetContentChangeObserverEnabled(WKPreferencesRef preferencesRef)
+{
+    return toImpl(preferencesRef)->contentChangeObserverEnabled();
+}
+
 void WKPreferencesSetNewBlockInsideInlineModelEnabled(WKPreferencesRef, bool)
 {
     // FIXME: Remove Safari call to this.
index 3a61bd9..1bd21c8 100644 (file)
@@ -334,6 +334,9 @@ WK_EXPORT bool WKPreferencesGetSimpleLineLayoutEnabled(WKPreferencesRef);
 WK_EXPORT void WKPreferencesSetSimpleLineLayoutDebugBordersEnabled(WKPreferencesRef, bool);
 WK_EXPORT bool WKPreferencesGetSimpleLineLayoutDebugBordersEnabled(WKPreferencesRef);
 
+WK_EXPORT void WKPreferencesSetContentChangeObserverEnabled(WKPreferencesRef, bool);
+WK_EXPORT bool WKPreferencesGetContentChangeObserverEnabled(WKPreferencesRef);
+
 // Defaults to false.
 WK_EXPORT void WKPreferencesSetNewBlockInsideInlineModelEnabled(WKPreferencesRef, bool);
 WK_EXPORT bool WKPreferencesGetNewBlockInsideInlineModelEnabled(WKPreferencesRef);
index b3af223..0500084 100644 (file)
@@ -335,6 +335,16 @@ static _WKStorageBlockingPolicy toAPI(WebCore::SecurityOrigin::StorageBlockingPo
     _preferences->setSimpleLineLayoutDebugBordersEnabled(simpleLineLayoutDebugBordersEnabled);
 }
 
+- (BOOL)_contentChangeObserverEnabled
+{
+    return _preferences->contentChangeObserverEnabled();
+}
+
+- (void)_setContentChangeObserverEnabled:(BOOL)contentChangeObserverEnabled
+{
+    _preferences->setContentChangeObserverEnabled(contentChangeObserverEnabled);
+}
+
 - (BOOL)_acceleratedDrawingEnabled
 {
     return _preferences->acceleratedDrawingEnabled();
index 435d1e1..ee6639c 100644 (file)
@@ -72,6 +72,7 @@ typedef NS_ENUM(NSInteger, _WKEditableLinkBehavior) {
 @property (nonatomic, setter=_setVisibleDebugOverlayRegions:) _WKDebugOverlayRegions _visibleDebugOverlayRegions WK_API_AVAILABLE(macosx(10.11), ios(9.0));
 @property (nonatomic, setter=_setSimpleLineLayoutEnabled:) BOOL _simpleLineLayoutEnabled WK_API_AVAILABLE(macosx(10.12), ios(10.0));
 @property (nonatomic, setter=_setSimpleLineLayoutDebugBordersEnabled:) BOOL _simpleLineLayoutDebugBordersEnabled WK_API_AVAILABLE(macosx(10.11), ios(9.0));
+@property (nonatomic, setter=_setContentChangeObserverEnabled:) BOOL _contentChangeObserverEnabled WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
 @property (nonatomic, setter=_setAcceleratedDrawingEnabled:) BOOL _acceleratedDrawingEnabled WK_API_AVAILABLE(macosx(10.12), ios(10.0));
 @property (nonatomic, setter=_setDisplayListDrawingEnabled:) BOOL _displayListDrawingEnabled WK_API_AVAILABLE(macosx(10.12), ios(10.0));
 @property (nonatomic, setter=_setLargeImageAsyncDecodingEnabled:) BOOL _largeImageAsyncDecodingEnabled WK_API_AVAILABLE(macosx(10.12.3), ios(10.3));
index 07a21e0..7a2a166 100644 (file)
@@ -573,6 +573,7 @@ void WebPage::handleSyntheticClick(Node& nodeRespondingToClick, const WebCore::F
         return;
     case WKContentIndeterminateChange: {
         // Wait for callback to completePendingSyntheticClickForContentChangeObserver() to decide whether to send the click event.
+        ASSERT(respondingDocument.settings().contentChangeObserverEnabled());
         m_pendingSyntheticClickNode = &nodeRespondingToClick;
         m_pendingSyntheticClickLocation = location;
         m_pendingSyntheticClickModifiers = modifiers;
index e4af1e0..2798396 100644 (file)
@@ -1,3 +1,20 @@
+2019-03-07  Zalan Bujtas  <zalan@apple.com>
+
+        [ContentChangeObserver] Add a setting to be able to turn content change observation on/off
+        https://bugs.webkit.org/show_bug.cgi?id=195353
+        <rdar://problem/48626394>
+
+        Reviewed by Simon Fraser.
+
+        * WebView/WebPreferenceKeysPrivate.h:
+        * WebView/WebPreferences.mm:
+        (+[WebPreferences initialize]):
+        (-[WebPreferences contentChangeObserverEnabled]):
+        (-[WebPreferences setContentChangeObserverEnabled:]):
+        * WebView/WebPreferencesPrivate.h:
+        * WebView/WebView.mm:
+        (-[WebView _preferencesChanged:]):
+
 2019-03-06  Sam Weinig  <sam@webkit.org>
 
         WebKitLegacy does not need to generate an export file for i386 anymore
index 059f5e1..1eff3b8 100644 (file)
 #define WebKitSubpixelAntialiasedLayerTextEnabledPreferenceKey @"WebKitSubpixelAntialiasedLayerTextEnabled"
 #define WebKitSimpleLineLayoutEnabledPreferenceKey @"WebKitSimpleLineLayoutEnabled"
 #define WebKitSimpleLineLayoutDebugBordersEnabledPreferenceKey @"WebKitSimpleLineLayoutDebugBordersEnabled"
+#define WebKitContentChangeObserverEnabledPreferenceKey @"WebKitContentChangeObserverEnabled"
 #define WebKitShowRepaintCounterPreferenceKey @"WebKitShowRepaintCounter"
 #define WebKitWebAudioEnabledPreferenceKey @"WebKitWebAudioEnabled"
 #define WebKitWebGLEnabledPreferenceKey @"WebKitWebGLEnabled"
index ab4217d..06163c8 100644 (file)
@@ -582,6 +582,7 @@ public:
         [NSNumber numberWithBool:NO],   WebKitPlugInSnapshottingEnabledPreferenceKey,
 
 #if PLATFORM(IOS_FAMILY)
+        [NSNumber numberWithBool:YES],  WebKitContentChangeObserverEnabledPreferenceKey,
         [NSNumber numberWithBool:NO],   WebKitTelephoneParsingEnabledPreferenceKey,
         [NSNumber numberWithInt:-1],      WebKitLayoutIntervalPreferenceKey,
         [NSNumber numberWithFloat:-1.0f], WebKitMaxParseDurationPreferenceKey,
@@ -1597,6 +1598,16 @@ public:
 {
     return [self _boolValueForKey:WebKitTelephoneParsingEnabledPreferenceKey];
 }
+
+- (BOOL)contentChangeObserverEnabled
+{
+    return [self _boolValueForKey:WebKitContentChangeObserverEnabledPreferenceKey];
+}
+
+- (void)setContentChangeObserverEnabled:(BOOL)enabled
+{
+    [self _setBoolValue:enabled forKey:WebKitContentChangeObserverEnabledPreferenceKey];
+}
 #endif
 
 #if ENABLE(TEXT_AUTOSIZING)
index bf08fc7..8b0915b 100644 (file)
@@ -354,6 +354,9 @@ extern NSString *WebPreferencesCacheModelChangedInternalNotification WEBKIT_DEPR
 
 - (void)setMediaPlaybackAllowsAirPlay:(BOOL)flag;
 - (BOOL)mediaPlaybackAllowsAirPlay;
+
+- (BOOL)contentChangeObserverEnabled;
+- (void)setContentChangeObserverEnabled:(BOOL)enabled;
 #endif
 
 - (void)_setTextAutosizingEnabled:(BOOL)enabled;
index 38fcb8a..f06f518 100644 (file)
@@ -3012,6 +3012,7 @@ static bool needsSelfRetainWhileLoadingQuirk()
     settings.setLayoutInterval(Seconds::fromMilliseconds([preferences _layoutInterval]));
     settings.setMaxParseDuration([preferences _maxParseDuration]);
     settings.setAlwaysUseAcceleratedOverflowScroll([preferences _alwaysUseAcceleratedOverflowScroll]);
+    settings.setContentChangeObserverEnabled([preferences contentChangeObserverEnabled]);
     DeprecatedGlobalSettings::setAudioSessionCategoryOverride([preferences audioSessionCategoryOverride]);
     DeprecatedGlobalSettings::setNetworkDataUsageTrackingEnabled([preferences networkDataUsageTrackingEnabled]);
     DeprecatedGlobalSettings::setNetworkInterfaceName([preferences networkInterfaceName]);
index 0aa3881..08dd184 100644 (file)
@@ -1,3 +1,14 @@
+2019-03-07  Zalan Bujtas  <zalan@apple.com>
+
+        [ContentChangeObserver] Add a setting to be able to turn content change observation on/off
+        https://bugs.webkit.org/show_bug.cgi?id=195353
+        <rdar://problem/48626394>
+
+        Reviewed by Simon Fraser.
+
+        * WebKitTestRunner/ios/TestControllerIOS.mm:
+        (WTR::TestController::platformResetPreferencesToConsistentValues):
+
 2019-03-07  John Wilander  <wilander@apple.com>
 
         Resource Load Statistics: Make it possible to purge only script-accessible cookies
index b011bcb..e5724f1 100644 (file)
@@ -128,6 +128,7 @@ void TestController::platformResetPreferencesToConsistentValues()
 {
     WKPreferencesRef preferences = platformPreferences();
     WKPreferencesSetTextAutosizingEnabled(preferences, false);
+    WKPreferencesSetContentChangeObserverEnabled(preferences, false);
 }
 
 void TestController::platformResetStateToConsistentValues(const TestOptions& options)