CSS Painting API should allow image values in inputProperties
authorjustin_michaud@apple.com <justin_michaud@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Dec 2018 20:25:02 +0000 (20:25 +0000)
committerjustin_michaud@apple.com <justin_michaud@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Dec 2018 20:25:02 +0000 (20:25 +0000)
commitba0203fb4d3c6916316e245f2471bfa4bc039ed0
tree7a0efe77f79b001a907c9a1429ef65defd67af74
parent4cde379a7e978014b6eec15e48e803fbaccc9298
CSS Painting API should allow image values in inputProperties
https://bugs.webkit.org/show_bug.cgi?id=192200

Reviewed by Dean Jackson.

Source/WebCore:

Adds new TypedOMCSSImageValue wrapper. We rename all the existing ones so that the naming is consistent (CSSImageValue is already a thing).
Finally, we let CanvasRenderingContext2DBase render these.

Tests: fast/css-custom-paint/arguments.html
       fast/css-custom-paint/image.html

* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/CallTracerTypes.h:
* bindings/js/JSTypedOMCSSStyleValueCustom.cpp: Renamed from Source/WebCore/bindings/js/JSCSSStyleValueCustom.cpp.
(WebCore::toJSNewlyCreated):
(WebCore::toJS):
* bindings/js/WebCoreBuiltinNames.h:
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::customPropertyValue):
* css/CSSCustomPropertyValue.cpp:
(WebCore::CSSCustomPropertyValue::equals const):
(WebCore::CSSCustomPropertyValue::customCSSText const):
(WebCore::CSSCustomPropertyValue::tokens const):
* css/CSSCustomPropertyValue.h:
* css/CSSPaintImageValue.cpp:
(WebCore::CSSPaintImageValue::image):
* css/typedom/StylePropertyMapReadOnly.h:
(WebCore::StylePropertyMapReadOnly::create):
(WebCore::StylePropertyMapReadOnly::get const):
(WebCore::StylePropertyMapReadOnly::StylePropertyMapReadOnly):
* css/typedom/StylePropertyMapReadOnly.idl:
* css/typedom/TypedOMCSSImageValue.h: Copied from Source/WebCore/css/typedom/CSSUnitValue.h.
* css/typedom/TypedOMCSSImageValue.idl: Copied from Source/WebCore/css/typedom/CSSStyleValue.idl.
* css/typedom/TypedOMCSSNumericValue.h: Renamed from Source/WebCore/css/typedom/CSSNumericValue.h.
* css/typedom/TypedOMCSSNumericValue.idl: Renamed from Source/WebCore/css/typedom/CSSNumericValue.idl.
* css/typedom/TypedOMCSSStyleValue.h: Renamed from Source/WebCore/css/typedom/CSSStyleValue.h.
(WebCore::TypedOMCSSStyleValue::isImageValue):
* css/typedom/TypedOMCSSStyleValue.idl: Renamed from Source/WebCore/css/typedom/CSSStyleValue.idl.
* css/typedom/TypedOMCSSUnitValue.h: Renamed from Source/WebCore/css/typedom/CSSUnitValue.h.
* css/typedom/TypedOMCSSUnitValue.idl: Renamed from Source/WebCore/css/typedom/CSSUnitValue.idl.
* css/typedom/TypedOMCSSUnparsedValue.h: Renamed from Source/WebCore/css/typedom/CSSUnparsedValue.h.
* css/typedom/TypedOMCSSUnparsedValue.idl: Renamed from Source/WebCore/css/typedom/CSSUnparsedValue.idl.
* html/ImageBitmap.cpp:
(WebCore::ImageBitmap::createPromise):
* html/ImageBitmap.h:
* html/canvas/CanvasDrawImage.idl:
* html/canvas/CanvasFillStrokeStyles.idl:
* html/canvas/CanvasRenderingContext.cpp:
(WebCore::CanvasRenderingContext::checkOrigin):
* html/canvas/CanvasRenderingContext.h:
* html/canvas/CanvasRenderingContext2DBase.cpp:
(WebCore::size):
(WebCore::CanvasRenderingContext2DBase::drawImage):
(WebCore::CanvasRenderingContext2DBase::createPattern):
* html/canvas/CanvasRenderingContext2DBase.h:
* inspector/InspectorCanvas.cpp:
(WebCore::InspectorCanvas::buildAction):
* page/WindowOrWorkerGlobalScope.idl:
* platform/graphics/CustomPaintImage.cpp:
(WebCore::CustomPaintImage::doCustomPaint):

