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)
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

index 1919537..5494364 100644 (file)
@@ -1,3 +1,16 @@
+2018-12-04  Justin Michaud  <justin_michaud@apple.com>
+
+        CSS Painting API should allow image values in inputProperties
+        https://bugs.webkit.org/show_bug.cgi?id=192200
+
+        Reviewed by Dean Jackson.
+
+        * 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.
+
 2018-12-04  Ryan Haddad  <ryanhaddad@apple.com>
 
         Unreviewed, rolling out r238838.
 2018-12-04  Ryan Haddad  <ryanhaddad@apple.com>
 
         Unreviewed, rolling out r238838.
diff --git a/LayoutTests/fast/css-custom-paint/arguments-expected.html b/LayoutTests/fast/css-custom-paint/arguments-expected.html
new file mode 100644 (file)
index 0000000..f6c56a7
--- /dev/null
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<style>
+  .paint {
+    width: 150px;
+    height: 150px;
+  }
+</style>
+
+<body>
+  <div class="paint" style="background: green;"></div>
+</body>
diff --git a/LayoutTests/fast/css-custom-paint/arguments.html b/LayoutTests/fast/css-custom-paint/arguments.html
new file mode 100644 (file)
index 0000000..59f8376
--- /dev/null
@@ -0,0 +1,37 @@
+<!DOCTYPE html><!-- webkit-test-runner [ experimental:CSSPaintingAPIEnabled=true ] -->
+<meta name="author" title="Justin Michaud" href="mailto:justin_michaud@webkit.org">
+<meta name="assert" content="Test that paint worklets parse arguments correctly">
+<link rel="help" content="https://drafts.css-houdini.org/css-paint-api-1/">
+<script src="resources/testharness.js"></script>
+
+<script id="code" type="text/worklet">
+class MyPaint {
+  static get inputArguments() { return Array(5).fill('*') }
+  paint(ctx, geom, props, args) {
+    // Note: This does not pass on Chrome. Chrome seems to strip the whitespace.
+    const expected = [" a", " url(\"\")", " (d)", "e", " f"];
+    for (const i of expected.keys()) {
+      assert_equals(args[i].toString(), expected[i]);
+    }
+    ctx.fillStyle = "green";
+    ctx.fillRect(0, 0, geom.width, geom.height);
+  }
+}
+registerPaint('my-paint', MyPaint);
+</script>
+
+<script type="text/javascript">
+importWorklet(CSS.paintWorklet, document.getElementById('code').textContent);
+</script>
+
+<style>
+  .paint {
+    width: 150px;
+    height: 150px;
+    background: paint(my-paint, a, url(''), (d),e,          f);
+  }
+</style>
+
+<body>
+  <div class="paint"></div>
+</body>
diff --git a/LayoutTests/fast/css-custom-paint/image-expected.html b/LayoutTests/fast/css-custom-paint/image-expected.html
new file mode 100644 (file)
index 0000000..7854b5a
--- /dev/null
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<style>
+  #paint {
+    width: 150px;
+    height: 150px;
+    border: none;
+    background: url('resources/test-image.png');
+    background-size: 150px 150px;
+  }
+</style>
+
+<body>
+  <div id="paint"></div>
+  <div style="width: 10px; height: 200px; position: absolute; top: 0; left: 2px; background: black"></div>
+  <div style="width: 10px; height: 200px; position: absolute; top: 0; left: 155px; background: black"></div>
+  <div style="width: 10px; height: 200px; position: absolute; top: 0; left: 80px; background: black"></div>
+  <div style="width: 200px; height: 10px; position: absolute; top: 2px; left: 0; background: black"></div>
+  <div style="width: 200px; height: 10px; position: absolute; top: 155px; left: 0; background: black"></div>
+  <div style="width: 200px; height: 10px; position: absolute; top: 30px; left: 0; background: black"></div>
+  <div style="width: 200px; height: 10px; position: absolute; top: 120px; left: 0; background: black"></div>
+</body>
diff --git a/LayoutTests/fast/css-custom-paint/image.html b/LayoutTests/fast/css-custom-paint/image.html
new file mode 100644 (file)
index 0000000..97d7550
--- /dev/null
@@ -0,0 +1,40 @@
+<!DOCTYPE html><!-- webkit-test-runner [ experimental:CSSPaintingAPIEnabled=true ] -->
+<meta name="author" title="Justin Michaud" href="mailto:justin_michaud@webkit.org">
+<meta name="assert" content="Test that paint worklets do not crash if the constructor throws">
+<link rel="help" content="https://drafts.css-houdini.org/css-paint-api-1/">
+<script src="resources/testharness.js"></script>
+
+<script id="code" type="text/worklet">
+  class MyPaint {
+    static get inputProperties() { return ['border-image-source']; }
+    paint(ctx, geom, properties) {
+      ctx.drawImage(properties.get('border-image-source'), 0, 0, geom.width, geom.height);
+    }
+  }
+  registerPaint('my-paint', MyPaint);
+</script>
+
+<script type="text/javascript">
+  importWorklet(CSS.paintWorklet, document.getElementById('code').textContent);
+</script>
+
+<style>
+  #paint {
+    width: 150px;
+    height: 150px;
+    border: 0px solid black;
+    border-image-source: url('resources/test-image.png');
+    background: paint(my-paint);
+  }
+</style>
+
+<body>
+  <div id="paint"></div>
+  <div style="width: 10px; height: 200px; position: absolute; top: 0; left: 2px; background: black"></div>
+  <div style="width: 10px; height: 200px; position: absolute; top: 0; left: 155px; background: black"></div>
+  <div style="width: 10px; height: 200px; position: absolute; top: 0; left: 80px; background: black"></div>
+  <div style="width: 200px; height: 10px; position: absolute; top: 2px; left: 0; background: black"></div>
+  <div style="width: 200px; height: 10px; position: absolute; top: 155px; left: 0; background: black"></div>
+  <div style="width: 200px; height: 10px; position: absolute; top: 30px; left: 0; background: black"></div>
+  <div style="width: 200px; height: 10px; position: absolute; top: 120px; left: 0; background: black"></div>
+</body>
diff --git a/LayoutTests/fast/css-custom-paint/resources/test-image.png b/LayoutTests/fast/css-custom-paint/resources/test-image.png
new file mode 100644 (file)
index 0000000..df667c4
Binary files /dev/null and b/LayoutTests/fast/css-custom-paint/resources/test-image.png differ
index 7ca751f..51e17d4 100644 (file)
@@ -593,10 +593,11 @@ set(WebCore_NON_SVG_IDL_FILES
     css/StyleSheet.idl
     css/StyleSheetList.idl
 
     css/StyleSheet.idl
     css/StyleSheetList.idl
 
-    css/typedom/CSSNumericValue.idl
-    css/typedom/CSSStyleValue.idl
-    css/typedom/CSSUnitValue.idl
-    css/typedom/CSSUnparsedValue.idl
+    css/typedom/TypedOMCSSImageValue.idl
+    css/typedom/TypedOMCSSNumericValue.idl
+    css/typedom/TypedOMCSSStyleValue.idl
+    css/typedom/TypedOMCSSUnitValue.idl
+    css/typedom/TypedOMCSSUnparsedValue.idl
     css/typedom/StylePropertyMapReadOnly.idl
 
     css/WebKitCSSMatrix.idl
     css/typedom/StylePropertyMapReadOnly.idl
 
     css/WebKitCSSMatrix.idl
index e6ee9ed..9e7aeb8 100644 (file)
@@ -1,3 +1,69 @@
+2018-12-04  Justin Michaud  <justin_michaud@apple.com>
+
+        CSS Painting API should allow image values in inputProperties
+        https://bugs.webkit.org/show_bug.cgi?id=192200
+
+        Reviewed by Dean Jackson.
+
+        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):
+
 2018-12-04  Chris Dumez  <cdumez@apple.com>
 
         Regression(r238817) PSON Page Cache API tests are failing
 2018-12-04  Chris Dumez  <cdumez@apple.com>
 
         Regression(r238817) PSON Page Cache API tests are failing
index 3e57b1b..971a638 100644 (file)
@@ -502,11 +502,12 @@ JS_BINDING_IDLS = \
     $(WebCore)/css/StyleMedia.idl \
     $(WebCore)/css/StyleSheet.idl \
     $(WebCore)/css/StyleSheetList.idl \
     $(WebCore)/css/StyleMedia.idl \
     $(WebCore)/css/StyleSheet.idl \
     $(WebCore)/css/StyleSheetList.idl \
-    $(WebCore)/css/typedom/CSSNumericValue.idl \
-    $(WebCore)/css/typedom/CSSStyleValue.idl \
-    $(WebCore)/css/typedom/CSSUnitValue.idl \
-    $(WebCore)/css/typedom/CSSUnparsedValue.idl \
     $(WebCore)/css/typedom/StylePropertyMapReadOnly.idl \
     $(WebCore)/css/typedom/StylePropertyMapReadOnly.idl \
+       $(WebCore)/css/typedom/TypedOMCSSImageValue.idl \
+    $(WebCore)/css/typedom/TypedOMCSSNumericValue.idl \
+    $(WebCore)/css/typedom/TypedOMCSSStyleValue.idl \
+    $(WebCore)/css/typedom/TypedOMCSSUnitValue.idl \
+    $(WebCore)/css/typedom/TypedOMCSSUnparsedValue.idl \
     $(WebCore)/css/WebKitCSSMatrix.idl \
     $(WebCore)/css/WebKitCSSViewportRule.idl \
     $(WebCore)/dom/AbortController.idl \
     $(WebCore)/css/WebKitCSSMatrix.idl \
     $(WebCore)/css/WebKitCSSViewportRule.idl \
     $(WebCore)/dom/AbortController.idl \
index e745cd5..3146462 100644 (file)
@@ -388,7 +388,6 @@ bindings/js/JSBlobCustom.cpp
 bindings/js/JSCSSRuleCustom.cpp
 bindings/js/JSCSSRuleListCustom.cpp
 bindings/js/JSCSSStyleDeclarationCustom.cpp
 bindings/js/JSCSSRuleCustom.cpp
 bindings/js/JSCSSRuleListCustom.cpp
 bindings/js/JSCSSStyleDeclarationCustom.cpp
-bindings/js/JSCSSStyleValueCustom.cpp
 bindings/js/JSDOMConvertDate.cpp
 bindings/js/JSDOMConvertNumbers.cpp
 bindings/js/JSDOMConvertStrings.cpp
 bindings/js/JSDOMConvertDate.cpp
 bindings/js/JSDOMConvertNumbers.cpp
 bindings/js/JSDOMConvertStrings.cpp
@@ -478,6 +477,7 @@ bindings/js/JSTextTrackCustom.cpp
 bindings/js/JSTextTrackListCustom.cpp
 bindings/js/JSTrackCustom.cpp
 bindings/js/JSTreeWalkerCustom.cpp
 bindings/js/JSTextTrackListCustom.cpp
 bindings/js/JSTrackCustom.cpp
 bindings/js/JSTreeWalkerCustom.cpp
+bindings/js/JSTypedOMCSSStyleValueCustom.cpp
 bindings/js/JSVideoTrackCustom.cpp
 bindings/js/JSVideoTrackListCustom.cpp
 bindings/js/JSWebAnimationCustom.cpp
 bindings/js/JSVideoTrackCustom.cpp
 bindings/js/JSVideoTrackListCustom.cpp
 bindings/js/JSWebAnimationCustom.cpp
