Diff
Modified: trunk/LayoutTests/ChangeLog (238871 => 238872)
--- trunk/LayoutTests/ChangeLog 2018-12-04 20:07:09 UTC (rev 238871)
+++ trunk/LayoutTests/ChangeLog 2018-12-04 20:25:02 UTC (rev 238872)
@@ -1,3 +1,16 @@
+2018-12-04 Justin Michaud <justin_mich...@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 <ryanhad...@apple.com>
Unreviewed, rolling out r238838.
Added: trunk/LayoutTests/fast/css-custom-paint/arguments-expected.html (0 => 238872)
--- trunk/LayoutTests/fast/css-custom-paint/arguments-expected.html (rev 0)
+++ trunk/LayoutTests/fast/css-custom-paint/arguments-expected.html 2018-12-04 20:25:02 UTC (rev 238872)
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<style>
+ .paint {
+ width: 150px;
+ height: 150px;
+ }
+</style>
+
+<body>
+ <div class="paint" style="background: green;"></div>
+</body>
Added: trunk/LayoutTests/fast/css-custom-paint/arguments.html (0 => 238872)
--- trunk/LayoutTests/fast/css-custom-paint/arguments.html (rev 0)
+++ trunk/LayoutTests/fast/css-custom-paint/arguments.html 2018-12-04 20:25:02 UTC (rev 238872)
@@ -0,0 +1,37 @@
+<!DOCTYPE html><!-- webkit-test-runner [ experimental:CSSPaintingAPIEnabled=true ] -->
+<meta name="author" title="Justin Michaud" href=""
+<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=""
+
+<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>
Added: trunk/LayoutTests/fast/css-custom-paint/image-expected.html (0 => 238872)
--- trunk/LayoutTests/fast/css-custom-paint/image-expected.html (rev 0)
+++ trunk/LayoutTests/fast/css-custom-paint/image-expected.html 2018-12-04 20:25:02 UTC (rev 238872)
@@ -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>
Added: trunk/LayoutTests/fast/css-custom-paint/image.html (0 => 238872)
--- trunk/LayoutTests/fast/css-custom-paint/image.html (rev 0)
+++ trunk/LayoutTests/fast/css-custom-paint/image.html 2018-12-04 20:25:02 UTC (rev 238872)
@@ -0,0 +1,40 @@
+<!DOCTYPE html><!-- webkit-test-runner [ experimental:CSSPaintingAPIEnabled=true ] -->
+<meta name="author" title="Justin Michaud" href=""
+<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=""
+
+<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>
Added: trunk/LayoutTests/fast/css-custom-paint/resources/test-image.png
(Binary files differ)
Index: trunk/LayoutTests/fast/css-custom-paint/resources/test-image.png
===================================================================
--- trunk/LayoutTests/fast/css-custom-paint/resources/test-image.png 2018-12-04 20:07:09 UTC (rev 238871)
+++ trunk/LayoutTests/fast/css-custom-paint/resources/test-image.png 2018-12-04 20:25:02 UTC (rev 238872)
Property changes on: trunk/LayoutTests/fast/css-custom-paint/resources/test-image.png
___________________________________________________________________
Added: svn:mime-type
+image/png
\ No newline at end of property
Modified: trunk/Source/WebCore/CMakeLists.txt (238871 => 238872)
--- trunk/Source/WebCore/CMakeLists.txt 2018-12-04 20:07:09 UTC (rev 238871)
+++ trunk/Source/WebCore/CMakeLists.txt 2018-12-04 20:25:02 UTC (rev 238872)
@@ -593,10 +593,11 @@
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
Modified: trunk/Source/WebCore/ChangeLog (238871 => 238872)
--- trunk/Source/WebCore/ChangeLog 2018-12-04 20:07:09 UTC (rev 238871)
+++ trunk/Source/WebCore/ChangeLog 2018-12-04 20:25:02 UTC (rev 238872)
@@ -1,3 +1,69 @@
+2018-12-04 Justin Michaud <justin_mich...@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 <cdu...@apple.com>
Regression(r238817) PSON Page Cache API tests are failing
Modified: trunk/Source/WebCore/DerivedSources.make (238871 => 238872)
--- trunk/Source/WebCore/DerivedSources.make 2018-12-04 20:07:09 UTC (rev 238871)
+++ trunk/Source/WebCore/DerivedSources.make 2018-12-04 20:25:02 UTC (rev 238872)
@@ -502,11 +502,12 @@
$(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/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 \
Modified: trunk/Source/WebCore/Sources.txt (238871 => 238872)
--- trunk/Source/WebCore/Sources.txt 2018-12-04 20:07:09 UTC (rev 238871)
+++ trunk/Source/WebCore/Sources.txt 2018-12-04 20:25:02 UTC (rev 238872)
@@ -388,7 +388,6 @@
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
@@ -478,6 +477,7 @@
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
@@ -2501,17 +2501,18 @@
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
-JSCSSNumericValue.cpp
JSCSSPaintCallback.cpp
JSCSSPaintSize.cpp
-JSCSSStyleValue.cpp
-JSCSSUnitValue.cpp
-JSCSSUnparsedValue.cpp
JSPaintWorkletGlobalScope.cpp
JSWorklet.cpp
JSWorkletGlobalScope.cpp
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (238871 => 238872)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2018-12-04 20:07:09 UTC (rev 238871)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2018-12-04 20:25:02 UTC (rev 238872)
@@ -1367,6 +1367,7 @@
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 */; };
@@ -1377,10 +1378,10 @@
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, ); }; };
@@ -7883,6 +7884,8 @@
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>"; };
@@ -7905,15 +7908,15 @@
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>"; };
@@ -18107,16 +18110,18 @@
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 */,
+ 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>";
@@ -20323,7 +20328,6 @@
9392262E10321084006E7D5D /* JSCSSRuleListCustom.cpp */,
BC5825F20C0B89380053F1B5 /* JSCSSStyleDeclarationCustom.cpp */,
AD726FEA16D9F40B003A4E6D /* JSCSSStyleDeclarationCustom.h */,
- 4BAFD0E22192604D00C0AB64 /* JSCSSStyleValueCustom.cpp */,
BC20FB7E0C0E8E6C00D1447F /* JSDeprecatedCSSOMValueCustom.cpp */,
49C7BA8C1042F5B10009D447 /* JSDocumentCustom.cpp */,
ADDA94BF19686F8000453029 /* JSDocumentCustom.h */,
@@ -20376,6 +20380,7 @@
070334E8145A1F35008D8D45 /* JSTrackCustom.cpp */,
07846384145B1B8E00A58DF1 /* JSTrackCustom.h */,
516BB7920CE91E6800512F79 /* JSTreeWalkerCustom.cpp */,
+ 4BAFD0E22192604D00C0AB64 /* JSTypedOMCSSStyleValueCustom.cpp */,
BE6DF708171CA2C500DD52B8 /* JSVideoTrackCustom.cpp */,
BE6DF70A171CA2C500DD52B8 /* JSVideoTrackListCustom.cpp */,
715DA5D3201BB902002EF2B0 /* JSWebAnimationCustom.cpp */,
@@ -28236,7 +28241,6 @@
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 */,
@@ -28278,7 +28282,6 @@
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 */,
@@ -28288,9 +28291,7 @@
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 */,
- 4BAFD0D921921EA000C0AB64 /* CSSUnparsedValue.h in Headers */,
BC7D8FF01BD03B6400FFE540 /* CSSUnsetValue.h in Headers */,
A80E6CEE0A1989CA007FB8C5 /* CSSValue.h in Headers */,
6565815109D13043000E61D7 /* CSSValueKeywords.h in Headers */,
@@ -31493,6 +31494,11 @@
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 */,
Modified: trunk/Source/WebCore/bindings/js/CallTracerTypes.h (238871 => 238872)
--- trunk/Source/WebCore/bindings/js/CallTracerTypes.h 2018-12-04 20:07:09 UTC (rev 238871)
+++ trunk/Source/WebCore/bindings/js/CallTracerTypes.h 2018-12-04 20:25:02 UTC (rev 238872)
@@ -36,6 +36,7 @@
#include "ImageBitmap.h"
#include "ImageData.h"
#include "Path2D.h"
+#include "TypedOMCSSImageValue.h"
#include <_javascript_Core/ArrayBuffer.h>
#include <_javascript_Core/ArrayBufferView.h>
#include <_javascript_Core/Float32Array.h>
@@ -91,6 +92,9 @@
RefPtr<HTMLVideoElement>,
#endif
RefPtr<ImageBitmap>,
+#if ENABLE(CSS_PAINTING_API)
+ RefPtr<TypedOMCSSImageValue>,
+#endif
RefPtr<ImageData>,
RefPtr<Int32Array>,
Vector<float>,
Deleted: trunk/Source/WebCore/bindings/js/JSCSSStyleValueCustom.cpp (238871 => 238872)
--- trunk/Source/WebCore/bindings/js/JSCSSStyleValueCustom.cpp 2018-12-04 20:07:09 UTC (rev 238871)
+++ trunk/Source/WebCore/bindings/js/JSCSSStyleValueCustom.cpp 2018-12-04 20:25:02 UTC (rev 238872)
@@ -1,55 +0,0 @@
-/*
- * 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.
- */
-
-#include "config.h"
-#include "JSCSSStyleValue.h"
-
-#if ENABLE(CSS_PAINTING_API)
-
-#include "JSCSSUnitValue.h"
-#include "JSCSSUnparsedValue.h"
-
-namespace WebCore {
-using namespace JSC;
-
-JSValue toJSNewlyCreated(ExecState*, JSDOMGlobalObject* globalObject, Ref<CSSStyleValue>&& value)
-{
- if (value->isUnitValue())
- return createWrapper<CSSUnitValue>(globalObject, WTFMove(value));
- if (value->isUnparsedValue())
- return createWrapper<CSSUnparsedValue>(globalObject, WTFMove(value));
-
- ASSERT_NOT_REACHED();
- return createWrapper<CSSStyleValue>(globalObject, WTFMove(value));
-}
-
-JSValue toJS(ExecState* state, JSDOMGlobalObject* globalObject, CSSStyleValue& object)
-{
- return wrap(state, globalObject, object);
-}
-
-} // namespace WebCore
-
-#endif
Copied: trunk/Source/WebCore/bindings/js/JSTypedOMCSSStyleValueCustom.cpp (from rev 238871, trunk/Source/WebCore/bindings/js/JSCSSStyleValueCustom.cpp) (0 => 238872)
--- trunk/Source/WebCore/bindings/js/JSTypedOMCSSStyleValueCustom.cpp (rev 0)
+++ trunk/Source/WebCore/bindings/js/JSTypedOMCSSStyleValueCustom.cpp 2018-12-04 20:25:02 UTC (rev 238872)
@@ -0,0 +1,58 @@
+/*
+ * 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.
+ */
+
+#include "config.h"
+#include "JSTypedOMCSSStyleValue.h"
+
+#if ENABLE(CSS_PAINTING_API)
+
+#include "JSTypedOMCSSImageValue.h"
+#include "JSTypedOMCSSUnitValue.h"
+#include "JSTypedOMCSSUnparsedValue.h"
+
+namespace WebCore {
+using namespace JSC;
+
+JSValue toJSNewlyCreated(ExecState*, JSDOMGlobalObject* globalObject, Ref<TypedOMCSSStyleValue>&& value)
+{
+ if (value->isUnitValue())
+ return createWrapper<TypedOMCSSUnitValue>(globalObject, WTFMove(value));
+ if (value->isUnparsedValue())
+ return createWrapper<TypedOMCSSUnparsedValue>(globalObject, WTFMove(value));
+ if (value->isImageValue())
+ return createWrapper<TypedOMCSSImageValue>(globalObject, WTFMove(value));
+
+ ASSERT_NOT_REACHED();
+ return createWrapper<TypedOMCSSStyleValue>(globalObject, WTFMove(value));
+}
+
+JSValue toJS(ExecState* state, JSDOMGlobalObject* globalObject, TypedOMCSSStyleValue& object)
+{
+ return wrap(state, globalObject, object);
+}
+
+} // namespace WebCore
+
+#endif
Modified: trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h (238871 => 238872)
--- trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h 2018-12-04 20:07:09 UTC (rev 238871)
+++ trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h 2018-12-04 20:25:02 UTC (rev 238872)
@@ -58,6 +58,7 @@
macro(Credential) \
macro(CredentialsContainer) \
macro(CSSAnimation) \
+ macro(CSSImageValue) \
macro(CSSNumericValue) \
macro(CSSPaintSize) \
macro(CSSStyleValue) \
Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (238871 => 238872)
--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp 2018-12-04 20:07:09 UTC (rev 238871)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp 2018-12-04 20:25:02 UTC (rev 238872)
@@ -2638,7 +2638,7 @@
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&) {
@@ -2647,8 +2647,9 @@
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)
Modified: trunk/Source/WebCore/css/CSSCustomPropertyValue.cpp (238871 => 238872)
--- trunk/Source/WebCore/css/CSSCustomPropertyValue.cpp 2018-12-04 20:07:09 UTC (rev 238871)
+++ trunk/Source/WebCore/css/CSSCustomPropertyValue.cpp 2018-12-04 20:25:02 UTC (rev 238872)
@@ -33,7 +33,7 @@
{
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);
@@ -41,8 +41,9 @@
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
@@ -50,7 +51,7 @@
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);
@@ -58,8 +59,9 @@
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;
}
@@ -68,7 +70,7 @@
{
Vector<CSSParserToken> result;
- auto visitor = WTF::makeVisitor([&](const Ref<CSSVariableReferenceValue>&) {
+ WTF::switchOn(m_value, [&](const Ref<CSSVariableReferenceValue>&) {
ASSERT_NOT_REACHED();
}, [&](const CSSValueID&) {
// Do nothing
@@ -80,8 +82,13 @@
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;
}
Modified: trunk/Source/WebCore/css/CSSCustomPropertyValue.h (238871 => 238872)
--- trunk/Source/WebCore/css/CSSCustomPropertyValue.h 2018-12-04 20:07:09 UTC (rev 238871)
+++ trunk/Source/WebCore/css/CSSCustomPropertyValue.h 2018-12-04 20:25:02 UTC (rev 238872)
@@ -29,6 +29,7 @@
#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>
@@ -41,7 +42,7 @@
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)
{
@@ -69,6 +70,11 @@
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));
@@ -111,6 +117,8 @@
m_value = value.copyRef();
}, [&](const Length& value) {
m_value = value;
+ }, [&](const Ref<StyleImage>& value) {
+ m_value = value.copyRef();
});
WTF::visit(visitor, other.m_value);
}
Modified: trunk/Source/WebCore/css/CSSPaintImageValue.cpp (238871 => 238872)
--- trunk/Source/WebCore/css/CSSPaintImageValue.cpp 2018-12-04 20:07:09 UTC (rev 238871)
+++ trunk/Source/WebCore/css/CSSPaintImageValue.cpp 2018-12-04 20:25:02 UTC (rev 238872)
@@ -69,7 +69,11 @@
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())
Deleted: trunk/Source/WebCore/css/typedom/CSSNumericValue.h (238871 => 238872)
--- trunk/Source/WebCore/css/typedom/CSSNumericValue.h 2018-12-04 20:07:09 UTC (rev 238871)
+++ trunk/Source/WebCore/css/typedom/CSSNumericValue.h 2018-12-04 20:25:02 UTC (rev 238872)
@@ -1,40 +0,0 @@
-/*
- * 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 "CSSStyleValue.h"
-
-namespace WebCore {
-
-class CSSNumericValue : public CSSStyleValue {
-protected:
- CSSNumericValue() = default;
-};
-} // namespace WebCore
-
-#endif
Deleted: trunk/Source/WebCore/css/typedom/CSSNumericValue.idl (238871 => 238872)
--- trunk/Source/WebCore/css/typedom/CSSNumericValue.idl 2018-12-04 20:07:09 UTC (rev 238871)
+++ trunk/Source/WebCore/css/typedom/CSSNumericValue.idl 2018-12-04 20:25:02 UTC (rev 238872)
@@ -1,34 +0,0 @@
-/*
-* 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.
-[
- EnabledAtRuntime=CSSPaintingAPI,
- Conditional=CSS_PAINTING_API,
- Exposed=(Window,Worker,PaintWorklet),
-] interface CSSNumericValue : CSSStyleValue {
-};
Deleted: trunk/Source/WebCore/css/typedom/CSSStyleValue.h (238871 => 238872)
--- trunk/Source/WebCore/css/typedom/CSSStyleValue.h 2018-12-04 20:07:09 UTC (rev 238871)
+++ trunk/Source/WebCore/css/typedom/CSSStyleValue.h 2018-12-04 20:25:02 UTC (rev 238872)
@@ -1,49 +0,0 @@
-/*
- * 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 <wtf/RefCounted.h>
-#include <wtf/text/WTFString.h>
-
-namespace WebCore {
-
-class CSSStyleValue : public RefCounted<CSSStyleValue> {
-public:
- virtual ~CSSStyleValue() = default;
- virtual String toString() = 0;
-
- virtual bool isUnitValue() { return false; }
- virtual bool isUnparsedValue() { return false; }
-
-protected:
- CSSStyleValue() = default;
-};
-
-} // namespace WebCore
-
-#endif
Deleted: trunk/Source/WebCore/css/typedom/CSSStyleValue.idl (238871 => 238872)
--- trunk/Source/WebCore/css/typedom/CSSStyleValue.idl 2018-12-04 20:07:09 UTC (rev 238871)
+++ trunk/Source/WebCore/css/typedom/CSSStyleValue.idl 2018-12-04 20:25:02 UTC (rev 238872)
@@ -1,37 +0,0 @@
-/*
-* 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.
-[
- CustomToJSObject,
- EnabledAtRuntime=CSSPaintingAPI,
- Conditional=CSS_PAINTING_API,
- Exposed=(Window,Worker,PaintWorklet),
- SkipVTableValidation,
-] interface CSSStyleValue {
- stringifier;
-};
Deleted: trunk/Source/WebCore/css/typedom/CSSUnitValue.h (238871 => 238872)
--- trunk/Source/WebCore/css/typedom/CSSUnitValue.h 2018-12-04 20:07:09 UTC (rev 238871)
+++ trunk/Source/WebCore/css/typedom/CSSUnitValue.h 2018-12-04 20:25:02 UTC (rev 238872)
@@ -1,67 +0,0 @@
-/*
- * 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 "CSSNumericValue.h"
-#include <wtf/RefCounted.h>
-#include <wtf/text/StringConcatenateNumbers.h>
-#include <wtf/text/WTFString.h>
-
-namespace WebCore {
-
-class CSSUnitValue final : public CSSNumericValue {
-public:
- static Ref<CSSUnitValue> create(double value, const String& unit)
- {
- return adoptRef(*new CSSUnitValue(value, unit));
- }
-
- // FIXME: not correct.
- String toString() final { return makeString((int) m_value, m_unit); }
-
- double value() const { return m_value; }
- void setValue(double value) { m_value = value; }
- const String& unit() const { return m_unit; }
- void setUnit(const String& unit) { m_unit = unit; }
-
-private:
- CSSUnitValue(double value, const String& unit)
- : m_value(value)
- , m_unit(unit)
- {
- }
-
- bool isUnitValue() final { return true; }
-
- double m_value;
- String m_unit;
-};
-
-} // namespace WebCore
-
-#endif
Deleted: trunk/Source/WebCore/css/typedom/CSSUnitValue.idl (238871 => 238872)
--- trunk/Source/WebCore/css/typedom/CSSUnitValue.idl 2018-12-04 20:07:09 UTC (rev 238871)
+++ trunk/Source/WebCore/css/typedom/CSSUnitValue.idl 2018-12-04 20:25:02 UTC (rev 238872)
@@ -1,37 +0,0 @@
-/*
-* 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.
-[
- EnabledAtRuntime=CSSPaintingAPI,
- Conditional=CSS_PAINTING_API,
- Exposed=(Window,Worker,PaintWorklet),
- Constructor(double value, USVString unit),
-] interface CSSUnitValue : CSSNumericValue {
- attribute double value;
- readonly attribute USVString unit;
-};
Deleted: trunk/Source/WebCore/css/typedom/CSSUnparsedValue.h (238871 => 238872)
--- trunk/Source/WebCore/css/typedom/CSSUnparsedValue.h 2018-12-04 20:07:09 UTC (rev 238871)
+++ trunk/Source/WebCore/css/typedom/CSSUnparsedValue.h 2018-12-04 20:25:02 UTC (rev 238872)
@@ -1,58 +0,0 @@
-/*
- * 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 "CSSStyleValue.h"
-#include <wtf/RefCounted.h>
-#include <wtf/text/WTFString.h>
-
-namespace WebCore {
-
-class CSSUnparsedValue final : public CSSStyleValue {
-public:
- static Ref<CSSUnparsedValue> create(const String& serializedValue)
- {
- return adoptRef(*new CSSUnparsedValue(serializedValue));
- }
-
- String toString() final { return m_serializedValue; }
-
-private:
- explicit CSSUnparsedValue(const String& serializedValue)
- : m_serializedValue(serializedValue)
- {
- }
-
- bool isUnparsedValue() final { return true; }
-
- String m_serializedValue;
-};
-
-} // namespace WebCore
-
-#endif
Deleted: trunk/Source/WebCore/css/typedom/CSSUnparsedValue.idl (238871 => 238872)
--- trunk/Source/WebCore/css/typedom/CSSUnparsedValue.idl 2018-12-04 20:07:09 UTC (rev 238871)
+++ trunk/Source/WebCore/css/typedom/CSSUnparsedValue.idl 2018-12-04 20:25:02 UTC (rev 238872)
@@ -1,36 +0,0 @@
-/*
-* 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.
-// FIXME: wrong constructor.
-[
- EnabledAtRuntime=CSSPaintingAPI,
- Conditional=CSS_PAINTING_API,
- Exposed=(Window,Worker,PaintWorklet),
- Constructor(USVString serializedValue),
-] interface CSSUnparsedValue : CSSStyleValue {
-};
Modified: trunk/Source/WebCore/css/typedom/StylePropertyMapReadOnly.h (238871 => 238872)
--- trunk/Source/WebCore/css/typedom/StylePropertyMapReadOnly.h 2018-12-04 20:07:09 UTC (rev 238871)
+++ trunk/Source/WebCore/css/typedom/StylePropertyMapReadOnly.h 2018-12-04 20:25:02 UTC (rev 238872)
@@ -27,7 +27,7 @@
#if ENABLE(CSS_PAINTING_API)
-#include "CSSStyleValue.h"
+#include "TypedOMCSSStyleValue.h"
#include <wtf/HashMap.h>
#include <wtf/RefCounted.h>
#include <wtf/text/WTFString.h>
@@ -36,20 +36,20 @@
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)));
}
- CSSStyleValue* get(String property) const { return m_map.get(property); }
+ TypedOMCSSStyleValue* get(String property) const { return m_map.get(property); }
private:
- explicit StylePropertyMapReadOnly(HashMap<String, Ref<CSSStyleValue>>&& map)
+ explicit StylePropertyMapReadOnly(HashMap<String, Ref<TypedOMCSSStyleValue>>&& map)
: m_map(WTFMove(map))
{
}
- HashMap<String, Ref<CSSStyleValue>> m_map;
+ HashMap<String, Ref<TypedOMCSSStyleValue>> m_map;
};
} // namespace WebCore
Modified: trunk/Source/WebCore/css/typedom/StylePropertyMapReadOnly.idl (238871 => 238872)
--- trunk/Source/WebCore/css/typedom/StylePropertyMapReadOnly.idl 2018-12-04 20:07:09 UTC (rev 238871)
+++ trunk/Source/WebCore/css/typedom/StylePropertyMapReadOnly.idl 2018-12-04 20:25:02 UTC (rev 238872)
@@ -32,6 +32,6 @@
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);
};
Copied: trunk/Source/WebCore/css/typedom/TypedOMCSSImageValue.h (from rev 238871, trunk/Source/WebCore/css/typedom/CSSUnitValue.h) (0 => 238872)
--- trunk/Source/WebCore/css/typedom/TypedOMCSSImageValue.h (rev 0)
+++ trunk/Source/WebCore/css/typedom/TypedOMCSSImageValue.h 2018-12-04 20:25:02 UTC (rev 238872)
@@ -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
Copied: trunk/Source/WebCore/css/typedom/TypedOMCSSImageValue.idl (from rev 238871, trunk/Source/WebCore/css/typedom/CSSStyleValue.idl) (0 => 238872)
--- trunk/Source/WebCore/css/typedom/TypedOMCSSImageValue.idl (rev 0)
+++ trunk/Source/WebCore/css/typedom/TypedOMCSSImageValue.idl 2018-12-04 20:25:02 UTC (rev 238872)
@@ -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 {
+};
Copied: trunk/Source/WebCore/css/typedom/TypedOMCSSNumericValue.h (from rev 238871, trunk/Source/WebCore/css/typedom/CSSNumericValue.h) (0 => 238872)
--- trunk/Source/WebCore/css/typedom/TypedOMCSSNumericValue.h (rev 0)
+++ trunk/Source/WebCore/css/typedom/TypedOMCSSNumericValue.h 2018-12-04 20:25:02 UTC (rev 238872)
@@ -0,0 +1,40 @@
+/*
+ * 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 "TypedOMCSSStyleValue.h"
+
+namespace WebCore {
+
+class TypedOMCSSNumericValue : public TypedOMCSSStyleValue {
+protected:
+ TypedOMCSSNumericValue() = default;
+};
+} // namespace WebCore
+
+#endif
Copied: trunk/Source/WebCore/css/typedom/TypedOMCSSNumericValue.idl (from rev 238871, trunk/Source/WebCore/css/typedom/CSSNumericValue.idl) (0 => 238872)
--- trunk/Source/WebCore/css/typedom/TypedOMCSSNumericValue.idl (rev 0)
+++ trunk/Source/WebCore/css/typedom/TypedOMCSSNumericValue.idl 2018-12-04 20:25:02 UTC (rev 238872)
@@ -0,0 +1,35 @@
+/*
+* 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=CSSNumericValue,
+ EnabledAtRuntime=CSSPaintingAPI,
+ Conditional=CSS_PAINTING_API,
+ Exposed=(Window,Worker,PaintWorklet),
+] interface TypedOMCSSNumericValue : TypedOMCSSStyleValue {
+};
Copied: trunk/Source/WebCore/css/typedom/TypedOMCSSStyleValue.h (from rev 238871, trunk/Source/WebCore/css/typedom/CSSStyleValue.h) (0 => 238872)
--- trunk/Source/WebCore/css/typedom/TypedOMCSSStyleValue.h (rev 0)
+++ trunk/Source/WebCore/css/typedom/TypedOMCSSStyleValue.h 2018-12-04 20:25:02 UTC (rev 238872)
@@ -0,0 +1,51 @@
+/*
+ * 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 "ScriptWrappable.h"
+#include <wtf/RefCounted.h>
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+class TypedOMCSSStyleValue : public RefCounted<TypedOMCSSStyleValue>, public ScriptWrappable {
+public:
+ virtual ~TypedOMCSSStyleValue() = default;
+ virtual String toString() = 0;
+
+ virtual bool isUnitValue() { return false; }
+ virtual bool isUnparsedValue() { return false; }
+ virtual bool isImageValue() { return false; }
+
+protected:
+ TypedOMCSSStyleValue() = default;
+};
+
+} // namespace WebCore
+
+#endif
Copied: trunk/Source/WebCore/css/typedom/TypedOMCSSStyleValue.idl (from rev 238871, trunk/Source/WebCore/css/typedom/CSSStyleValue.idl) (0 => 238872)
--- trunk/Source/WebCore/css/typedom/TypedOMCSSStyleValue.idl (rev 0)
+++ trunk/Source/WebCore/css/typedom/TypedOMCSSStyleValue.idl 2018-12-04 20:25:02 UTC (rev 238872)
@@ -0,0 +1,38 @@
+/*
+* 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=CSSStyleValue,
+ CustomToJSObject,
+ EnabledAtRuntime=CSSPaintingAPI,
+ Conditional=CSS_PAINTING_API,
+ Exposed=(Window,Worker,PaintWorklet),
+ SkipVTableValidation,
+] interface TypedOMCSSStyleValue {
+ stringifier;
+};
Copied: trunk/Source/WebCore/css/typedom/TypedOMCSSUnitValue.h (from rev 238871, trunk/Source/WebCore/css/typedom/CSSUnitValue.h) (0 => 238872)
--- trunk/Source/WebCore/css/typedom/TypedOMCSSUnitValue.h (rev 0)
+++ trunk/Source/WebCore/css/typedom/TypedOMCSSUnitValue.h 2018-12-04 20:25:02 UTC (rev 238872)
@@ -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 "TypedOMCSSNumericValue.h"
+#include <wtf/RefCounted.h>
+#include <wtf/text/StringConcatenateNumbers.h>
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+class TypedOMCSSUnitValue final : public TypedOMCSSNumericValue {
+public:
+ static Ref<TypedOMCSSUnitValue> create(double value, const String& unit)
+ {
+ return adoptRef(*new TypedOMCSSUnitValue(value, unit));
+ }
+
+ // FIXME: not correct.
+ String toString() final { return makeString((int) m_value, m_unit); }
+
+ double value() const { return m_value; }
+ void setValue(double value) { m_value = value; }
+ const String& unit() const { return m_unit; }
+ void setUnit(const String& unit) { m_unit = unit; }
+
+private:
+ TypedOMCSSUnitValue(double value, const String& unit)
+ : m_value(value)
+ , m_unit(unit)
+ {
+ }
+
+ bool isUnitValue() final { return true; }
+
+ double m_value;
+ String m_unit;
+};
+
+} // namespace WebCore
+
+#endif
Copied: trunk/Source/WebCore/css/typedom/TypedOMCSSUnitValue.idl (from rev 238871, trunk/Source/WebCore/css/typedom/CSSUnitValue.idl) (0 => 238872)
--- trunk/Source/WebCore/css/typedom/TypedOMCSSUnitValue.idl (rev 0)
+++ trunk/Source/WebCore/css/typedom/TypedOMCSSUnitValue.idl 2018-12-04 20:25:02 UTC (rev 238872)
@@ -0,0 +1,38 @@
+/*
+* 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=CSSUnitValue,
+ EnabledAtRuntime=CSSPaintingAPI,
+ Conditional=CSS_PAINTING_API,
+ Exposed=(Window,Worker,PaintWorklet),
+ Constructor(double value, USVString unit),
+] interface TypedOMCSSUnitValue : TypedOMCSSNumericValue {
+ attribute double value;
+ readonly attribute USVString unit;
+};
Copied: trunk/Source/WebCore/css/typedom/TypedOMCSSUnparsedValue.h (from rev 238871, trunk/Source/WebCore/css/typedom/CSSUnparsedValue.h) (0 => 238872)
--- trunk/Source/WebCore/css/typedom/TypedOMCSSUnparsedValue.h (rev 0)
+++ trunk/Source/WebCore/css/typedom/TypedOMCSSUnparsedValue.h 2018-12-04 20:25:02 UTC (rev 238872)
@@ -0,0 +1,58 @@
+/*
+ * 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 "TypedOMCSSStyleValue.h"
+#include <wtf/RefCounted.h>
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+class TypedOMCSSUnparsedValue final : public TypedOMCSSStyleValue {
+public:
+ static Ref<TypedOMCSSUnparsedValue> create(const String& serializedValue)
+ {
+ return adoptRef(*new TypedOMCSSUnparsedValue(serializedValue));
+ }
+
+ String toString() final { return m_serializedValue; }
+
+private:
+ explicit TypedOMCSSUnparsedValue(const String& serializedValue)
+ : m_serializedValue(serializedValue)
+ {
+ }
+
+ bool isUnparsedValue() final { return true; }
+
+ String m_serializedValue;
+};
+
+} // namespace WebCore
+
+#endif
Copied: trunk/Source/WebCore/css/typedom/TypedOMCSSUnparsedValue.idl (from rev 238871, trunk/Source/WebCore/css/typedom/CSSUnparsedValue.idl) (0 => 238872)
--- trunk/Source/WebCore/css/typedom/TypedOMCSSUnparsedValue.idl (rev 0)
+++ trunk/Source/WebCore/css/typedom/TypedOMCSSUnparsedValue.idl 2018-12-04 20:25:02 UTC (rev 238872)
@@ -0,0 +1,37 @@
+/*
+* 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.
+// FIXME: wrong constructor.
+[
+ InterfaceName=CSSUnparsedValue,
+ EnabledAtRuntime=CSSPaintingAPI,
+ Conditional=CSS_PAINTING_API,
+ Exposed=(Window,Worker,PaintWorklet),
+ Constructor(USVString serializedValue),
+] interface TypedOMCSSUnparsedValue : TypedOMCSSStyleValue {
+};
Modified: trunk/Source/WebCore/html/ImageBitmap.cpp (238871 => 238872)
--- trunk/Source/WebCore/html/ImageBitmap.cpp 2018-12-04 20:07:09 UTC (rev 238871)
+++ trunk/Source/WebCore/html/ImageBitmap.cpp 2018-12-04 20:25:02 UTC (rev 238872)
@@ -44,6 +44,7 @@
#include "LayoutSize.h"
#include "RenderElement.h"
#include "SharedBuffer.h"
+#include "TypedOMCSSImageValue.h"
#include <wtf/StdLibExtras.h>
namespace WebCore {
@@ -448,6 +449,13 @@
}
#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
Modified: trunk/Source/WebCore/html/ImageBitmap.h (238871 => 238872)
--- trunk/Source/WebCore/html/ImageBitmap.h 2018-12-04 20:07:09 UTC (rev 238871)
+++ trunk/Source/WebCore/html/ImageBitmap.h 2018-12-04 20:25:02 UTC (rev 238872)
@@ -44,6 +44,7 @@
class IntSize;
class PendingImageBitmap;
class ScriptExecutionContext;
+class TypedOMCSSImageValue;
struct ImageBitmapOptions;
class ImageBitmap : public ScriptWrappable, public RefCounted<ImageBitmap> {
@@ -55,6 +56,9 @@
#endif
RefPtr<HTMLCanvasElement>,
RefPtr<ImageBitmap>,
+#if ENABLE(CSS_PAINTING_API)
+ RefPtr<TypedOMCSSImageValue>,
+#endif
RefPtr<Blob>,
RefPtr<ImageData>
>;
@@ -98,6 +102,7 @@
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;
Modified: trunk/Source/WebCore/html/canvas/CanvasDrawImage.idl (238871 => 238872)
--- trunk/Source/WebCore/html/canvas/CanvasDrawImage.idl 2018-12-04 20:07:09 UTC (rev 238871)
+++ trunk/Source/WebCore/html/canvas/CanvasDrawImage.idl 2018-12-04 20:25:02 UTC (rev 238872)
@@ -24,7 +24,9 @@
*/
// 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;
Modified: trunk/Source/WebCore/html/canvas/CanvasFillStrokeStyles.idl (238871 => 238872)
--- trunk/Source/WebCore/html/canvas/CanvasFillStrokeStyles.idl 2018-12-04 20:07:09 UTC (rev 238871)
+++ trunk/Source/WebCore/html/canvas/CanvasFillStrokeStyles.idl 2018-12-04 20:25:02 UTC (rev 238872)
@@ -24,7 +24,9 @@
*/
// 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;
Modified: trunk/Source/WebCore/html/canvas/CanvasRenderingContext.cpp (238871 => 238872)
--- trunk/Source/WebCore/html/canvas/CanvasRenderingContext.cpp 2018-12-04 20:07:09 UTC (rev 238871)
+++ trunk/Source/WebCore/html/canvas/CanvasRenderingContext.cpp 2018-12-04 20:25:02 UTC (rev 238872)
@@ -144,4 +144,9 @@
m_canvas.setOriginTainted();
}
+void CanvasRenderingContext::checkOrigin(const TypedOMCSSImageValue&)
+{
+ m_canvas.setOriginTainted();
+}
+
} // namespace WebCore
Modified: trunk/Source/WebCore/html/canvas/CanvasRenderingContext.h (238871 => 238872)
--- trunk/Source/WebCore/html/canvas/CanvasRenderingContext.h 2018-12-04 20:07:09 UTC (rev 238871)
+++ trunk/Source/WebCore/html/canvas/CanvasRenderingContext.h 2018-12-04 20:25:02 UTC (rev 238872)
@@ -38,6 +38,7 @@
class HTMLImageElement;
class HTMLVideoElement;
class ImageBitmap;
+class TypedOMCSSImageValue;
class WebGLObject;
class CanvasRenderingContext : public ScriptWrappable {
@@ -88,6 +89,7 @@
m_canvas.setOriginTainted();
}
void checkOrigin(const URL&);
+ void checkOrigin(const TypedOMCSSImageValue&);
bool m_callTracingActive { false };
Modified: trunk/Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp (238871 => 238872)
--- trunk/Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp 2018-12-04 20:07:09 UTC (rev 238871)
+++ trunk/Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp 2018-12-04 20:25:02 UTC (rev 238872)
@@ -61,6 +61,7 @@
#include "StyleResolver.h"
#include "TextMetrics.h"
#include "TextRun.h"
+#include "TypedOMCSSImageValue.h"
#include <wtf/CheckedArithmetic.h>
#include <wtf/MathExtras.h>
#include <wtf/NeverDestroyed.h>
@@ -1438,6 +1439,16 @@
#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()),
@@ -1487,6 +1498,36 @@
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 { };
@@ -1494,13 +1535,9 @@
if (!dstRect.width() || !dstRect.height())
return { };
- if (!imageElement.complete())
- return { };
-
FloatRect normalizedSrcRect = normalizeRect(srcRect);
FloatRect normalizedDstRect = normalizeRect(dstRect);
- FloatRect imageRect = FloatRect(FloatPoint(), size(imageElement, ImageSizeType::BeforeDevicePixelRatio));
if (!srcRect.width() || !srcRect.height())
return Exception { IndexSizeError };
@@ -1524,11 +1561,10 @@
if (!state().hasInvertibleTransform)
return { };
- CachedImage* cachedImage = imageElement.cachedImage();
if (!cachedImage)
return { };
- RefPtr<Image> image = cachedImage->imageForRenderer(imageElement.renderer());
+ RefPtr<Image> image = cachedImage->imageForRenderer(renderer);
if (!image)
return { };
@@ -1540,7 +1576,7 @@
}
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));
@@ -1560,8 +1596,6 @@
if (image->isSVGImage())
image->setImageObserver(observer);
- checkOrigin(&imageElement);
-
return { };
}
@@ -1984,6 +2018,14 @@
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);
Modified: trunk/Source/WebCore/html/canvas/CanvasRenderingContext2DBase.h (238871 => 238872)
--- trunk/Source/WebCore/html/canvas/CanvasRenderingContext2DBase.h 2018-12-04 20:07:09 UTC (rev 238871)
+++ trunk/Source/WebCore/html/canvas/CanvasRenderingContext2DBase.h 2018-12-04 20:25:02 UTC (rev 238872)
@@ -50,6 +50,8 @@
namespace WebCore {
+class TypedOMCSSImageValue;
+class CachedImage;
class CanvasBase;
class CanvasGradient;
class CanvasPattern;
@@ -62,11 +64,14 @@
class ImageData;
class Path2D;
class RenderStyle;
+class RenderObject;
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>>;
@@ -321,13 +326,20 @@
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(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(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();
Modified: trunk/Source/WebCore/inspector/InspectorCanvas.cpp (238871 => 238872)
--- trunk/Source/WebCore/inspector/InspectorCanvas.cpp 2018-12-04 20:07:09 UTC (rev 238871)
+++ trunk/Source/WebCore/inspector/InspectorCanvas.cpp 2018-12-04 20:25:02 UTC (rev 238872)
@@ -620,6 +620,9 @@
#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); },
Modified: trunk/Source/WebCore/page/WindowOrWorkerGlobalScope.idl (238871 => 238872)
--- trunk/Source/WebCore/page/WindowOrWorkerGlobalScope.idl 2018-12-04 20:07:09 UTC (rev 238871)
+++ trunk/Source/WebCore/page/WindowOrWorkerGlobalScope.idl 2018-12-04 20:25:02 UTC (rev 238872)
@@ -25,7 +25,9 @@
* 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;
Modified: trunk/Source/WebCore/platform/graphics/CustomPaintImage.cpp (238871 => 238872)
--- trunk/Source/WebCore/platform/graphics/CustomPaintImage.cpp 2018-12-04 20:07:09 UTC (rev 238871)
+++ trunk/Source/WebCore/platform/graphics/CustomPaintImage.cpp 2018-12-04 20:25:02 UTC (rev 238872)
@@ -29,10 +29,9 @@
#if ENABLE(CSS_PAINTING_API)
#include "CSSComputedStyleDeclaration.h"
+#include "CSSImageValue.h"
#include "CSSPrimitiveValue.h"
#include "CSSPropertyParser.h"
-#include "CSSUnitValue.h"
-#include "CSSUnparsedValue.h"
#include "CustomPaintCanvas.h"
#include "GraphicsContext.h"
#include "ImageBitmap.h"
@@ -40,6 +39,9 @@
#include "JSCSSPaintCallback.h"
#include "PaintRenderingContext2D.h"
#include "RenderElement.h"
+#include "TypedOMCSSImageValue.h"
+#include "TypedOMCSSUnitValue.h"
+#include "TypedOMCSSUnparsedValue.h"
#include <_javascript_Core/ConstructData.h>
namespace WebCore {
@@ -82,7 +84,7 @@
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) {
@@ -97,15 +99,17 @@
}
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)
- 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
- propertyValues.add(name, CSSUnparsedValue::create(value->cssText()));
+ propertyValues.add(name, TypedOMCSSUnparsedValue::create(value->cssText()));
}
auto size = CSSPaintSize::create(destSize.width(), destSize.height());
Modified: trunk/Source/WebCore/platform/graphics/gpu/GPUSwapChain.h (238871 => 238872)
--- trunk/Source/WebCore/platform/graphics/gpu/GPUSwapChain.h 2018-12-04 20:07:09 UTC (rev 238871)
+++ trunk/Source/WebCore/platform/graphics/gpu/GPUSwapChain.h 2018-12-04 20:25:02 UTC (rev 238872)
@@ -27,6 +27,7 @@
#if ENABLE(WEBGPU)
+#include "GPUTexture.h"
#include <wtf/RefPtr.h>
#include <wtf/RetainPtr.h>
@@ -37,7 +38,6 @@
namespace WebCore {
class GPUDevice;
-class GPUTexture;
enum class GPUTextureFormatEnum;