Implement feature flag and bindings for CSS Painting API
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 Oct 2018 18:04:43 +0000 (18:04 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 Oct 2018 18:04:43 +0000 (18:04 +0000)
commitba1a10fb16674789cd4388d6e38d361d8ce38c56
tree65ac0767fff79bb8d0e323aadef46eb4ba63384e
parente99b84141da9544ef903b770b446ded49e719e3b
Implement feature flag and bindings for CSS Painting API
https://bugs.webkit.org/show_bug.cgi?id=190237

Patch by Justin Michaud <justin_michaud@apple.com> on 2018-10-16
Reviewed by Ryosuke Niwa.

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

Add feature flag and bindings for CSS Painting API. This adds a new property,
CSS.paintWorkletGlobalScope, which will be a temporary way to access the paint
worklet global scope untill CSS.paintWorklet is implemented.

There are a few small changes, mostly adding headers and "using" declarations,
that were required to get this to build. This is probably related to unified sources.

Tests: fast/css-custom-paint/basic.html
       fast/css-custom-paint/registerPaintBindings.html

* CMakeLists.txt:
* Configurations/FeatureDefines.xcconfig:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSCSSPaintWorkletGlobalScopeCustom.cpp: Added.
(WebCore::throwInvalidModificationError):
(WebCore::JSCSSPaintWorkletGlobalScope::registerPaint):
* bindings/js/JSEventListener.cpp:
* bindings/js/JSRemoteDOMWindowCustom.cpp:
* bindings/js/JSWebMetalRenderPassAttachmentDescriptorCustom.cpp:
* bindings/js/WebCoreBuiltinNames.h:
* css/CSSPaintCallback.h: Copied from Source/WebCore/css/MediaQueryParserContext.cpp.
(WebCore::CSSPaintCallback::~CSSPaintCallback):
* css/CSSPaintCallback.idl: Added.
* css/CSSPaintWorkletGlobalScope.cpp: Copied from Source/WebCore/css/MediaQueryParserContext.cpp.
(WebCore::CSSPaintWorkletGlobalScope::create):
(WebCore::CSSPaintWorkletGlobalScope::CSSPaintWorkletGlobalScope):
(WebCore::CSSPaintWorkletGlobalScope::devicePixelRatio):
(WebCore::CSSPaintWorkletGlobalScope::addRegisteredPaint):
* css/CSSPaintWorkletGlobalScope.h: Copied from Source/WebCore/css/MediaQueryParserContext.cpp.
(WebCore::CSSPaintWorkletGlobalScope::paintDefinitionMap):
* css/CSSPaintWorkletGlobalScope.idl: Added.
* css/DOMCSSPaintWorklet.cpp: Copied from Source/WebCore/css/MediaQueryParserContext.cpp.
(WebCore::DOMCSSPaintWorklet::ensurePaintWorkletGlobalScope):
(WebCore::DOMCSSPaintWorklet::from):
(WebCore::DOMCSSPaintWorklet::supplementName):
* css/DOMCSSPaintWorklet.h: Copied from Source/WebCore/css/MediaQueryParserContext.cpp.
* css/DOMCSSPaintWorklet.idl: Added.
* css/MediaQueryParserContext.cpp:
* css/StyleBuilder.h:
* dom/Document.cpp:
(WebCore::Document::ensureCSSPaintWorkletGlobalScope):
* dom/Document.h:
* features.json:
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setCSSPaintingAPIEnabled):
(WebCore::RuntimeEnabledFeatures::cssPaintingAPIEnabled const):

Source/WebCore/PAL:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit:

* Configurations/FeatureDefines.xcconfig:
* Shared/WebPreferences.yaml:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):

Source/WebKitLegacy/mac:

* Configurations/FeatureDefines.xcconfig:

Tools:

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

LayoutTests:

Add basic tests for the CSS Painting API registerPaint function,
and test the custom bindings.

* fast/css-custom-paint/basic-expected.txt: Added.
* fast/css-custom-paint/basic.html: Added.
* fast/css-custom-paint/registerPaintBindings-expected.txt: Added.
* fast/css-custom-paint/registerPaintBindings.html: Added.
* platform/ios-wk1/TestExpectations:
* platform/mac-wk1/TestExpectations:
* platform/win/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237192 268f45cc-cd09-0410-ab3c-d52691b4dbfc
45 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/css-custom-paint/basic-expected.txt [new file with mode: 0644]
LayoutTests/fast/css-custom-paint/basic.html [new file with mode: 0644]
LayoutTests/fast/css-custom-paint/registerPaintBindings-expected.txt [new file with mode: 0644]
LayoutTests/fast/css-custom-paint/registerPaintBindings.html [new file with mode: 0644]
LayoutTests/platform/ios-wk1/TestExpectations
LayoutTests/platform/mac-wk1/TestExpectations
LayoutTests/platform/win/TestExpectations
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/Configurations/FeatureDefines.xcconfig
Source/WebCore/DerivedSources.make
Source/WebCore/PAL/ChangeLog
Source/WebCore/PAL/Configurations/FeatureDefines.xcconfig
Source/WebCore/Sources.txt
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/bindings/js/JSCSSPaintWorkletGlobalScopeCustom.cpp [new file with mode: 0644]
Source/WebCore/bindings/js/JSEventListener.cpp
Source/WebCore/bindings/js/JSRemoteDOMWindowCustom.cpp
Source/WebCore/bindings/js/JSWebMetalRenderPassAttachmentDescriptorCustom.cpp
Source/WebCore/bindings/js/WebCoreBuiltinNames.h
Source/WebCore/css/CSSPaintCallback.h [new file with mode: 0644]
Source/WebCore/css/CSSPaintCallback.idl [new file with mode: 0644]
Source/WebCore/css/CSSPaintWorkletGlobalScope.cpp [new file with mode: 0644]
Source/WebCore/css/CSSPaintWorkletGlobalScope.h [new file with mode: 0644]
Source/WebCore/css/CSSPaintWorkletGlobalScope.idl [new file with mode: 0644]
Source/WebCore/css/DOMCSSPaintWorklet.cpp [new file with mode: 0644]
Source/WebCore/css/DOMCSSPaintWorklet.h [new file with mode: 0644]
Source/WebCore/css/DOMCSSPaintWorklet.idl [new file with mode: 0644]
Source/WebCore/css/MediaQueryParserContext.cpp
Source/WebCore/css/StyleBuilder.h
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/Document.h
Source/WebCore/features.json
Source/WebCore/page/RuntimeEnabledFeatures.h
Source/WebKit/ChangeLog
Source/WebKit/Configurations/FeatureDefines.xcconfig
Source/WebKit/Shared/WebPreferences.yaml
Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.cpp
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/Configurations/FeatureDefines.xcconfig
Tools/ChangeLog
Tools/TestWebKitAPI/Configurations/FeatureDefines.xcconfig