@@ -2501,17 +2501,18 @@ JSBlobPropertyBag.cpp
 JSByteLengthQueuingStrategy.cpp
 JSCDATASection.cpp
 JSCSSFontFaceRule.cpp
 JSByteLengthQueuingStrategy.cpp
 JSCDATASection.cpp
 JSCSSFontFaceRule.cpp
+JSTypedOMCSSImageValue.cpp
+JSTypedOMCSSNumericValue.cpp
+JSTypedOMCSSStyleValue.cpp
+JSTypedOMCSSUnitValue.cpp
+JSTypedOMCSSUnparsedValue.cpp
 JSCSSImportRule.cpp
 JSCSSKeyframeRule.cpp
 JSCSSKeyframesRule.cpp
 JSCSSMediaRule.cpp
 JSCSSNamespaceRule.cpp
 JSCSSImportRule.cpp
 JSCSSKeyframeRule.cpp
 JSCSSKeyframesRule.cpp
 JSCSSMediaRule.cpp
 JSCSSNamespaceRule.cpp
-JSCSSNumericValue.cpp
 JSCSSPaintCallback.cpp
 JSCSSPaintSize.cpp
 JSCSSPaintCallback.cpp
 JSCSSPaintSize.cpp
-JSCSSStyleValue.cpp
-JSCSSUnitValue.cpp
-JSCSSUnparsedValue.cpp
 JSPaintWorkletGlobalScope.cpp
 JSWorklet.cpp
 JSWorkletGlobalScope.cpp
 JSPaintWorkletGlobalScope.cpp
 JSWorklet.cpp
 JSWorkletGlobalScope.cpp
index 66f7b8d..7a26ffc 100644 (file)
                4B2708C70AF19EE40065127F /* Pasteboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B2708C50AF19EE40065127F /* Pasteboard.h */; settings = {ATTRIBUTES = (Private, ); }; };
                4B3043CD0AE0373B00A82647 /* Editor.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B3043CB0AE0373B00A82647 /* Editor.h */; settings = {ATTRIBUTES = (Private, ); }; };
                4B3480940EEF50D400AC1B41 /* ImageSourceCG.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B3480920EEF50D400AC1B41 /* ImageSourceCG.h */; };
                4B2708C70AF19EE40065127F /* Pasteboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B2708C50AF19EE40065127F /* Pasteboard.h */; settings = {ATTRIBUTES = (Private, ); }; };
                4B3043CD0AE0373B00A82647 /* Editor.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B3043CB0AE0373B00A82647 /* Editor.h */; settings = {ATTRIBUTES = (Private, ); }; };
                4B3480940EEF50D400AC1B41 /* ImageSourceCG.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B3480920EEF50D400AC1B41 /* ImageSourceCG.h */; };
+               4B438650219CD56100F8D3C5 /* TypedOMCSSImageValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B43864F219CD56100F8D3C5 /* TypedOMCSSImageValue.h */; };
                4B5BDD9B21658A1500DD4262 /* CSSPaintCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B5BDD9A21658A1500DD4262 /* CSSPaintCallback.h */; };
                4B6B5CBD21640EFF00603817 /* DOMCSSPaintWorklet.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B6B5CB82163EC0700603817 /* DOMCSSPaintWorklet.h */; settings = {ATTRIBUTES = (Private, ); }; };
                4B6B5CC02164386400603817 /* PaintWorkletGlobalScope.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B6B5CBF2164386400603817 /* PaintWorkletGlobalScope.h */; };
                4B5BDD9B21658A1500DD4262 /* CSSPaintCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B5BDD9A21658A1500DD4262 /* CSSPaintCallback.h */; };
                4B6B5CBD21640EFF00603817 /* DOMCSSPaintWorklet.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B6B5CB82163EC0700603817 /* DOMCSSPaintWorklet.h */; settings = {ATTRIBUTES = (Private, ); }; };
                4B6B5CC02164386400603817 /* PaintWorkletGlobalScope.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B6B5CBF2164386400603817 /* PaintWorkletGlobalScope.h */; };
                4BAE95B10B2FA9CE00AED8A0 /* EditorDeleteAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BAE95B00B2FA9CE00AED8A0 /* EditorDeleteAction.h */; settings = {ATTRIBUTES = (Private, ); }; };
                4BAFD0CB2190EBD600C0AB64 /* CSSPaintSize.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BAFD0CA2190EBD600C0AB64 /* CSSPaintSize.h */; };
                4BAFD0CF2190F9B500C0AB64 /* StylePropertyMapReadOnly.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BAFD0CE2190F9B400C0AB64 /* StylePropertyMapReadOnly.h */; };
                4BAE95B10B2FA9CE00AED8A0 /* EditorDeleteAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BAE95B00B2FA9CE00AED8A0 /* EditorDeleteAction.h */; settings = {ATTRIBUTES = (Private, ); }; };
                4BAFD0CB2190EBD600C0AB64 /* CSSPaintSize.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BAFD0CA2190EBD600C0AB64 /* CSSPaintSize.h */; };
                4BAFD0CF2190F9B500C0AB64 /* StylePropertyMapReadOnly.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BAFD0CE2190F9B400C0AB64 /* StylePropertyMapReadOnly.h */; };
