Add runtime flag for lazy image loading
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 6 Sep 2019 10:01:28 +0000 (10:01 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 6 Sep 2019 10:01:28 +0000 (10:01 +0000)
https://bugs.webkit.org/show_bug.cgi?id=199794

Patch by Rob Buis <rbuis@igalia.com> on 2019-09-06
Reviewed by Frédéric Wang.

Remove parts of r248409 that were meant for WK1 since
lazy image loading is WK2 only.

Source/WebKitLegacy/mac:

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences lazyImageLoadingEnabled]): Deleted.
(-[WebPreferences setLazyImageLoadingEnabled:]): Deleted.
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Source/WebKitLegacy/win:

* Interfaces/IWebPreferencesPrivate.idl:
* WebPreferenceKeysPrivate.h:
* WebPreferences.cpp:
(WebPreferences::initializeDefaultSettings):
(WebPreferences::setResizeObserverEnabled):
(WebPreferences::lazyImageLoadingEnabled): Deleted.
(WebPreferences::setLazyImageLoadingEnabled): Deleted.
* WebPreferences.h:
* WebView.cpp:
(WebView::notifyPreferencesChanged):

Tools:

* DumpRenderTree/TestOptions.cpp:
(TestOptions::TestOptions):
* DumpRenderTree/TestOptions.h:
* DumpRenderTree/mac/DumpRenderTree.mm:
(enableExperimentalFeatures):
(setWebPreferencesForTestOptions):
* DumpRenderTree/win/DumpRenderTree.cpp:
(enableExperimentalFeatures):

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

16 files changed:
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
Source/WebKitLegacy/win/ChangeLog
Source/WebKitLegacy/win/Interfaces/IWebPreferencesPrivate.idl
Source/WebKitLegacy/win/WebPreferenceKeysPrivate.h
Source/WebKitLegacy/win/WebPreferences.cpp
Source/WebKitLegacy/win/WebPreferences.h
Source/WebKitLegacy/win/WebView.cpp
Tools/ChangeLog
Tools/DumpRenderTree/TestOptions.cpp
Tools/DumpRenderTree/TestOptions.h
Tools/DumpRenderTree/mac/DumpRenderTree.mm
Tools/DumpRenderTree/win/DumpRenderTree.cpp

index 5b7de87..5ab4f9e 100644 (file)
@@ -1,3 +1,22 @@
+2019-09-06  Rob Buis  <rbuis@igalia.com>
+
+        Add runtime flag for lazy image loading
+        https://bugs.webkit.org/show_bug.cgi?id=199794
+
+        Reviewed by Frédéric Wang.
+
+        Remove parts of r248409 that were meant for WK1 since
+        lazy image loading is WK2 only.
+
+        * WebView/WebPreferenceKeysPrivate.h:
+        * WebView/WebPreferences.mm:
+        (+[WebPreferences initialize]):
+        (-[WebPreferences lazyImageLoadingEnabled]): Deleted.
+        (-[WebPreferences setLazyImageLoadingEnabled:]): Deleted.
+        * WebView/WebPreferencesPrivate.h:
+        * WebView/WebView.mm:
+        (-[WebView _preferencesChanged:]):
+
 2019-09-04  Alex Christensen  <achristensen@webkit.org>
 
         Remove unused SPI that accesses MemoryCache directly
index 1909ad3..1002d72 100644 (file)
 #define WebKitResizeObserverEnabledPreferenceKey @"WebKitResizeObserverEnabled"
 #define WebKitCoreMathMLEnabledPreferenceKey @"WebKitCoreMathMLEnabled"
 #define WebKitLinkPreloadResponsiveImagesEnabledPreferenceKey @"WebKitLinkPreloadResponsiveImagesEnabled"
-#define WebKitLazyImageLoadingEnabledPreferenceKey @"WebKitLazyImageLoadingEnabled"
 
index 3d227d0..c68549d 100644 (file)
@@ -689,7 +689,6 @@ public:
 #if ENABLE(RESIZE_OBSERVER)
         @NO, WebKitResizeObserverEnabledPreferenceKey,
 #endif
-        @NO, WebKitLazyImageLoadingEnabledPreferenceKey,
         @NO, WebKitCoreMathMLEnabledPreferenceKey,
         @NO, WebKitLinkPreloadResponsiveImagesEnabledPreferenceKey,
         nil];
@@ -3508,16 +3507,6 @@ static NSString *classIBCreatorID = nil;
     [self _setBoolValue:flag forKey:WebKitLinkPreloadResponsiveImagesEnabledPreferenceKey];
 }
 
-- (BOOL)lazyImageLoadingEnabled
-{
-    return [self _boolValueForKey:WebKitLazyImageLoadingEnabledPreferenceKey];
-}
-
-- (void)setLazyImageLoadingEnabled:(BOOL)flag
-{
-    [self _setBoolValue:flag forKey:WebKitLazyImageLoadingEnabledPreferenceKey];
-}
-
 @end
 
 @implementation WebPreferences (WebInternal)