LayoutTests:

* fast/css-custom-paint/arguments-expected.html: Added.
* fast/css-custom-paint/arguments.html: Added.
* fast/css-custom-paint/image-expected.html: Added.
* fast/css-custom-paint/image.html: Added.
* fast/css-custom-paint/resources/test-image.png: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238872 268f45cc-cd09-0410-ab3c-d52691b4dbfc
42 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/css-custom-paint/arguments-expected.html [new file with mode: 0644]
LayoutTests/fast/css-custom-paint/arguments.html [new file with mode: 0644]
LayoutTests/fast/css-custom-paint/image-expected.html [new file with mode: 0644]
LayoutTests/fast/css-custom-paint/image.html [new file with mode: 0644]
LayoutTests/fast/css-custom-paint/resources/test-image.png [new file with mode: 0644]
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/DerivedSources.make
Source/WebCore/Sources.txt
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/bindings/js/CallTracerTypes.h
Source/WebCore/bindings/js/JSTypedOMCSSStyleValueCustom.cpp [moved from Source/WebCore/bindings/js/JSCSSStyleValueCustom.cpp with 75% similarity]
Source/WebCore/bindings/js/WebCoreBuiltinNames.h
Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Source/WebCore/css/CSSCustomPropertyValue.cpp
Source/WebCore/css/CSSCustomPropertyValue.h
Source/WebCore/css/CSSPaintImageValue.cpp
Source/WebCore/css/typedom/StylePropertyMapReadOnly.h
Source/WebCore/css/typedom/StylePropertyMapReadOnly.idl
Source/WebCore/css/typedom/TypedOMCSSImageValue.h [new file with mode: 0644]
Source/WebCore/css/typedom/TypedOMCSSImageValue.idl [new file with mode: 0644]
Source/WebCore/css/typedom/TypedOMCSSNumericValue.h [moved from Source/WebCore/css/typedom/CSSNumericValue.h with 91% similarity]
Source/WebCore/css/typedom/TypedOMCSSNumericValue.idl [moved from Source/WebCore/css/typedom/CSSNumericValue.idl with 94% similarity]
Source/WebCore/css/typedom/TypedOMCSSStyleValue.h [moved from Source/WebCore/css/typedom/CSSStyleValue.h with 86% similarity]
Source/WebCore/css/typedom/TypedOMCSSStyleValue.idl [moved from Source/WebCore/css/typedom/CSSStyleValue.idl with 96% similarity]
Source/WebCore/css/typedom/TypedOMCSSUnitValue.h [moved from Source/WebCore/css/typedom/CSSUnitValue.h with 87% similarity]
Source/WebCore/css/typedom/TypedOMCSSUnitValue.idl [moved from Source/WebCore/css/typedom/CSSUnitValue.idl with 95% similarity]
Source/WebCore/css/typedom/TypedOMCSSUnparsedValue.h [moved from Source/WebCore/css/typedom/CSSUnparsedValue.h with 84% similarity]
Source/WebCore/css/typedom/TypedOMCSSUnparsedValue.idl [moved from Source/WebCore/css/typedom/CSSUnparsedValue.idl with 94% similarity]
Source/WebCore/html/ImageBitmap.cpp
Source/WebCore/html/ImageBitmap.h
Source/WebCore/html/canvas/CanvasDrawImage.idl
Source/WebCore/html/canvas/CanvasFillStrokeStyles.idl
Source/WebCore/html/canvas/CanvasRenderingContext.cpp
Source/WebCore/html/canvas/CanvasRenderingContext.h
Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp
Source/WebCore/html/canvas/CanvasRenderingContext2DBase.h
Source/WebCore/inspector/InspectorCanvas.cpp
Source/WebCore/page/WindowOrWorkerGlobalScope.idl
Source/WebCore/platform/graphics/CustomPaintImage.cpp
Source/WebCore/platform/graphics/gpu/GPUSwapChain.h