-               4BAFD0D62192146B00C0AB64 /* CSSStyleValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BAFD0D52192146B00C0AB64 /* CSSStyleValue.h */; };
-               4BAFD0D921921EA000C0AB64 /* CSSUnparsedValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BAFD0D821921EA000C0AB64 /* CSSUnparsedValue.h */; };
-               4BAFD0E0219220AB00C0AB64 /* CSSNumericValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BAFD0DF219220AB00C0AB64 /* CSSNumericValue.h */; };
-               4BAFD0E1219242A000C0AB64 /* CSSUnitValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BAFD0DD2192209200C0AB64 /* CSSUnitValue.h */; };
+               4BAFD0D62192146B00C0AB64 /* TypedOMCSSStyleValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BAFD0D52192146B00C0AB64 /* TypedOMCSSStyleValue.h */; };
+               4BAFD0D921921EA000C0AB64 /* TypedOMCSSUnparsedValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BAFD0D821921EA000C0AB64 /* TypedOMCSSUnparsedValue.h */; };
+               4BAFD0E0219220AB00C0AB64 /* TypedOMCSSNumericValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BAFD0DF219220AB00C0AB64 /* TypedOMCSSNumericValue.h */; };
+               4BAFD0E1219242A000C0AB64 /* TypedOMCSSUnitValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BAFD0DD2192209200C0AB64 /* TypedOMCSSUnitValue.h */; };
                4BDA3FFE2151B6F500FD6604 /* DOMCSSCustomPropertyDescriptor.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BDA3FF82151B6F200FD6604 /* DOMCSSCustomPropertyDescriptor.h */; };
                4BDA3FFF2151B6F500FD6604 /* DOMCSSRegisterCustomProperty.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BDA3FF92151B6F300FD6604 /* DOMCSSRegisterCustomProperty.h */; };
                4BDA40012151B6F500FD6604 /* CSSRegisteredCustomProperty.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BDA3FFB2151B6F400FD6604 /* CSSRegisteredCustomProperty.h */; settings = {ATTRIBUTES = (Private, ); }; };
                4BDA3FFE2151B6F500FD6604 /* DOMCSSCustomPropertyDescriptor.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BDA3FF82151B6F200FD6604 /* DOMCSSCustomPropertyDescriptor.h */; };
                4BDA3FFF2151B6F500FD6604 /* DOMCSSRegisterCustomProperty.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BDA3FF92151B6F300FD6604 /* DOMCSSRegisterCustomProperty.h */; };
                4BDA40012151B6F500FD6604 /* CSSRegisteredCustomProperty.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BDA3FFB2151B6F400FD6604 /* CSSRegisteredCustomProperty.h */; settings = {ATTRIBUTES = (Private, ); }; };
                4B3043CB0AE0373B00A82647 /* Editor.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Editor.h; sourceTree = "<group>"; };
                4B3480910EEF50D400AC1B41 /* ImageSourceCGMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ImageSourceCGMac.mm; sourceTree = "<group>"; };
                4B3480920EEF50D400AC1B41 /* ImageSourceCG.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageSourceCG.h; sourceTree = "<group>"; };
                4B3043CB0AE0373B00A82647 /* Editor.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Editor.h; sourceTree = "<group>"; };
                4B3480910EEF50D400AC1B41 /* ImageSourceCGMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ImageSourceCGMac.mm; sourceTree = "<group>"; };
                4B3480920EEF50D400AC1B41 /* ImageSourceCG.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageSourceCG.h; sourceTree = "<group>"; };
+               4B43864D219CD52D00F8D3C5 /* TypedOMCSSImageValue.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = TypedOMCSSImageValue.idl; sourceTree = "<group>"; };
+               4B43864F219CD56100F8D3C5 /* TypedOMCSSImageValue.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TypedOMCSSImageValue.h; sourceTree = "<group>"; };
                4B5BDD99216588E500DD4262 /* CSSPaintCallback.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = CSSPaintCallback.idl; sourceTree = "<group>"; };
                4B5BDD9A21658A1500DD4262 /* CSSPaintCallback.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CSSPaintCallback.h; sourceTree = "<group>"; };
                4B6B5CB62163DC1A00603817 /* DOMCSSPaintWorklet.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = DOMCSSPaintWorklet.idl; sourceTree = "<group>"; };
                4B5BDD99216588E500DD4262 /* CSSPaintCallback.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = CSSPaintCallback.idl; sourceTree = "<group>"; };
                4B5BDD9A21658A1500DD4262 /* CSSPaintCallback.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CSSPaintCallback.h; sourceTree = "<group>"; };
                4B6B5CB62163DC1A00603817 /* DOMCSSPaintWorklet.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = DOMCSSPaintWorklet.idl; sourceTree = "<group>"; };
                4BAFD0CD2190EBE900C0AB64 /* CSSPaintSize.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = CSSPaintSize.idl; sourceTree = "<group>"; };
                4BAFD0CE2190F9B400C0AB64 /* StylePropertyMapReadOnly.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = StylePropertyMapReadOnly.h; sourceTree = "<group>"; };
                4BAFD0D02190F9C200C0AB64 /* StylePropertyMapReadOnly.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = StylePropertyMapReadOnly.idl; sourceTree = "<group>"; };
                4BAFD0CD2190EBE900C0AB64 /* CSSPaintSize.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = CSSPaintSize.idl; sourceTree = "<group>"; };
                4BAFD0CE2190F9B400C0AB64 /* StylePropertyMapReadOnly.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = StylePropertyMapReadOnly.h; sourceTree = "<group>"; };
                4BAFD0D02190F9C200C0AB64 /* StylePropertyMapReadOnly.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = StylePropertyMapReadOnly.idl; sourceTree = "<group>"; };
-               4BAFD0D32192145600C0AB64 /* CSSStyleValue.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = CSSStyleValue.idl; sourceTree = "<group>"; };
-               4BAFD0D52192146B00C0AB64 /* CSSStyleValue.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CSSStyleValue.h; sourceTree = "<group>"; };
-               4BAFD0D721921E7900C0AB64 /* CSSUnparsedValue.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = CSSUnparsedValue.idl; sourceTree = "<group>"; };
-               4BAFD0D821921EA000C0AB64 /* CSSUnparsedValue.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CSSUnparsedValue.h; sourceTree = "<group>"; };
-               4BAFD0DB2192202200C0AB64 /* CSSNumericValue.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = CSSNumericValue.idl; sourceTree = "<group>"; };
-               4BAFD0DC2192204A00C0AB64 /* CSSUnitValue.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = CSSUnitValue.idl; sourceTree = "<group>"; };
-               4BAFD0DD2192209200C0AB64 /* CSSUnitValue.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; path = CSSUnitValue.h; sourceTree = "<group>"; };
-               4BAFD0DF219220AB00C0AB64 /* CSSNumericValue.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CSSNumericValue.h; sourceTree = "<group>"; };
-               4BAFD0E22192604D00C0AB64 /* JSCSSStyleValueCustom.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = JSCSSStyleValueCustom.cpp; sourceTree = "<group>"; };
+               4BAFD0D32192145600C0AB64 /* TypedOMCSSStyleValue.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = TypedOMCSSStyleValue.idl; sourceTree = "<group>"; };
+               4BAFD0D52192146B00C0AB64 /* TypedOMCSSStyleValue.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TypedOMCSSStyleValue.h; sourceTree = "<group>"; };
+               4BAFD0D721921E7900C0AB64 /* TypedOMCSSUnparsedValue.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = TypedOMCSSUnparsedValue.idl; sourceTree = "<group>"; };
+               4BAFD0D821921EA000C0AB64 /* TypedOMCSSUnparsedValue.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TypedOMCSSUnparsedValue.h; sourceTree = "<group>"; };
+               4BAFD0DB2192202200C0AB64 /* TypedOMCSSNumericValue.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = TypedOMCSSNumericValue.idl; sourceTree = "<group>"; };
+               4BAFD0DC2192204A00C0AB64 /* TypedOMCSSUnitValue.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = TypedOMCSSUnitValue.idl; sourceTree = "<group>"; };
+               4BAFD0DD2192209200C0AB64 /* TypedOMCSSUnitValue.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; path = TypedOMCSSUnitValue.h; sourceTree = "<group>"; };
+               4BAFD0DF219220AB00C0AB64 /* TypedOMCSSNumericValue.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TypedOMCSSNumericValue.h; sourceTree = "<group>"; };
+               4BAFD0E22192604D00C0AB64 /* JSTypedOMCSSStyleValueCustom.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = JSTypedOMCSSStyleValueCustom.cpp; sourceTree = "<group>"; };
                4BDA3FF52151B6F000FD6604 /* DOMCSSRegisterCustomProperty.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DOMCSSRegisterCustomProperty.idl; sourceTree = "<group>"; };
                4BDA3FF72151B6F100FD6604 /* DOMCSSRegisterCustomProperty.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMCSSRegisterCustomProperty.cpp; sourceTree = "<group>"; };
                4BDA3FF82151B6F200FD6604 /* DOMCSSCustomPropertyDescriptor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMCSSCustomPropertyDescriptor.h; sourceTree = "<group>"; };
                4BDA3FF52151B6F000FD6604 /* DOMCSSRegisterCustomProperty.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DOMCSSRegisterCustomProperty.idl; sourceTree = "<group>"; };
                4BDA3FF72151B6F100FD6604 /* DOMCSSRegisterCustomProperty.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMCSSRegisterCustomProperty.cpp; sourceTree = "<group>"; };
                4BDA3FF82151B6F200FD6604 /* DOMCSSCustomPropertyDescriptor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMCSSCustomPropertyDescriptor.h; sourceTree = "<group>"; };
                4BAFD0DA21921EAD00C0AB64 /* typedom */ = {
                        isa = PBXGroup;
                        children = (
                4BAFD0DA21921EAD00C0AB64 /* typedom */ = {
                        isa = PBXGroup;
                        children = (
-                               4BAFD0DF219220AB00C0AB64 /* CSSNumericValue.h */,
-                               4BAFD0DB2192202200C0AB64 /* CSSNumericValue.idl */,
-                               4BAFD0D52192146B00C0AB64 /* CSSStyleValue.h */,
-                               4BAFD0D32192145600C0AB64 /* CSSStyleValue.idl */,
-                               4BAFD0DD2192209200C0AB64 /* CSSUnitValue.h */,
-                               4BAFD0DC2192204A00C0AB64 /* CSSUnitValue.idl */,
-                               4BAFD0D821921EA000C0AB64 /* CSSUnparsedValue.h */,
-                               4BAFD0D721921E7900C0AB64 /* CSSUnparsedValue.idl */,
                                4BAFD0CE2190F9B400C0AB64 /* StylePropertyMapReadOnly.h */,
                                4BAFD0D02190F9C200C0AB64 /* StylePropertyMapReadOnly.idl */,
                                4BAFD0CE2190F9B400C0AB64 /* StylePropertyMapReadOnly.h */,
                                4BAFD0D02190F9C200C0AB64 /* StylePropertyMapReadOnly.idl */,
+                               4B43864F219CD56100F8D3C5 /* TypedOMCSSImageValue.h */,
+                               4B43864D219CD52D00F8D3C5 /* TypedOMCSSImageValue.idl */,
+                               4BAFD0DF219220AB00C0AB64 /* TypedOMCSSNumericValue.h */,
+                               4BAFD0DB2192202200C0AB64 /* TypedOMCSSNumericValue.idl */,
+                               4BAFD0D52192146B00C0AB64 /* TypedOMCSSStyleValue.h */,
+                               4BAFD0D32192145600C0AB64 /* TypedOMCSSStyleValue.idl */,
+                               4BAFD0DD2192209200C0AB64 /* TypedOMCSSUnitValue.h */,
+                               4BAFD0DC2192204A00C0AB64 /* TypedOMCSSUnitValue.idl */,
+                               4BAFD0D821921EA000C0AB64 /* TypedOMCSSUnparsedValue.h */,
+                               4BAFD0D721921E7900C0AB64 /* TypedOMCSSUnparsedValue.idl */,
                        );
                        path = typedom;
                        sourceTree = "<group>";
                        );
                        path = typedom;
                        sourceTree = "<group>";
                                9392262E10321084006E7D5D /* JSCSSRuleListCustom.cpp */,
                                BC5825F20C0B89380053F1B5 /* JSCSSStyleDeclarationCustom.cpp */,
                                AD726FEA16D9F40B003A4E6D /* JSCSSStyleDeclarationCustom.h */,
                                9392262E10321084006E7D5D /* JSCSSRuleListCustom.cpp */,
                                BC5825F20C0B89380053F1B5 /* JSCSSStyleDeclarationCustom.cpp */,
                                AD726FEA16D9F40B003A4E6D /* JSCSSStyleDeclarationCustom.h */,
-                               4BAFD0E22192604D00C0AB64 /* JSCSSStyleValueCustom.cpp */,
                                BC20FB7E0C0E8E6C00D1447F /* JSDeprecatedCSSOMValueCustom.cpp */,
                                49C7BA8C1042F5B10009D447 /* JSDocumentCustom.cpp */,
                                ADDA94BF19686F8000453029 /* JSDocumentCustom.h */,
                                BC20FB7E0C0E8E6C00D1447F /* JSDeprecatedCSSOMValueCustom.cpp */,
                                49C7BA8C1042F5B10009D447 /* JSDocumentCustom.cpp */,
                                ADDA94BF19686F8000453029 /* JSDocumentCustom.h */,
                                070334E8145A1F35008D8D45 /* JSTrackCustom.cpp */,
                                07846384145B1B8E00A58DF1 /* JSTrackCustom.h */,
                                516BB7920CE91E6800512F79 /* JSTreeWalkerCustom.cpp */,
                                070334E8145A1F35008D8D45 /* JSTrackCustom.cpp */,
                                07846384145B1B8E00A58DF1 /* JSTrackCustom.h */,
                                516BB7920CE91E6800512F79 /* JSTreeWalkerCustom.cpp */,
+                               4BAFD0E22192604D00C0AB64 /* JSTypedOMCSSStyleValueCustom.cpp */,
                                BE6DF708171CA2C500DD52B8 /* JSVideoTrackCustom.cpp */,
                                BE6DF70A171CA2C500DD52B8 /* JSVideoTrackListCustom.cpp */,
                                715DA5D3201BB902002EF2B0 /* JSWebAnimationCustom.cpp */,
                                BE6DF708171CA2C500DD52B8 /* JSVideoTrackCustom.cpp */,
                                BE6DF70A171CA2C500DD52B8 /* JSVideoTrackListCustom.cpp */,
                                715DA5D3201BB902002EF2B0 /* JSWebAnimationCustom.cpp */,
                                A80E6D030A1989CA007FB8C5 /* CSSMediaRule.h in Headers */,
                                314BE3A11B30F6B700141982 /* CSSNamedImageValue.h in Headers */,
                                94E839511DFB2A0E007BC6A7 /* CSSNamespaceRule.h in Headers */,
                                A80E6D030A1989CA007FB8C5 /* CSSMediaRule.h in Headers */,
                                314BE3A11B30F6B700141982 /* CSSNamedImageValue.h in Headers */,
                                94E839511DFB2A0E007BC6A7 /* CSSNamespaceRule.h in Headers */,
-                               4BAFD0E0219220AB00C0AB64 /* CSSNumericValue.h in Headers */,
                                A80E6D000A1989CA007FB8C5 /* CSSPageRule.h in Headers */,
                                4B5BDD9B21658A1500DD4262 /* CSSPaintCallback.h in Headers */,
                                4B6E87692176D69200420E5E /* CSSPaintImageValue.h in Headers */,
                                A80E6D000A1989CA007FB8C5 /* CSSPageRule.h in Headers */,
                                4B5BDD9B21658A1500DD4262 /* CSSPaintCallback.h in Headers */,
                                4B6E87692176D69200420E5E /* CSSPaintImageValue.h in Headers */,
                                A80E6E0F0A19911C007FB8C5 /* CSSStyleDeclaration.h in Headers */,
                                A80E6D0C0A1989CA007FB8C5 /* CSSStyleRule.h in Headers */,
                                A8EA80070A19516E00A8EF5F /* CSSStyleSheet.h in Headers */,
                                A80E6E0F0A19911C007FB8C5 /* CSSStyleDeclaration.h in Headers */,
                                A80E6D0C0A1989CA007FB8C5 /* CSSStyleRule.h in Headers */,
                                A8EA80070A19516E00A8EF5F /* CSSStyleSheet.h in Headers */,
-                               4BAFD0D62192146B00C0AB64 /* CSSStyleValue.h in Headers */,
                                94DE5C921D83011D00164F2A /* CSSSupportsParser.h in Headers */,
                                FC54D05716A7673100575E4D /* CSSSupportsRule.h in Headers */,
                                BC80C9880CD294EE00A0B7B3 /* CSSTimingFunctionValue.h in Headers */,
                                94DE5C921D83011D00164F2A /* CSSSupportsParser.h in Headers */,
                                FC54D05716A7673100575E4D /* CSSSupportsRule.h in Headers */,
                                BC80C9880CD294EE00A0B7B3 /* CSSTimingFunctionValue.h in Headers */,
                                A882DA231593848D000115ED /* CSSToStyleMap.h in Headers */,
                                715AD7212050513F00D592DC /* CSSTransition.h in Headers */,
                                371F53E90D2704F900ECE0D5 /* CSSUnicodeRangeValue.h in Headers */,
                                A882DA231593848D000115ED /* CSSToStyleMap.h in Headers */,
                                715AD7212050513F00D592DC /* CSSTransition.h in Headers */,
                                371F53E90D2704F900ECE0D5 /* CSSUnicodeRangeValue.h in Headers */,
-                               4BAFD0E1219242A000C0AB64 /* CSSUnitValue.h in Headers */,
                                DD7CDF250A23CF9800069928 /* CSSUnknownRule.h in Headers */,
                                DD7CDF250A23CF9800069928 /* CSSUnknownRule.h in Headers */,
-                               4BAFD0D921921EA000C0AB64 /* CSSUnparsedValue.h in Headers */,
                                BC7D8FF01BD03B6400FFE540 /* CSSUnsetValue.h in Headers */,
                                A80E6CEE0A1989CA007FB8C5 /* CSSValue.h in Headers */,
                                6565815109D13043000E61D7 /* CSSValueKeywords.h in Headers */,
                                BC7D8FF01BD03B6400FFE540 /* CSSUnsetValue.h in Headers */,
                                A80E6CEE0A1989CA007FB8C5 /* CSSValue.h in Headers */,
                                6565815109D13043000E61D7 /* CSSValueKeywords.h in Headers */,
                                854FE7390A2297BE0058D7AD /* TreeWalker.h in Headers */,
                                C375D7FE16639519006184AB /* TypeAhead.h in Headers */,
                                E46A2B1C17CA65B9000DBCD8 /* TypedElementDescendantIterator.h in Headers */,
                                854FE7390A2297BE0058D7AD /* TreeWalker.h in Headers */,
                                C375D7FE16639519006184AB /* TypeAhead.h in Headers */,
                                E46A2B1C17CA65B9000DBCD8 /* TypedElementDescendantIterator.h in Headers */,
+                               4B438650219CD56100F8D3C5 /* TypedOMCSSImageValue.h in Headers */,
+                               4BAFD0E0219220AB00C0AB64 /* TypedOMCSSNumericValue.h in Headers */,
+                               4BAFD0D62192146B00C0AB64 /* TypedOMCSSStyleValue.h in Headers */,
+                               4BAFD0E1219242A000C0AB64 /* TypedOMCSSUnitValue.h in Headers */,
+                               4BAFD0D921921EA000C0AB64 /* TypedOMCSSUnparsedValue.h in Headers */,
                                93309E1A099E64920056E581 /* TypingCommand.h in Headers */,
                                85031B4E0A44EFC700F992E0 /* UIEvent.h in Headers */,
                                83FE7CA71DA9F1A70037237C /* UIEventInit.h in Headers */,
                                93309E1A099E64920056E581 /* TypingCommand.h in Headers */,
                                85031B4E0A44EFC700F992E0 /* UIEvent.h in Headers */,
                                83FE7CA71DA9F1A70037237C /* UIEventInit.h in Headers */,
index 598f344..cc3055d 100644 (file)
@@ -36,6 +36,7 @@
 #include "ImageBitmap.h"
 #include "ImageData.h"
 #include "Path2D.h"
 #include "ImageBitmap.h"
 #include "ImageData.h"
 #include "Path2D.h"
+#include "TypedOMCSSImageValue.h"
 #include <JavaScriptCore/ArrayBuffer.h>
 #include <JavaScriptCore/ArrayBufferView.h>
 #include <JavaScriptCore/Float32Array.h>
 #include <JavaScriptCore/ArrayBuffer.h>
 #include <JavaScriptCore/ArrayBufferView.h>
 #include <JavaScriptCore/Float32Array.h>
@@ -91,6 +92,9 @@ typedef Variant<
     RefPtr<HTMLVideoElement>,
 #endif
     RefPtr<ImageBitmap>,
     RefPtr<HTMLVideoElement>,
 #endif
     RefPtr<ImageBitmap>,
+#if ENABLE(CSS_PAINTING_API)
+    RefPtr<TypedOMCSSImageValue>,
+#endif
     RefPtr<ImageData>,
     RefPtr<Int32Array>,
     Vector<float>,
     RefPtr<ImageData>,
     RefPtr<Int32Array>,
     Vector<float>,
  */
 
 #include "config.h"
  */
 
 #include "config.h"
-#include "JSCSSStyleValue.h"
+#include "JSTypedOMCSSStyleValue.h"
 
 #if ENABLE(CSS_PAINTING_API)
 
 
 #if ENABLE(CSS_PAINTING_API)
 
-#include "JSCSSUnitValue.h"
-#include "JSCSSUnparsedValue.h"
+#include "JSTypedOMCSSImageValue.h"
+#include "JSTypedOMCSSUnitValue.h"
+#include "JSTypedOMCSSUnparsedValue.h"
 
 namespace WebCore {
 using namespace JSC;
 
 
 namespace WebCore {
 using namespace JSC;
 
-JSValue toJSNewlyCreated(ExecState*, JSDOMGlobalObject* globalObject, Ref<CSSStyleValue>&& value)
+JSValue toJSNewlyCreated(ExecState*, JSDOMGlobalObject* globalObject, Ref<TypedOMCSSStyleValue>&& value)
 {
     if (value->isUnitValue())
 {
     if (value->isUnitValue())
-        return createWrapper<CSSUnitValue>(globalObject, WTFMove(value));
+        return createWrapper<TypedOMCSSUnitValue>(globalObject, WTFMove(value));
     if (value->isUnparsedValue())
     if (value->isUnparsedValue())
-        return createWrapper<CSSUnparsedValue>(globalObject, WTFMove(value));
+        return createWrapper<TypedOMCSSUnparsedValue>(globalObject, WTFMove(value));
+    if (value->isImageValue())
+        return createWrapper<TypedOMCSSImageValue>(globalObject, WTFMove(value));
 
     ASSERT_NOT_REACHED();
 
     ASSERT_NOT_REACHED();
-    return createWrapper<CSSStyleValue>(globalObject, WTFMove(value));
+    return createWrapper<TypedOMCSSStyleValue>(globalObject, WTFMove(value));
 }
 
 }
 
-JSValue toJS(ExecState* state, JSDOMGlobalObject* globalObject, CSSStyleValue& object)
+JSValue toJS(ExecState* state, JSDOMGlobalObject* globalObject, TypedOMCSSStyleValue& object)
 {
     return wrap(state, globalObject, object);
 }
 {
     return wrap(state, globalObject, object);
 }
index 9f614c2..79452de 100644 (file)
@@ -58,6 +58,7 @@ namespace WebCore {
     macro(Credential) \
     macro(CredentialsContainer) \
     macro(CSSAnimation) \
     macro(Credential) \
     macro(CredentialsContainer) \
     macro(CSSAnimation) \
+    macro(CSSImageValue) \
     macro(CSSNumericValue) \
     macro(CSSPaintSize) \
     macro(CSSStyleValue) \
     macro(CSSNumericValue) \
     macro(CSSPaintSize) \
     macro(CSSStyleValue) \
index f1b50fb..58f73fb 100644 (file)
@@ -2638,7 +2638,7 @@ RefPtr<CSSValue> ComputedStyleExtractor::customPropertyValue(const String& prope
     if (!value)
         return nullptr;
 
     if (!value)
         return nullptr;
 
-    auto visitor = WTF::makeVisitor([&](const Ref<CSSVariableReferenceValue>&) {
+    return WTF::switchOn(value->value(), [&](const Ref<CSSVariableReferenceValue>&) {
         ASSERT_NOT_REACHED();
         return RefPtr<CSSValue>();
     }, [&](const CSSValueID&) {
         ASSERT_NOT_REACHED();
         return RefPtr<CSSValue>();
     }, [&](const CSSValueID&) {
@@ -2647,8 +2647,9 @@ RefPtr<CSSValue> ComputedStyleExtractor::customPropertyValue(const String& prope
         return CSSCustomPropertyValue::create(*value);
     }, [&](const Length& value) {
         return zoomAdjustedPixelValueForLength(value, *style);
         return CSSCustomPropertyValue::create(*value);
     }, [&](const Length& value) {
         return zoomAdjustedPixelValueForLength(value, *style);
+    }, [&](const Ref<StyleImage>&) {
+        return CSSCustomPropertyValue::create(*value);
     });
     });
-    return WTF::visit(visitor, value->value());
 }
 
 String ComputedStyleExtractor::customPropertyText(const String& propertyName)
 }
 
 String ComputedStyleExtractor::customPropertyText(const String& propertyName)
index e6966ff..13a73e3 100644 (file)
@@ -33,7 +33,7 @@ bool CSSCustomPropertyValue::equals(const CSSCustomPropertyValue& other) const
 {
     if (m_name != other.m_name || m_value.index() != other.m_value.index())
         return false;
 {
     if (m_name != other.m_name || m_value.index() != other.m_value.index())
         return false;
-    auto visitor = WTF::makeVisitor([&](const Ref<CSSVariableReferenceValue>& value) {
+    return WTF::switchOn(m_value, [&](const Ref<CSSVariableReferenceValue>& value) {
         return value.get() == WTF::get<Ref<CSSVariableReferenceValue>>(other.m_value).get();
     }, [&](const CSSValueID& value) {
         return value == WTF::get<CSSValueID>(other.m_value);
         return value.get() == WTF::get<Ref<CSSVariableReferenceValue>>(other.m_value).get();
     }, [&](const CSSValueID& value) {
         return value == WTF::get<CSSValueID>(other.m_value);
@@ -41,8 +41,9 @@ bool CSSCustomPropertyValue::equals(const CSSCustomPropertyValue& other) const
         return value.get() == WTF::get<Ref<CSSVariableData>>(other.m_value).get();
     }, [&](const Length& value) {
         return value == WTF::get<Length>(other.m_value);
         return value.get() == WTF::get<Ref<CSSVariableData>>(other.m_value).get();
     }, [&](const Length& value) {
         return value == WTF::get<Length>(other.m_value);
+    }, [&](const Ref<StyleImage>& value) {
+        return value.get() == WTF::get<Ref<StyleImage>>(other.m_value).get();
     });
     });
-    return WTF::visit(visitor, m_value);
 }
 
 String CSSCustomPropertyValue::customCSSText() const
 }
 
 String CSSCustomPropertyValue::customCSSText() const
@@ -50,7 +51,7 @@ String CSSCustomPropertyValue::customCSSText() const
     if (!m_serialized) {
         m_serialized = true;
 
     if (!m_serialized) {
         m_serialized = true;
 
-        auto visitor = WTF::makeVisitor([&](const Ref<CSSVariableReferenceValue>& value) {
+        WTF::switchOn(m_value, [&](const Ref<CSSVariableReferenceValue>& value) {
             m_stringValue = value->cssText();
         }, [&](const CSSValueID& value) {
             m_stringValue = getValueName(value);
             m_stringValue = value->cssText();
         }, [&](const CSSValueID& value) {
             m_stringValue = getValueName(value);
@@ -58,8 +59,9 @@ String CSSCustomPropertyValue::customCSSText() const
             m_stringValue = value->tokenRange().serialize();
         }, [&](const Length& value) {
             m_stringValue = CSSPrimitiveValue::create(value.value(), CSSPrimitiveValue::CSS_PX)->cssText();
             m_stringValue = value->tokenRange().serialize();
         }, [&](const Length& value) {
             m_stringValue = CSSPrimitiveValue::create(value.value(), CSSPrimitiveValue::CSS_PX)->cssText();
+        }, [&](const Ref<StyleImage>& value) {
+            m_stringValue = value->cssValue()->cssText();
         });
         });
-        WTF::visit(visitor, m_value);
     }
     return m_stringValue;
 }
     }
     return m_stringValue;
 }
@@ -68,7 +70,7 @@ Vector<CSSParserToken> CSSCustomPropertyValue::tokens() const
 {
     Vector<CSSParserToken> result;
 
 {
     Vector<CSSParserToken> result;
 
-    auto visitor = WTF::makeVisitor([&](const Ref<CSSVariableReferenceValue>&) {
+    WTF::switchOn(m_value, [&](const Ref<CSSVariableReferenceValue>&) {
         ASSERT_NOT_REACHED();
     }, [&](const CSSValueID&) {
         // Do nothing
         ASSERT_NOT_REACHED();
     }, [&](const CSSValueID&) {
         // Do nothing
@@ -80,8 +82,13 @@ Vector<CSSParserToken> CSSCustomPropertyValue::tokens() const
         auto tokenizerRange = tokenizer.tokenRange();
         while (!tokenizerRange.atEnd())
             result.append(tokenizerRange.consume());
         auto tokenizerRange = tokenizer.tokenRange();
         while (!tokenizerRange.atEnd())
             result.append(tokenizerRange.consume());
+    }, [&](const Ref<StyleImage>&) {
+        CSSTokenizer tokenizer(cssText());
+
+        auto tokenizerRange = tokenizer.tokenRange();
+        while (!tokenizerRange.atEnd())
+            result.append(tokenizerRange.consume());
     });
     });
-    WTF::visit(visitor, m_value);
 
     return result;
 }
 
     return result;
 }
index 625e195..fe85025 100644 (file)
@@ -29,6 +29,7 @@
 #include "CSSValue.h"
 #include "CSSVariableReferenceValue.h"
 #include "Length.h"
 #include "CSSValue.h"
 #include "CSSVariableReferenceValue.h"
 #include "Length.h"
+#include "StyleImage.h"
 #include <wtf/RefPtr.h>
 #include <wtf/Variant.h>
 #include <wtf/text/WTFString.h>
 #include <wtf/RefPtr.h>
 #include <wtf/Variant.h>
 #include <wtf/text/WTFString.h>
@@ -41,7 +42,7 @@ class RenderStyle;
 
 class CSSCustomPropertyValue final : public CSSValue {
 public:
 
 class CSSCustomPropertyValue final : public CSSValue {
 public:
-    using VariantValue = Variant<Ref<CSSVariableReferenceValue>, CSSValueID, Ref<CSSVariableData>, Length>;
+    using VariantValue = Variant<Ref<CSSVariableReferenceValue>, CSSValueID, Ref<CSSVariableData>, Length, Ref<StyleImage>>;
 
     static Ref<CSSCustomPropertyValue> createUnresolved(const AtomicString& name, Ref<CSSVariableReferenceValue>&& value)
     {
 
     static Ref<CSSCustomPropertyValue> createUnresolved(const AtomicString& name, Ref<CSSVariableReferenceValue>&& value)
     {
@@ -69,6 +70,11 @@ public:
         return adoptRef(*new CSSCustomPropertyValue(name, { WTFMove(value) }));
     }
 
         return adoptRef(*new CSSCustomPropertyValue(name, { WTFMove(value) }));
     }
 
+    static Ref<CSSCustomPropertyValue> createSyntaxImage(const AtomicString& name, Ref<StyleImage>&& value)
+    {
+        return adoptRef(*new CSSCustomPropertyValue(name, { WTFMove(value) }));
+    }
+
     static Ref<CSSCustomPropertyValue> create(const CSSCustomPropertyValue& other)
     {
         return adoptRef(*new CSSCustomPropertyValue(other));
     static Ref<CSSCustomPropertyValue> create(const CSSCustomPropertyValue& other)
     {
         return adoptRef(*new CSSCustomPropertyValue(other));
@@ -111,6 +117,8 @@ private:
             m_value = value.copyRef();
         }, [&](const Length& value) {
             m_value = value;
             m_value = value.copyRef();
         }, [&](const Length& value) {
             m_value = value;
+        }, [&](const Ref<StyleImage>& value) {
+            m_value = value.copyRef();
         });
         WTF::visit(visitor, other.m_value);
     }
         });
         WTF::visit(visitor, other.m_value);
     }
index 1466526..796846e 100644 (file)
@@ -69,7 +69,11 @@ RefPtr<Image> CSSPaintImageValue::image(RenderElement& renderElement, const Floa
         while (!localRange.atEnd() && localRange.peek() != CommaToken) {
             if (localRange.peek() == CommentToken)
                 localRange.consume();
         while (!localRange.atEnd() && localRange.peek() != CommaToken) {
             if (localRange.peek() == CommentToken)
                 localRange.consume();
-            else
+            else if (localRange.peek().getBlockType() == CSSParserToken::BlockStart) {
+                localRange.peek().serialize(builder);
+                builder.append(localRange.consumeBlock().serialize());
+                builder.append(')');
+            } else
                 localRange.consume().serialize(builder);
         }
         if (!localRange.atEnd())
                 localRange.consume().serialize(builder);
         }
         if (!localRange.atEnd())
index 5993f8b..35104cb 100644 (file)
@@ -27,7 +27,7 @@
 
 #if ENABLE(CSS_PAINTING_API)
 
 
 #if ENABLE(CSS_PAINTING_API)
 
-#include "CSSStyleValue.h"
+#include "TypedOMCSSStyleValue.h"
 #include <wtf/HashMap.h>
 #include <wtf/RefCounted.h>
 #include <wtf/text/WTFString.h>
 #include <wtf/HashMap.h>
 #include <wtf/RefCounted.h>
 #include <wtf/text/WTFString.h>
@@ -36,20 +36,20 @@ namespace WebCore {
 
 class StylePropertyMapReadOnly : public RefCounted<StylePropertyMapReadOnly> {
 public:
 
 class StylePropertyMapReadOnly : public RefCounted<StylePropertyMapReadOnly> {
 public:
-    static Ref<StylePropertyMapReadOnly> create(HashMap<String, Ref<CSSStyleValue>>&& map)
+    static Ref<StylePropertyMapReadOnly> create(HashMap<String, Ref<TypedOMCSSStyleValue>>&& map)
     {
         return adoptRef(*new StylePropertyMapReadOnly(WTFMove(map)));
     }
 
     {
         return adoptRef(*new StylePropertyMapReadOnly(WTFMove(map)));
     }
 
-    CSSStyleValue* get(String property) const { return m_map.get(property); }
+    TypedOMCSSStyleValue* get(String property) const { return m_map.get(property); }
 
 private:
 
 private:
-    explicit StylePropertyMapReadOnly(HashMap<String, Ref<CSSStyleValue>>&& map)
+    explicit StylePropertyMapReadOnly(HashMap<String, Ref<TypedOMCSSStyleValue>>&& map)
         : m_map(WTFMove(map))
     {
     }
 
         : m_map(WTFMove(map))
     {
     }
 
-    HashMap<String, Ref<CSSStyleValue>> m_map;
+    HashMap<String, Ref<TypedOMCSSStyleValue>> m_map;
 };
 
 } // namespace WebCore
 };
 
 } // namespace WebCore
index b7e1983..e8ff335 100644 (file)
@@ -32,6 +32,6 @@
     Exposed=(Window,Worker,PaintWorklet),
     ImplementationLacksVTable
 ] interface StylePropertyMapReadOnly {
     Exposed=(Window,Worker,PaintWorklet),
     ImplementationLacksVTable
 ] interface StylePropertyMapReadOnly {
-    // FIXME: should be (undefined or CSSStyleValue), not null
-    CSSStyleValue? get(USVString property);
+    // FIXME: should be (undefined or TypedOMCSSStyleValue), not null
+    TypedOMCSSStyleValue? get(USVString property);
 };
 };