index 2a4df68..def0251 100644 (file)
@@ -650,7 +650,6 @@ extern NSString *WebPreferencesCacheModelChangedInternalNotification WEBKIT_DEPR
 @property (nonatomic) BOOL resizeObserverEnabled;
 @property (nonatomic) BOOL coreMathMLEnabled;
 @property (nonatomic) BOOL linkPreloadResponsiveImagesEnabled;
-@property (nonatomic) BOOL lazyImageLoadingEnabled;
 
 #if TARGET_OS_IPHONE
 @property (nonatomic) BOOL quickLookDocumentSavingEnabled;
index 2237e22..3392970 100644 (file)
@@ -3184,7 +3184,6 @@ static bool needsSelfRetainWhileLoadingQuirk()
     RuntimeEnabledFeatures::sharedFeatures().setLinkPreloadResponsiveImagesEnabled([preferences linkPreloadResponsiveImagesEnabled]);
     RuntimeEnabledFeatures::sharedFeatures().setDialogElementEnabled([preferences dialogElementEnabled]);
     RuntimeEnabledFeatures::sharedFeatures().setKeygenElementEnabled([preferences keygenElementEnabled]);
-    RuntimeEnabledFeatures::sharedFeatures().setLazyImageLoadingEnabled([preferences lazyImageLoadingEnabled]);
 
 #if ENABLE(LEGACY_ENCRYPTED_MEDIA)
     RuntimeEnabledFeatures::sharedFeatures().setLegacyEncryptedMediaAPIEnabled(preferences.legacyEncryptedMediaAPIEnabled);
index 53f51eb..286a304 100644 (file)
@@ -1,3 +1,24 @@
+2019-09-06  Rob Buis  <rbuis@igalia.com>
+
+        Add runtime flag for lazy image loading
+        https://bugs.webkit.org/show_bug.cgi?id=199794
+
+        Reviewed by Frédéric Wang.
+
+        Remove parts of r248409 that were meant for WK1 since
+        lazy image loading is WK2 only.
+
+        * Interfaces/IWebPreferencesPrivate.idl:
+        * WebPreferenceKeysPrivate.h:
+        * WebPreferences.cpp:
+        (WebPreferences::initializeDefaultSettings):
+        (WebPreferences::setResizeObserverEnabled):
+        (WebPreferences::lazyImageLoadingEnabled): Deleted.
+        (WebPreferences::setLazyImageLoadingEnabled): Deleted.
+        * WebPreferences.h:
+        * WebView.cpp:
+        (WebView::notifyPreferencesChanged):
+
 2019-09-05  Fujii Hironori  <Hironori.Fujii@sony.com>
 
         [WinCairo][WK1] ASSERTION FAILED: !isAcceleratedCompositing() in WebView::updateBackingStore
index fbc7e23..7bbdc37 100644 (file)
@@ -244,6 +244,4 @@ interface IWebPreferencesPrivate7 : IWebPreferencesPrivate6
     HRESULT setResizeObserverEnabled([in] BOOL enabled);
     HRESULT coreMathMLEnabled([out, retval] BOOL* enabled);
     HRESULT setCoreMathMLEnabled([in] BOOL enabled);
-    HRESULT lazyImageLoadingEnabled([out, retval] BOOL*);
-    HRESULT setLazyImageLoadingEnabled([in] BOOL enabled);
 }
index b432837..edf86a6 100644 (file)
 #define WebKitResizeObserverEnabledPreferenceKey "WebKitResizeObserverEnabled"
 
 #define WebKitCoreMathMLEnabledPreferenceKey "WebKitCoreMathMLEnabled"
-
-#define WebKitLazyImageLoadingEnabledPreferenceKey "WebKitLazyImageLoadingEnabled"
index d616a17..8ce6288 100644 (file)
@@ -343,8 +343,6 @@ void WebPreferences::initializeDefaultSettings()
 
     CFDictionaryAddValue(defaults, CFSTR(WebKitCoreMathMLEnabledPreferenceKey), kCFBooleanFalse);
 
-    CFDictionaryAddValue(defaults, CFSTR(WebKitLazyImageLoadingEnabledPreferenceKey), kCFBooleanFalse);
-
     defaultSettings = defaults;
 #endif
 }
@@ -2362,17 +2360,3 @@ HRESULT WebPreferences::setResizeObserverEnabled(BOOL enabled)
     setBoolValue(WebKitResizeObserverEnabledPreferenceKey, enabled);
     return S_OK;
 }
