Add runtime flag for lazy image loading
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 Aug 2019 14:55:21 +0000 (14:55 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 Aug 2019 14:55:21 +0000 (14:55 +0000)
commit85a0c81334490e1cb608a70fa0ee468f040d66f5
treecb4931e07675ce54c0fce0f3f135c90606bf1d36
parent568bd83d798117b97b69b587eb8b06ae0bd20fa2
Add runtime flag for lazy image loading
https://bugs.webkit.org/show_bug.cgi?id=199794

Patch by Rob Buis <rbuis@igalia.com> on 2019-08-08
Reviewed by Darin Adler.

Source/WebCore:

Add loading attribute and expose it on HTMLImageElement.

* html/HTMLAttributeNames.in:
* html/HTMLImageElement.idl:
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setLazyImageLoadingEnabled):
(WebCore::RuntimeEnabledFeatures::lazyImageLoadingEnabled const):

Source/WebKit:

Add LazyImageLoading preference.

* Shared/WebPreferences.yaml:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetLazyImageLoadingEnabled):
(WKPreferencesGetLazyImageLoadingEnabled):
* UIProcess/API/C/WKPreferencesRefPrivate.h:

Source/WebKitLegacy/mac:

Set lazyImageLoading runtime flag if preference is set.

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

Source/WebKitLegacy/win:

Set lazyImageLoading runtime flag if preference is set.

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

Tools:

Set lazyImageLoading preference as part of experimental features. Add
TestOption for lazy image loading.

* 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@248409 268f45cc-cd09-0410-ab3c-d52691b4dbfc
26 files changed:
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLAttributeNames.in
Source/WebCore/html/HTMLImageElement.idl
Source/WebCore/page/RuntimeEnabledFeatures.h
Source/WebKit/ChangeLog
Source/WebKit/Shared/WebPreferences.yaml
Source/WebKit/UIProcess/API/C/WKPreferences.cpp
Source/WebKit/UIProcess/API/C/WKPreferencesRefPrivate.h
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
Tools/WebKitTestRunner/TestController.cpp
Tools/WebKitTestRunner/TestOptions.h