diff --git a/Source/WebCore/css/typedom/TypedOMCSSImageValue.h b/Source/WebCore/css/typedom/TypedOMCSSImageValue.h
new file mode 100644 (file)
index 0000000..dde1b1d
--- /dev/null
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2018 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(CSS_PAINTING_API)
+
+#include "CSSImageValue.h"
+#include "ImageBitmap.h"
+#include "RenderElement.h"
+#include "TypedOMCSSStyleValue.h"
+#include <wtf/RefCounted.h>
+#include <wtf/text/StringConcatenateNumbers.h>
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+class TypedOMCSSImageValue final : public TypedOMCSSStyleValue {
+public:
+    static Ref<TypedOMCSSImageValue> create(CSSImageValue& cssValue, RenderElement& renderer)
+    {
+        return adoptRef(*new TypedOMCSSImageValue(cssValue, renderer));
+    }
+
+    String toString() final { return m_cssValue->cssText(); }
+
+    CachedImage* image() { return m_cssValue->cachedImage(); }
+    const RenderElement* renderer() const { return m_renderer.get(); }
+
+private:
+    TypedOMCSSImageValue(CSSImageValue& cssValue, RenderElement& renderer)
+        : m_cssValue(makeRef(cssValue))
+        , m_renderer(makeWeakPtr(renderer))
+    {
+    }
+
+    bool isImageValue() final { return true; }
+
+    Ref<CSSImageValue> m_cssValue;
+    WeakPtr<RenderElement> m_renderer;
+};
+
+} // namespace WebCore
+
+#endif
diff --git a/Source/WebCore/css/typedom/TypedOMCSSImageValue.idl b/Source/WebCore/css/typedom/TypedOMCSSImageValue.idl
new file mode 100644 (file)
index 0000000..8cd78e4
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+* Copyright (C) 2018 Apple Inc.  All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions
+* are met:
+* 1. Redistributions of source code must retain the above copyright
+*    notice, this list of conditions and the following disclaimer.
+* 2. Redistributions in binary form must reproduce the above copyright
+*    notice, this list of conditions and the following disclaimer in the
+*    documentation and/or other materials provided with the distribution.
+*
+* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+* PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+// FIXME: Implement this properly, according to the Typed OM spec.
+// This is just a stub for the CSS painting API for now. Once the Typed OM
+// is going to be implemented, please change the runtime flag.
+[
+    InterfaceName=CSSImageValue,
+    EnabledAtRuntime=CSSPaintingAPI,
+    Conditional=CSS_PAINTING_API,
+    Exposed=(Window,Worker,PaintWorklet),
+    JSGenerateToNativeObject,
+] interface TypedOMCSSImageValue : TypedOMCSSStyleValue {
+};
 
 #if ENABLE(CSS_PAINTING_API)
 
 
 #if ENABLE(CSS_PAINTING_API)
 