-
-HRESULT WebPreferences::lazyImageLoadingEnabled(_Out_ BOOL* enabled)
-{
-    if (!enabled)
-        return E_POINTER;
-    *enabled = boolValueForKey(WebKitLazyImageLoadingEnabledPreferenceKey);
-    return S_OK;
-}
-
-HRESULT WebPreferences::setLazyImageLoadingEnabled(BOOL enabled)
-{
-    setBoolValue(WebKitLazyImageLoadingEnabledPreferenceKey, enabled);
-    return S_OK;
-}
index a401a82..0276503 100644 (file)
@@ -289,8 +289,6 @@ public:
     virtual HRESULT STDMETHODCALLTYPE setResizeObserverEnabled(BOOL);
     virtual HRESULT STDMETHODCALLTYPE coreMathMLEnabled(_Out_ BOOL*);
     virtual HRESULT STDMETHODCALLTYPE setCoreMathMLEnabled(BOOL);
-    virtual HRESULT STDMETHODCALLTYPE lazyImageLoadingEnabled(_Out_ BOOL*);
-    virtual HRESULT STDMETHODCALLTYPE setLazyImageLoadingEnabled(BOOL);
 
     // WebPreferences
 
index bd09bb5..c3ec7f9 100644 (file)
@@ -5608,11 +5608,6 @@ HRESULT WebView::notifyPreferencesChanged(IWebNotification* notification)
         return hr;
     settings.setCoreMathMLEnabled(!!enabled);
 
-    hr = prefsPrivate->lazyImageLoadingEnabled(&enabled);
-    if (FAILED(hr))
-        return hr;
-    RuntimeEnabledFeatures::sharedFeatures().setLazyImageLoadingEnabled(!!enabled);
-
     return S_OK;
 }
 
index 945df82..2df5dfc 100644 (file)
@@ -1,3 +1,22 @@
+2019-09-06  Rob Buis  <rbuis@igalia.com>
+
+        Add runtime flag for lazy image loading
+        https://bugs.webkit.org/show_bug.cgi?id=199794
+
+        Reviewed by Frédéric Wang.
+
+        Remove parts of r248409 that were meant for WK1 since
+        lazy image loading is WK2 only.
+
+        * DumpRenderTree/TestOptions.cpp:
+        (TestOptions::TestOptions):
+        * DumpRenderTree/TestOptions.h:
+        * DumpRenderTree/mac/DumpRenderTree.mm:
+        (enableExperimentalFeatures):
+        (setWebPreferencesForTestOptions):
+        * DumpRenderTree/win/DumpRenderTree.cpp:
+        (enableExperimentalFeatures):
+
 2019-09-05  Chris Dumez  <cdumez@apple.com>
 
         Stop using testRunner.setPrivateBrowsingEnabled_DEPRECATED() in imported/w3c/IndexedDB-private-browsing
index 70ade5e..0ba56c9 100644 (file)
@@ -121,8 +121,6 @@ TestOptions::TestOptions(const std::string& pathOrURL, const std::string& absolu
             enableResizeObserver = parseBooleanTestHeaderValue(value);
         else if (key == "experimental:CoreMathMLEnabled")
             enableCoreMathML = parseBooleanTestHeaderValue(value);
-        else if (key == "experimental:LazyImageLoadingEnabled")
-            enableLazyImageLoading = parseBooleanTestHeaderValue(value);
         pairStart = pairEnd + 1;
     }
 }
index e67351a..1f36e55 100644 (file)
@@ -50,7 +50,6 @@ struct TestOptions {
     bool adClickAttributionEnabled { false };
     bool enableResizeObserver { false };
     bool enableCoreMathML { false };
-    bool enableLazyImageLoading { false };
     std::string jscOptions;
     std::string additionalSupportedImageTypes;
 
index feed6be..47c0f88 100644 (file)
@@ -879,7 +879,6 @@ static void enableExperimentalFeatures(WebPreferences* preferences)
     [preferences setMediaRecorderEnabled:YES];
     [preferences setReferrerPolicyAttributeEnabled:YES];
     [preferences setLinkPreloadResponsiveImagesEnabled:YES];
-    [preferences setLazyImageLoadingEnabled:YES];
 }
 
 // Called before each test.
@@ -1027,7 +1026,6 @@ static void setWebPreferencesForTestOptions(const TestOptions& options)
     preferences.adClickAttributionEnabled = options.adClickAttributionEnabled;
     preferences.resizeObserverEnabled = options.enableResizeObserver;
     preferences.coreMathMLEnabled = options.enableCoreMathML;
-    preferences.lazyImageLoadingEnabled = options.enableLazyImageLoading;
     preferences.privateBrowsingEnabled = options.useEphemeralSession;
 }
 
index cb8fdf0..ffdf06b 100644 (file)
@@ -795,7 +795,6 @@ static void enableExperimentalFeatures(IWebPreferences* preferences)
     prefsPrivate->setResizeObserverEnabled(TRUE);
     prefsPrivate->setWebAnimationsEnabled(TRUE);
     prefsPrivate->setServerTimingEnabled(TRUE);
-    prefsPrivate->setLazyImageLoadingEnabled(TRUE);
     // FIXME: WebGL2
     // FIXME: WebRTC
 }