-#include "CSSStyleValue.h"
+#include "TypedOMCSSStyleValue.h"
 
 namespace WebCore {
 
 
 namespace WebCore {
 
-class CSSNumericValue : public CSSStyleValue {
+class TypedOMCSSNumericValue : public TypedOMCSSStyleValue {
 protected:
 protected:
-    CSSNumericValue() = default;
+    TypedOMCSSNumericValue() = default;
 };
 } // namespace WebCore
 
 };
 } // namespace WebCore
 
@@ -27,8 +27,9 @@
 // This is just a stub for the CSS painting API for now. Once the Typed OM
 // is going to be implemented, please change the runtime flag.
 [
 // This is just a stub for the CSS painting API for now. Once the Typed OM
 // is going to be implemented, please change the runtime flag.
 [
+    InterfaceName=CSSNumericValue,
     EnabledAtRuntime=CSSPaintingAPI,
     Conditional=CSS_PAINTING_API,
     Exposed=(Window,Worker,PaintWorklet),
     EnabledAtRuntime=CSSPaintingAPI,
     Conditional=CSS_PAINTING_API,
     Exposed=(Window,Worker,PaintWorklet),
-] interface CSSNumericValue : CSSStyleValue {
+] interface TypedOMCSSNumericValue : TypedOMCSSStyleValue {
 };
 };
 
 #if ENABLE(CSS_PAINTING_API)
 
 
 #if ENABLE(CSS_PAINTING_API)
 
+#include "ScriptWrappable.h"
 #include <wtf/RefCounted.h>
 #include <wtf/text/WTFString.h>
 
 namespace WebCore {
 
 #include <wtf/RefCounted.h>
 #include <wtf/text/WTFString.h>
 
 namespace WebCore {
 
-class CSSStyleValue : public RefCounted<CSSStyleValue> {
+class TypedOMCSSStyleValue : public RefCounted<TypedOMCSSStyleValue>, public ScriptWrappable {
 public:
 public:
-    virtual ~CSSStyleValue() = default;
+    virtual ~TypedOMCSSStyleValue() = default;
     virtual String toString() = 0;
 
     virtual bool isUnitValue() { return false; }
     virtual bool isUnparsedValue() { return false; }
     virtual String toString() = 0;
 
     virtual bool isUnitValue() { return false; }
     virtual bool isUnparsedValue() { return false; }
+    virtual bool isImageValue() { return false; }
 
 protected:
 
 protected:
-    CSSStyleValue() = default;
+    TypedOMCSSStyleValue() = default;
 };
 
 } // namespace WebCore
 };
 
 } // namespace WebCore
 // This is just a stub for the CSS painting API for now. Once the Typed OM
 // is going to be implemented, please change the runtime flag.
 [
 // This is just a stub for the CSS painting API for now. Once the Typed OM
 // is going to be implemented, please change the runtime flag.
 [
+    InterfaceName=CSSStyleValue,
     CustomToJSObject,
     EnabledAtRuntime=CSSPaintingAPI,
     Conditional=CSS_PAINTING_API,
     Exposed=(Window,Worker,PaintWorklet),
     SkipVTableValidation,
     CustomToJSObject,
     EnabledAtRuntime=CSSPaintingAPI,
     Conditional=CSS_PAINTING_API,
     Exposed=(Window,Worker,PaintWorklet),
     SkipVTableValidation,
-] interface CSSStyleValue {
+] interface TypedOMCSSStyleValue {
     stringifier;
 };
     stringifier;
 };
similarity index 87%
rename from Source/WebCore/css/typedom/CSSUnitValue.h
rename to Source/WebCore/css/typedom/TypedOMCSSUnitValue.h
index 4979974..bb15379 100644 (file)
 
 #if ENABLE(CSS_PAINTING_API)
 
 
 #if ENABLE(CSS_PAINTING_API)
 
-#include "CSSNumericValue.h"
+#include "TypedOMCSSNumericValue.h"
 #include <wtf/RefCounted.h>
 #include <wtf/text/StringConcatenateNumbers.h>
 #include <wtf/text/WTFString.h>
 
 namespace WebCore {
 
 #include <wtf/RefCounted.h>
 #include <wtf/text/StringConcatenateNumbers.h>
 #include <wtf/text/WTFString.h>
 
 namespace WebCore {
 
-class CSSUnitValue final : public CSSNumericValue {
+class TypedOMCSSUnitValue final : public TypedOMCSSNumericValue {
 public:
 public:
-    static Ref<CSSUnitValue> create(double value, const String& unit)
+    static Ref<TypedOMCSSUnitValue> create(double value, const String& unit)
     {
     {
-        return adoptRef(*new CSSUnitValue(value, unit));
+        return adoptRef(*new TypedOMCSSUnitValue(value, unit));
     }
 
     // FIXME: not correct.
     }
 
     // FIXME: not correct.
@@ -50,7 +50,7 @@ public:
     void setUnit(const String& unit) { m_unit = unit; }
 
 private:
     void setUnit(const String& unit) { m_unit = unit; }
 
 private:
-    CSSUnitValue(double value, const String& unit)
+    TypedOMCSSUnitValue(double value, const String& unit)
         : m_value(value)
         , m_unit(unit)
     {
         : m_value(value)
         , m_unit(unit)
     {
 // This is just a stub for the CSS painting API for now. Once the Typed OM
 // is going to be implemented, please change the runtime flag.
 [
 // This is just a stub for the CSS painting API for now. Once the Typed OM
 // is going to be implemented, please change the runtime flag.
 [
+    InterfaceName=CSSUnitValue,
     EnabledAtRuntime=CSSPaintingAPI,
     Conditional=CSS_PAINTING_API,
     Exposed=(Window,Worker,PaintWorklet),
     Constructor(double value, USVString unit),
     EnabledAtRuntime=CSSPaintingAPI,
     Conditional=CSS_PAINTING_API,
     Exposed=(Window,Worker,PaintWorklet),
     Constructor(double value, USVString unit),
-] interface CSSUnitValue : CSSNumericValue {
+] interface TypedOMCSSUnitValue : TypedOMCSSNumericValue {
     attribute double value;
     readonly attribute USVString unit;
 };
     attribute double value;
     readonly attribute USVString unit;
 };
 
 #if ENABLE(CSS_PAINTING_API)
 
 
 #if ENABLE(CSS_PAINTING_API)
 
-#include "CSSStyleValue.h"
+#include "TypedOMCSSStyleValue.h"
 #include <wtf/RefCounted.h>
 #include <wtf/text/WTFString.h>
 
 namespace WebCore {
 
 #include <wtf/RefCounted.h>
 #include <wtf/text/WTFString.h>
 
 namespace WebCore {
 
-class CSSUnparsedValue final : public CSSStyleValue {
+class TypedOMCSSUnparsedValue final : public TypedOMCSSStyleValue {
 public:
 public:
-    static Ref<CSSUnparsedValue> create(const String& serializedValue)
+    static Ref<TypedOMCSSUnparsedValue> create(const String& serializedValue)
     {
     {
-        return adoptRef(*new CSSUnparsedValue(serializedValue));
+        return adoptRef(*new TypedOMCSSUnparsedValue(serializedValue));
     }
 
     String toString() final { return m_serializedValue; }
 
 private:
     }
 
     String toString() final { return m_serializedValue; }
 
 private:
-    explicit CSSUnparsedValue(const String& serializedValue)
+    explicit TypedOMCSSUnparsedValue(const String& serializedValue)
         : m_serializedValue(serializedValue)
     {
     }
         : m_serializedValue(serializedValue)
     {
     }
 // is going to be implemented, please change the runtime flag.
 // FIXME: wrong constructor.
 [
 // is going to be implemented, please change the runtime flag.
 // FIXME: wrong constructor.
 [
+    InterfaceName=CSSUnparsedValue,
     EnabledAtRuntime=CSSPaintingAPI,
     Conditional=CSS_PAINTING_API,
     Exposed=(Window,Worker,PaintWorklet),
     Constructor(USVString serializedValue),
     EnabledAtRuntime=CSSPaintingAPI,
     Conditional=CSS_PAINTING_API,
     Exposed=(Window,Worker,PaintWorklet),
     Constructor(USVString serializedValue),
-] interface CSSUnparsedValue : CSSStyleValue {
+] interface TypedOMCSSUnparsedValue : TypedOMCSSStyleValue {
 };
 };
index 7de3467..fb9d2d7 100644 (file)
@@ -44,6 +44,7 @@
 #include "LayoutSize.h"
 #include "RenderElement.h"
 #include "SharedBuffer.h"
 #include "LayoutSize.h"
 #include "RenderElement.h"
 #include "SharedBuffer.h"
+#include "TypedOMCSSImageValue.h"
 #include <wtf/StdLibExtras.h>
 
 namespace WebCore {
 #include <wtf/StdLibExtras.h>
 
 namespace WebCore {
@@ -448,6 +449,13 @@ void ImageBitmap::createPromise(ScriptExecutionContext& scriptExecutionContext,
 }
 #endif
 
 }
 #endif
 
+#if ENABLE(CSS_PAINTING_API)
+void ImageBitmap::createPromise(ScriptExecutionContext&, RefPtr<TypedOMCSSImageValue>&, ImageBitmapOptions&&, std::optional<IntRect>, ImageBitmap::Promise&& promise)
+{
+    promise.reject(InvalidStateError, "Not implemented");
+}
+#endif
+
 void ImageBitmap::createPromise(ScriptExecutionContext&, RefPtr<ImageBitmap>& existingImageBitmap, ImageBitmapOptions&& options, std::optional<IntRect> rect, ImageBitmap::Promise&& promise)
 {
     // 2. If image's [[Detached]] internal slot value is true, return a promise
 void ImageBitmap::createPromise(ScriptExecutionContext&, RefPtr<ImageBitmap>& existingImageBitmap, ImageBitmapOptions&& options, std::optional<IntRect> rect, ImageBitmap::Promise&& promise)
 {
     // 2. If image's [[Detached]] internal slot value is true, return a promise
index 1200b87..fa7419e 100644 (file)
@@ -44,6 +44,7 @@ class IntRect;
 class IntSize;
 class PendingImageBitmap;
 class ScriptExecutionContext;
 class IntSize;
 class PendingImageBitmap;
 class ScriptExecutionContext;
+class TypedOMCSSImageValue;
 struct ImageBitmapOptions;
 
 class ImageBitmap : public ScriptWrappable, public RefCounted<ImageBitmap> {
 struct ImageBitmapOptions;
 
 class ImageBitmap : public ScriptWrappable, public RefCounted<ImageBitmap> {
@@ -55,6 +56,9 @@ public:
 #endif
         RefPtr<HTMLCanvasElement>,
         RefPtr<ImageBitmap>,
 #endif
         RefPtr<HTMLCanvasElement>,
         RefPtr<ImageBitmap>,
+#if ENABLE(CSS_PAINTING_API)
+        RefPtr<TypedOMCSSImageValue>,
+#endif
         RefPtr<Blob>,
         RefPtr<ImageData>
     >;
         RefPtr<Blob>,
         RefPtr<ImageData>
     >;
@@ -98,6 +102,7 @@ private:
     static void createPromise(ScriptExecutionContext&, RefPtr<ImageBitmap>&, ImageBitmapOptions&&, std::optional<IntRect>, Promise&&);
     static void createPromise(ScriptExecutionContext&, RefPtr<Blob>&, ImageBitmapOptions&&, std::optional<IntRect>, Promise&&);
     static void createPromise(ScriptExecutionContext&, RefPtr<ImageData>&, ImageBitmapOptions&&, std::optional<IntRect>, Promise&&);
     static void createPromise(ScriptExecutionContext&, RefPtr<ImageBitmap>&, ImageBitmapOptions&&, std::optional<IntRect>, Promise&&);
     static void createPromise(ScriptExecutionContext&, RefPtr<Blob>&, ImageBitmapOptions&&, std::optional<IntRect>, Promise&&);
     static void createPromise(ScriptExecutionContext&, RefPtr<ImageData>&, ImageBitmapOptions&&, std::optional<IntRect>, Promise&&);
+    static void createPromise(ScriptExecutionContext&, RefPtr<TypedOMCSSImageValue>&, ImageBitmapOptions&&, std::optional<IntRect>, Promise&&);
     static void createFromBuffer(Ref<ArrayBuffer>&&, String mimeType, long long expectedContentLength, const URL&, ImageBitmapOptions&&, std::optional<IntRect>, Promise&&);
 
     std::unique_ptr<ImageBuffer> m_bitmapData;
     static void createFromBuffer(Ref<ArrayBuffer>&&, String mimeType, long long expectedContentLength, const URL&, ImageBitmapOptions&&, std::optional<IntRect>, Promise&&);
 
     std::unique_ptr<ImageBuffer> m_bitmapData;
index cbcaf72..75e7f6e 100644 (file)
@@ -24,7 +24,9 @@
  */
 
 // FIXME: This should include SVGImageElement and ImageBitmap.
  */
 
 // FIXME: This should include SVGImageElement and ImageBitmap.
-#if defined(ENABLE_VIDEO) && ENABLE_VIDEO
+#if defined(ENABLE_VIDEO) && ENABLE_VIDEO && defined(ENABLE_CSS_PAINTING_API) && ENABLE_CSS_PAINTING_API
+typedef (HTMLImageElement or HTMLVideoElement or HTMLCanvasElement or ImageBitmap or TypedOMCSSImageValue) CanvasImageSource;
+#elif defined(ENABLE_VIDEO) && ENABLE_VIDEO
 typedef (HTMLImageElement or HTMLVideoElement or HTMLCanvasElement or ImageBitmap) CanvasImageSource;
 #else
 typedef (HTMLImageElement or HTMLCanvasElement or ImageBitmap) CanvasImageSource;
 typedef (HTMLImageElement or HTMLVideoElement or HTMLCanvasElement or ImageBitmap) CanvasImageSource;
 #else
 typedef (HTMLImageElement or HTMLCanvasElement or ImageBitmap) CanvasImageSource;
index 5c2c40f..e79e3ac 100644 (file)
@@ -24,7 +24,9 @@
  */
 
 // FIXME: This should include SVGImageElement and ImageBitmap.
  */
 
 // FIXME: This should include SVGImageElement and ImageBitmap.
-#if defined(ENABLE_VIDEO) && ENABLE_VIDEO
+#if defined(ENABLE_VIDEO) && ENABLE_VIDEO && defined(ENABLE_CSS_PAINTING_API) && ENABLE_CSS_PAINTING_API
+typedef (HTMLImageElement or HTMLVideoElement or HTMLCanvasElement or ImageBitmap or TypedOMCSSImageValue) CanvasImageSource;
+#elif defined(ENABLE_VIDEO) && ENABLE_VIDEO
 typedef (HTMLImageElement or HTMLVideoElement or HTMLCanvasElement or ImageBitmap) CanvasImageSource;
 #else
 typedef (HTMLImageElement or HTMLCanvasElement or ImageBitmap) CanvasImageSource;
 typedef (HTMLImageElement or HTMLVideoElement or HTMLCanvasElement or ImageBitmap) CanvasImageSource;
 #else
 typedef (HTMLImageElement or HTMLCanvasElement or ImageBitmap) CanvasImageSource;
index 704b41f..79202b5 100644 (file)
@@ -144,4 +144,9 @@ void CanvasRenderingContext::checkOrigin(const URL& url)
         m_canvas.setOriginTainted();
 }
 
         m_canvas.setOriginTainted();
 }
 
+void CanvasRenderingContext::checkOrigin(const TypedOMCSSImageValue&)
+{
+    m_canvas.setOriginTainted();
+}
+
 } // namespace WebCore
 } // namespace WebCore
index 7af43fc..5172e27 100644 (file)
@@ -38,6 +38,7 @@ class HTMLCanvasElement;
 class HTMLImageElement;
 class HTMLVideoElement;
 class ImageBitmap;
 class HTMLImageElement;
 class HTMLVideoElement;
 class ImageBitmap;
+class TypedOMCSSImageValue;
 class WebGLObject;
 
 class CanvasRenderingContext : public ScriptWrappable {
 class WebGLObject;
 
 class CanvasRenderingContext : public ScriptWrappable {
@@ -88,6 +89,7 @@ protected:
             m_canvas.setOriginTainted();
     }
     void checkOrigin(const URL&);
             m_canvas.setOriginTainted();
     }
     void checkOrigin(const URL&);
+    void checkOrigin(const TypedOMCSSImageValue&);
 
     bool m_callTracingActive { false };
 
 
     bool m_callTracingActive { false };
 
index 88f3566..67ae1db 100644 (file)
@@ -61,6 +61,7 @@
 #include "StyleResolver.h"
 #include "TextMetrics.h"
 #include "TextRun.h"
 #include "StyleResolver.h"
 #include "TextMetrics.h"
 #include "TextRun.h"
+#include "TypedOMCSSImageValue.h"
 #include <wtf/CheckedArithmetic.h>
 #include <wtf/MathExtras.h>
 #include <wtf/NeverDestroyed.h>
 #include <wtf/CheckedArithmetic.h>
 #include <wtf/MathExtras.h>
 #include <wtf/NeverDestroyed.h>
@@ -1438,6 +1439,16 @@ static inline FloatSize size(HTMLVideoElement& video)
 
 #endif
 
 
 #endif
 
+#if ENABLE(CSS_PAINTING_API)
+static inline FloatSize size(TypedOMCSSImageValue& image)
+{
+    LayoutSize size;
+    if (auto* cachedImage = image.image())
+        size = cachedImage->imageSizeForRenderer(image.renderer(), 1.0f); // FIXME: Not sure about this, see fixme in size(HTMLImageElement&...)
+    return size;
+}
+#endif
+
 static inline FloatRect normalizeRect(const FloatRect& rect)
 {
     return FloatRect(std::min(rect.x(), rect.maxX()),
 static inline FloatRect normalizeRect(const FloatRect& rect)
 {
     return FloatRect(std::min(rect.x(), rect.maxX()),
@@ -1487,6 +1498,36 @@ ExceptionOr<void> CanvasRenderingContext2DBase::drawImage(HTMLImageElement& imag
 
 ExceptionOr<void> CanvasRenderingContext2DBase::drawImage(HTMLImageElement& imageElement, const FloatRect& srcRect, const FloatRect& dstRect, const CompositeOperator& op, const BlendMode& blendMode)
 {
 
 ExceptionOr<void> CanvasRenderingContext2DBase::drawImage(HTMLImageElement& imageElement, const FloatRect& srcRect, const FloatRect& dstRect, const CompositeOperator& op, const BlendMode& blendMode)
 {
+    if (!imageElement.complete())
+        return { };
+    FloatRect imageRect = FloatRect(FloatPoint(), size(imageElement, ImageSizeType::BeforeDevicePixelRatio));
+
+    auto result = drawImage(imageElement.document(), imageElement.cachedImage(), imageElement.renderer(), imageRect, srcRect, dstRect, op, blendMode);
+
+    if (!result.hasException())
+        checkOrigin(&imageElement);
+    return result;
+}
+
+#if ENABLE(CSS_PAINTING_API)
+ExceptionOr<void> CanvasRenderingContext2DBase::drawImage(TypedOMCSSImageValue& image, const FloatRect& srcRect, const FloatRect& dstRect)
+{
+    auto* renderer = image.renderer();
+    auto* cachedImage = image.image();
+    if (!renderer || !cachedImage)
+        return { };
+    FloatRect imageRect = FloatRect(FloatPoint(), size(image));
+
+    auto result = drawImage(renderer->document(), cachedImage, renderer, imageRect, srcRect, dstRect, state().globalComposite, state().globalBlend);
+
+    if (!result.hasException())
+        checkOrigin(image);
+    return result;
+}
+#endif
+
+ExceptionOr<void> CanvasRenderingContext2DBase::drawImage(Document& document, CachedImage* cachedImage, const RenderObject* renderer, const FloatRect& imageRect, const FloatRect& srcRect, const FloatRect& dstRect, const CompositeOperator& op, const BlendMode& blendMode)
+{
     if (!std::isfinite(dstRect.x()) || !std::isfinite(dstRect.y()) || !std::isfinite(dstRect.width()) || !std::isfinite(dstRect.height())
         || !std::isfinite(srcRect.x()) || !std::isfinite(srcRect.y()) || !std::isfinite(srcRect.width()) || !std::isfinite(srcRect.height()))
         return { };
     if (!std::isfinite(dstRect.x()) || !std::isfinite(dstRect.y()) || !std::isfinite(dstRect.width()) || !std::isfinite(dstRect.height())
         || !std::isfinite(srcRect.x()) || !std::isfinite(srcRect.y()) || !std::isfinite(srcRect.width()) || !std::isfinite(srcRect.height()))
         return { };
@@ -1494,13 +1535,9 @@ ExceptionOr<void> CanvasRenderingContext2DBase::drawImage(HTMLImageElement& imag
     if (!dstRect.width() || !dstRect.height())
         return { };
 
     if (!dstRect.width() || !dstRect.height())
         return { };
 
-    if (!imageElement.complete())
-        return { };
-
     FloatRect normalizedSrcRect = normalizeRect(srcRect);
     FloatRect normalizedDstRect = normalizeRect(dstRect);
 
     FloatRect normalizedSrcRect = normalizeRect(srcRect);
     FloatRect normalizedDstRect = normalizeRect(dstRect);
 
-    FloatRect imageRect = FloatRect(FloatPoint(), size(imageElement, ImageSizeType::BeforeDevicePixelRatio));
     if (!srcRect.width() || !srcRect.height())
         return Exception { IndexSizeError };
 
     if (!srcRect.width() || !srcRect.height())
         return Exception { IndexSizeError };
 
@@ -1524,11 +1561,10 @@ ExceptionOr<void> CanvasRenderingContext2DBase::drawImage(HTMLImageElement& imag
     if (!state().hasInvertibleTransform)
         return { };
 
     if (!state().hasInvertibleTransform)
         return { };
 
-    CachedImage* cachedImage = imageElement.cachedImage();
     if (!cachedImage)
         return { };
 
     if (!cachedImage)
         return { };
 
-    RefPtr<Image> image = cachedImage->imageForRenderer(imageElement.renderer());
+    RefPtr<Image> image = cachedImage->imageForRenderer(renderer);
     if (!image)
         return { };
 
     if (!image)
         return { };
 
@@ -1540,7 +1576,7 @@ ExceptionOr<void> CanvasRenderingContext2DBase::drawImage(HTMLImageElement& imag
     }
 
     if (image->isBitmapImage())
     }
 
     if (image->isBitmapImage())
-        downcast<BitmapImage>(*image).updateFromSettings(imageElement.document().settings());
+        downcast<BitmapImage>(*image).updateFromSettings(document.settings());
 
     if (rectContainsCanvas(normalizedDstRect)) {
         c->drawImage(*image, normalizedDstRect, normalizedSrcRect, ImagePaintingOptions(op, blendMode));
 
     if (rectContainsCanvas(normalizedDstRect)) {
         c->drawImage(*image, normalizedDstRect, normalizedSrcRect, ImagePaintingOptions(op, blendMode));
@@ -1560,8 +1596,6 @@ ExceptionOr<void> CanvasRenderingContext2DBase::drawImage(HTMLImageElement& imag
     if (image->isSVGImage())
         image->setImageObserver(observer);
 
     if (image->isSVGImage())
         image->setImageObserver(observer);
 
-    checkOrigin(&imageElement);
-
     return { };
 }
 
     return { };
 }
 
@@ -1984,6 +2018,14 @@ ExceptionOr<RefPtr<CanvasPattern>> CanvasRenderingContext2DBase::createPattern(I
     return Exception { TypeError };
 }
 
     return Exception { TypeError };
 }
 
+#if ENABLE(CSS_PAINTING_API)
+ExceptionOr<RefPtr<CanvasPattern>> CanvasRenderingContext2DBase::createPattern(TypedOMCSSImageValue&, bool, bool)
+{
+    // FIXME: Implement.
+    return Exception { TypeError };
+}
+#endif
+
 void CanvasRenderingContext2DBase::didDrawEntireCanvas()
 {
     didDraw(FloatRect(FloatPoint::zero(), canvasBase().size()), CanvasDidDrawApplyClip);
 void CanvasRenderingContext2DBase::didDrawEntireCanvas()
 {
     didDraw(FloatRect(FloatPoint::zero(), canvasBase().size()), CanvasDidDrawApplyClip);
index ad538cd..b4ecce4 100644 (file)
@@ -50,6 +50,8 @@
 
 namespace WebCore {
 
 
 namespace WebCore {
 
+class TypedOMCSSImageValue;
+class CachedImage;
 class CanvasBase;
 class CanvasGradient;
 class CanvasPattern;
 class CanvasBase;
 class CanvasGradient;
 class CanvasPattern;
@@ -62,11 +64,14 @@ class ImageBitmap;
 class ImageData;
 class Path2D;
 class RenderStyle;
 class ImageData;
 class Path2D;
 class RenderStyle;
+class RenderObject;
 class TextMetrics;
 
 struct DOMMatrix2DInit;
 
 class TextMetrics;
 
 struct DOMMatrix2DInit;
 
-#if ENABLE(VIDEO)
+#if ENABLE(VIDEO) && ENABLE(CSS_PAINTING_API)
+using CanvasImageSource = Variant<RefPtr<HTMLImageElement>, RefPtr<HTMLVideoElement>, RefPtr<HTMLCanvasElement>, RefPtr<ImageBitmap>, RefPtr<TypedOMCSSImageValue>>;
+#elif ENABLE(VIDEO)
 using CanvasImageSource = Variant<RefPtr<HTMLImageElement>, RefPtr<HTMLVideoElement>, RefPtr<HTMLCanvasElement>, RefPtr<ImageBitmap>>;
 #else
 using CanvasImageSource = Variant<RefPtr<HTMLImageElement>, RefPtr<HTMLCanvasElement>, RefPtr<ImageBitmap>>;
 using CanvasImageSource = Variant<RefPtr<HTMLImageElement>, RefPtr<HTMLVideoElement>, RefPtr<HTMLCanvasElement>, RefPtr<ImageBitmap>>;
 #else
 using CanvasImageSource = Variant<RefPtr<HTMLImageElement>, RefPtr<HTMLCanvasElement>, RefPtr<ImageBitmap>>;
@@ -321,13 +326,20 @@ protected:
     ExceptionOr<RefPtr<CanvasPattern>> createPattern(HTMLVideoElement&, bool repeatX, bool repeatY);
 #endif
     ExceptionOr<RefPtr<CanvasPattern>> createPattern(ImageBitmap&, bool repeatX, bool repeatY);
     ExceptionOr<RefPtr<CanvasPattern>> createPattern(HTMLVideoElement&, bool repeatX, bool repeatY);
 #endif
     ExceptionOr<RefPtr<CanvasPattern>> createPattern(ImageBitmap&, bool repeatX, bool repeatY);
+#if ENABLE(CSS_PAINTING_API)
+    ExceptionOr<RefPtr<CanvasPattern>> createPattern(TypedOMCSSImageValue&, bool repeatX, bool repeatY);
+#endif
 
     ExceptionOr<void> drawImage(HTMLImageElement&, const FloatRect& srcRect, const FloatRect& dstRect);
     ExceptionOr<void> drawImage(HTMLImageElement&, const FloatRect& srcRect, const FloatRect& dstRect, const CompositeOperator&, const BlendMode&);
     ExceptionOr<void> drawImage(HTMLCanvasElement&, const FloatRect& srcRect, const FloatRect& dstRect);
 
     ExceptionOr<void> drawImage(HTMLImageElement&, const FloatRect& srcRect, const FloatRect& dstRect);
     ExceptionOr<void> drawImage(HTMLImageElement&, const FloatRect& srcRect, const FloatRect& dstRect, const CompositeOperator&, const BlendMode&);
     ExceptionOr<void> drawImage(HTMLCanvasElement&, const FloatRect& srcRect, const FloatRect& dstRect);
+    ExceptionOr<void> drawImage(Document&, CachedImage*, const RenderObject*, const FloatRect& imageRect, const FloatRect& srcRect, const FloatRect& dstRect, const CompositeOperator&, const BlendMode&);
 #if ENABLE(VIDEO)
     ExceptionOr<void> drawImage(HTMLVideoElement&, const FloatRect& srcRect, const FloatRect& dstRect);
 #endif
 #if ENABLE(VIDEO)
     ExceptionOr<void> drawImage(HTMLVideoElement&, const FloatRect& srcRect, const FloatRect& dstRect);
 #endif
+#if ENABLE(CSS_PAINTING_API)
+    ExceptionOr<void> drawImage(TypedOMCSSImageValue&, const FloatRect& srcRect, const FloatRect& dstRect);
+#endif
     ExceptionOr<void> drawImage(ImageBitmap&, const FloatRect& srcRect, const FloatRect& dstRect);
 
     void beginCompositeLayer();
     ExceptionOr<void> drawImage(ImageBitmap&, const FloatRect& srcRect, const FloatRect& dstRect);
 
     void beginCompositeLayer();
index ea710bc..540b7b4 100644 (file)
@@ -620,6 +620,9 @@ Ref<JSON::ArrayOf<JSON::Value>> InspectorCanvas::buildAction(const String& name,
 #if ENABLE(VIDEO)
             [&] (const RefPtr<HTMLVideoElement>& value) { addParameter(indexForData(value), RecordingSwizzleTypes::Image); },
 #endif
 #if ENABLE(VIDEO)
             [&] (const RefPtr<HTMLVideoElement>& value) { addParameter(indexForData(value), RecordingSwizzleTypes::Image); },
 #endif
+#if ENABLE(CSS_PAINTING_API)
+            [&] (const RefPtr<TypedOMCSSImageValue>&) { /* FIXME implement. */ },
+#endif
             [&] (const RefPtr<ImageBitmap>& value) { addParameter(indexForData(value), RecordingSwizzleTypes::ImageBitmap); },
             [&] (const RefPtr<ImageData>& value) { addParameter(indexForData(value), RecordingSwizzleTypes::ImageData); },
             [&] (const RefPtr<Int32Array>&) { addParameter(0, RecordingSwizzleTypes::TypedArray); },
             [&] (const RefPtr<ImageBitmap>& value) { addParameter(indexForData(value), RecordingSwizzleTypes::ImageBitmap); },
             [&] (const RefPtr<ImageData>& value) { addParameter(indexForData(value), RecordingSwizzleTypes::ImageData); },
             [&] (const RefPtr<Int32Array>&) { addParameter(0, RecordingSwizzleTypes::TypedArray); },
index b258fb1..a3615a5 100644 (file)
@@ -25,7 +25,9 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#if defined(ENABLE_VIDEO) && ENABLE_VIDEO
+#if defined(ENABLE_VIDEO) && ENABLE_VIDEO && defined(ENABLE_CSS_PAINTING_API) && ENABLE_CSS_PAINTING_API
+typedef (HTMLImageElement or HTMLVideoElement or HTMLCanvasElement or ImageBitmap or TypedOMCSSImageValue) CanvasImageSource;
+#elif defined(ENABLE_VIDEO) && ENABLE_VIDEO
 typedef (HTMLImageElement or HTMLVideoElement or HTMLCanvasElement or ImageBitmap) CanvasImageSource;
 #else
 typedef (HTMLImageElement or HTMLCanvasElement or ImageBitmap) CanvasImageSource;
 typedef (HTMLImageElement or HTMLVideoElement or HTMLCanvasElement or ImageBitmap) CanvasImageSource;
 #else
 typedef (HTMLImageElement or HTMLCanvasElement or ImageBitmap) CanvasImageSource;
index ec48226..fa90d9f 100644 (file)
 #if ENABLE(CSS_PAINTING_API)
 
 #include "CSSComputedStyleDeclaration.h"
 #if ENABLE(CSS_PAINTING_API)
 
 #include "CSSComputedStyleDeclaration.h"
+#include "CSSImageValue.h"
 #include "CSSPrimitiveValue.h"
 #include "CSSPropertyParser.h"
 #include "CSSPrimitiveValue.h"
 #include "CSSPropertyParser.h"
-#include "CSSUnitValue.h"
-#include "CSSUnparsedValue.h"
 #include "CustomPaintCanvas.h"
 #include "GraphicsContext.h"
 #include "ImageBitmap.h"
 #include "CustomPaintCanvas.h"
 #include "GraphicsContext.h"
 #include "ImageBitmap.h"
@@ -40,6 +39,9 @@
 #include "JSCSSPaintCallback.h"
 #include "PaintRenderingContext2D.h"
 #include "RenderElement.h"
 #include "JSCSSPaintCallback.h"
 #include "PaintRenderingContext2D.h"
 #include "RenderElement.h"
+#include "TypedOMCSSImageValue.h"
+#include "TypedOMCSSUnitValue.h"
+#include "TypedOMCSSUnparsedValue.h"
 #include <JavaScriptCore/ConstructData.h>
 
 namespace WebCore {
 #include <JavaScriptCore/ConstructData.h>
 
 namespace WebCore {
@@ -82,7 +84,7 @@ ImageDrawResult CustomPaintImage::doCustomPaint(GraphicsContext& destContext, co
         return ImageDrawResult::DidNothing;
     auto context = contextOrException.releaseReturnValue();
 
         return ImageDrawResult::DidNothing;
     auto context = contextOrException.releaseReturnValue();
 
-    HashMap<String, Ref<CSSStyleValue>> propertyValues;
+    HashMap<String, Ref<TypedOMCSSStyleValue>> propertyValues;
     ComputedStyleExtractor extractor(m_element->element());
 
     for (auto& name : m_inputProperties) {
     ComputedStyleExtractor extractor(m_element->element());
 
     for (auto& name : m_inputProperties) {
@@ -97,15 +99,17 @@ ImageDrawResult CustomPaintImage::doCustomPaint(GraphicsContext& destContext, co
         }
 
         if (!value) {
         }
 
         if (!value) {
-            propertyValues.add(name, CSSUnparsedValue::create(emptyString()));
+            propertyValues.add(name, TypedOMCSSUnparsedValue::create(emptyString()));
             continue;
         }
 
         // FIXME: Properly reify all length values.
         if (is<CSSPrimitiveValue>(*value) && downcast<CSSPrimitiveValue>(*value).primitiveType() == CSSPrimitiveValue::CSS_PX)
             continue;
         }
 
         // FIXME: Properly reify all length values.
         if (is<CSSPrimitiveValue>(*value) && downcast<CSSPrimitiveValue>(*value).primitiveType() == CSSPrimitiveValue::CSS_PX)
-            propertyValues.add(name, CSSUnitValue::create(downcast<CSSPrimitiveValue>(*value).doubleValue(), "px"));
+            propertyValues.add(name, TypedOMCSSUnitValue::create(downcast<CSSPrimitiveValue>(*value).doubleValue(), "px"));
+        else if (is<CSSImageValue>(*value))
+            propertyValues.add(name, TypedOMCSSImageValue::create(downcast<CSSImageValue>(*value), *m_element));
         else
         else
-            propertyValues.add(name, CSSUnparsedValue::create(value->cssText()));
+            propertyValues.add(name, TypedOMCSSUnparsedValue::create(value->cssText()));
     }
 
     auto size = CSSPaintSize::create(destSize.width(), destSize.height());
     }
 
     auto size = CSSPaintSize::create(destSize.width(), destSize.height());
index 0d1d36d..aa9ad26 100644 (file)
@@ -27,6 +27,7 @@
 
 #if ENABLE(WEBGPU)
 
 
 #if ENABLE(WEBGPU)
 
+#include "GPUTexture.h"
 #include <wtf/RefPtr.h>
 #include <wtf/RetainPtr.h>
 
 #include <wtf/RefPtr.h>
 #include <wtf/RetainPtr.h>
 
@@ -37,7 +38,6 @@ OBJC_PROTOCOL(CAMetalDrawable);
 namespace WebCore {
 
 class GPUDevice;
 namespace WebCore {
 
 class GPUDevice;
-class GPUTexture;
 
 enum class GPUTextureFormatEnum;
 
 
 enum class GPUTextureFormatEnum;