WebKit Bugzilla
Attachment 356459 Details for
Bug 192200
: CSS Painting API should allow image values in inputProperties
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-192200-20181203213109.patch (text/plain), 101.19 KB, created by
Justin Michaud
on 2018-12-03 21:31:10 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Justin Michaud
Created:
2018-12-03 21:31:10 PST
Size:
101.19 KB
patch
obsolete
>Subversion Revision: 238842 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 3c0f05d792d8c2cdc00ede206c59d2cf0b86817b..55adb9ef512101908bff87148838a1ba25e8d640 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,69 @@ >+2018-11-29 Justin Michaud <justin_michaud@apple.com> >+ >+ CSS Painting API should allow image values in inputProperties >+ https://bugs.webkit.org/show_bug.cgi?id=192200 >+ >+ Reviewed by Dean Jackson. >+ >+ Adds new TypedOMCSSImageValue wrapper. We rename all the existing ones so that the naming is consistent (CSSImageValue is already a thing). >+ Finally, we let CanvasRenderingContext2DBase render these. >+ >+ Tests: fast/css-custom-paint/arguments.html >+ fast/css-custom-paint/image.html >+ >+ * CMakeLists.txt: >+ * DerivedSources.make: >+ * Sources.txt: >+ * WebCore.xcodeproj/project.pbxproj: >+ * bindings/js/CallTracerTypes.h: >+ * bindings/js/JSTypedOMCSSStyleValueCustom.cpp: Renamed from Source/WebCore/bindings/js/JSCSSStyleValueCustom.cpp. >+ (WebCore::toJSNewlyCreated): >+ (WebCore::toJS): >+ * bindings/js/WebCoreBuiltinNames.h: >+ * css/CSSComputedStyleDeclaration.cpp: >+ (WebCore::ComputedStyleExtractor::customPropertyValue): >+ * css/CSSCustomPropertyValue.cpp: >+ (WebCore::CSSCustomPropertyValue::equals const): >+ (WebCore::CSSCustomPropertyValue::customCSSText const): >+ (WebCore::CSSCustomPropertyValue::tokens const): >+ * css/CSSCustomPropertyValue.h: >+ * css/CSSPaintImageValue.cpp: >+ (WebCore::CSSPaintImageValue::image): >+ * css/typedom/StylePropertyMapReadOnly.h: >+ (WebCore::StylePropertyMapReadOnly::create): >+ (WebCore::StylePropertyMapReadOnly::get const): >+ (WebCore::StylePropertyMapReadOnly::StylePropertyMapReadOnly): >+ * css/typedom/StylePropertyMapReadOnly.idl: >+ * css/typedom/TypedOMCSSImageValue.h: Copied from Source/WebCore/css/typedom/CSSUnitValue.h. >+ * css/typedom/TypedOMCSSImageValue.idl: Copied from Source/WebCore/css/typedom/CSSStyleValue.idl. >+ * css/typedom/TypedOMCSSNumericValue.h: Renamed from Source/WebCore/css/typedom/CSSNumericValue.h. >+ * css/typedom/TypedOMCSSNumericValue.idl: Renamed from Source/WebCore/css/typedom/CSSNumericValue.idl. >+ * css/typedom/TypedOMCSSStyleValue.h: Renamed from Source/WebCore/css/typedom/CSSStyleValue.h. >+ (WebCore::TypedOMCSSStyleValue::isImageValue): >+ * css/typedom/TypedOMCSSStyleValue.idl: Renamed from Source/WebCore/css/typedom/CSSStyleValue.idl. >+ * css/typedom/TypedOMCSSUnitValue.h: Renamed from Source/WebCore/css/typedom/CSSUnitValue.h. >+ * css/typedom/TypedOMCSSUnitValue.idl: Renamed from Source/WebCore/css/typedom/CSSUnitValue.idl. >+ * css/typedom/TypedOMCSSUnparsedValue.h: Renamed from Source/WebCore/css/typedom/CSSUnparsedValue.h. >+ * css/typedom/TypedOMCSSUnparsedValue.idl: Renamed from Source/WebCore/css/typedom/CSSUnparsedValue.idl. >+ * html/ImageBitmap.cpp: >+ (WebCore::ImageBitmap::createPromise): >+ * html/ImageBitmap.h: >+ * html/canvas/CanvasDrawImage.idl: >+ * html/canvas/CanvasFillStrokeStyles.idl: >+ * html/canvas/CanvasRenderingContext.cpp: >+ (WebCore::CanvasRenderingContext::checkOrigin): >+ * html/canvas/CanvasRenderingContext.h: >+ * html/canvas/CanvasRenderingContext2DBase.cpp: >+ (WebCore::size): >+ (WebCore::CanvasRenderingContext2DBase::drawImage): >+ (WebCore::CanvasRenderingContext2DBase::createPattern): >+ * html/canvas/CanvasRenderingContext2DBase.h: >+ * inspector/InspectorCanvas.cpp: >+ (WebCore::InspectorCanvas::buildAction): >+ * page/WindowOrWorkerGlobalScope.idl: >+ * platform/graphics/CustomPaintImage.cpp: >+ (WebCore::CustomPaintImage::doCustomPaint): >+ > 2018-12-03 Simon Fraser <simon.fraser@apple.com> > > REGRESSION (r238090): position:fixed sidebar on https://www.w3.org/TR/SVG2/coords.html does not stay fixed >diff --git a/Source/WebCore/CMakeLists.txt b/Source/WebCore/CMakeLists.txt >index 7ca751ff39c9ba8b27249a743425dc07aea69c5a..51e17d46688c0ae1f1e98c685f3bc6ed4878e800 100644 >--- a/Source/WebCore/CMakeLists.txt >+++ b/Source/WebCore/CMakeLists.txt >@@ -593,10 +593,11 @@ set(WebCore_NON_SVG_IDL_FILES > 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 >diff --git a/Source/WebCore/DerivedSources.make b/Source/WebCore/DerivedSources.make >index 3e57b1b0b83d9a5038899086ad1e7c9b46343be8..971a638f939f436b44538d775a481d7a696cd421 100644 >--- a/Source/WebCore/DerivedSources.make >+++ b/Source/WebCore/DerivedSources.make >@@ -502,11 +502,12 @@ JS_BINDING_IDLS = \ > $(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 \ >diff --git a/Source/WebCore/Sources.txt b/Source/WebCore/Sources.txt >index e745cd5a009f05504d8cb2552a15ef9b957e0262..3146462231f0e7c8ecc9bb1f60ecc98eb146a02e 100644 >--- a/Source/WebCore/Sources.txt >+++ b/Source/WebCore/Sources.txt >@@ -388,7 +388,6 @@ bindings/js/JSBlobCustom.cpp > bindings/js/JSCSSRuleCustom.cpp > bindings/js/JSCSSRuleListCustom.cpp > bindings/js/JSCSSStyleDeclarationCustom.cpp >-bindings/js/JSCSSStyleValueCustom.cpp > bindings/js/JSDOMConvertDate.cpp > bindings/js/JSDOMConvertNumbers.cpp > bindings/js/JSDOMConvertStrings.cpp >@@ -478,6 +477,7 @@ bindings/js/JSTextTrackCustom.cpp > bindings/js/JSTextTrackListCustom.cpp > bindings/js/JSTrackCustom.cpp > bindings/js/JSTreeWalkerCustom.cpp >+bindings/js/JSTypedOMCSSStyleValueCustom.cpp > bindings/js/JSVideoTrackCustom.cpp > bindings/js/JSVideoTrackListCustom.cpp > bindings/js/JSWebAnimationCustom.cpp >@@ -2501,17 +2501,18 @@ JSBlobPropertyBag.cpp > JSByteLengthQueuingStrategy.cpp > JSCDATASection.cpp > JSCSSFontFaceRule.cpp >+JSTypedOMCSSImageValue.cpp >+JSTypedOMCSSNumericValue.cpp >+JSTypedOMCSSStyleValue.cpp >+JSTypedOMCSSUnitValue.cpp >+JSTypedOMCSSUnparsedValue.cpp > JSCSSImportRule.cpp > JSCSSKeyframeRule.cpp > JSCSSKeyframesRule.cpp > JSCSSMediaRule.cpp > JSCSSNamespaceRule.cpp >-JSCSSNumericValue.cpp > JSCSSPaintCallback.cpp > JSCSSPaintSize.cpp >-JSCSSStyleValue.cpp >-JSCSSUnitValue.cpp >-JSCSSUnparsedValue.cpp > JSPaintWorkletGlobalScope.cpp > JSWorklet.cpp > JSWorkletGlobalScope.cpp >diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >index 9f4c7477cb7e6f39b1c804c2f7d552f559384188..bea0e3e9df918d4ebab3f38ea6d3446ff3a47fd7 100644 >--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj >+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >@@ -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, ); }; }; >@@ -7881,6 +7882,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>"; }; >@@ -7903,15 +7906,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>"; }; >@@ -18101,16 +18104,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>"; >@@ -20305,7 +20310,6 @@ > 9392262E10321084006E7D5D /* JSCSSRuleListCustom.cpp */, > BC5825F20C0B89380053F1B5 /* JSCSSStyleDeclarationCustom.cpp */, > AD726FEA16D9F40B003A4E6D /* JSCSSStyleDeclarationCustom.h */, >- 4BAFD0E22192604D00C0AB64 /* JSCSSStyleValueCustom.cpp */, > BC20FB7E0C0E8E6C00D1447F /* JSDeprecatedCSSOMValueCustom.cpp */, > 49C7BA8C1042F5B10009D447 /* JSDocumentCustom.cpp */, > ADDA94BF19686F8000453029 /* JSDocumentCustom.h */, >@@ -20358,6 +20362,7 @@ > 070334E8145A1F35008D8D45 /* JSTrackCustom.cpp */, > 07846384145B1B8E00A58DF1 /* JSTrackCustom.h */, > 516BB7920CE91E6800512F79 /* JSTreeWalkerCustom.cpp */, >+ 4BAFD0E22192604D00C0AB64 /* JSTypedOMCSSStyleValueCustom.cpp */, > BE6DF708171CA2C500DD52B8 /* JSVideoTrackCustom.cpp */, > BE6DF70A171CA2C500DD52B8 /* JSVideoTrackListCustom.cpp */, > 715DA5D3201BB902002EF2B0 /* JSWebAnimationCustom.cpp */, >@@ -28218,7 +28223,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 */, >@@ -28260,7 +28264,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 */, >@@ -28270,9 +28273,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 */, >@@ -31473,6 +31474,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 */, >diff --git a/Source/WebCore/bindings/js/CallTracerTypes.h b/Source/WebCore/bindings/js/CallTracerTypes.h >index 598f3448e478d0606d7df260398cc3c89efc1741..cc3055d8dd48ebf2493b14085aa6ea78bd9b9d29 100644 >--- a/Source/WebCore/bindings/js/CallTracerTypes.h >+++ b/Source/WebCore/bindings/js/CallTracerTypes.h >@@ -36,6 +36,7 @@ > #include "ImageBitmap.h" > #include "ImageData.h" > #include "Path2D.h" >+#include "TypedOMCSSImageValue.h" > #include <JavaScriptCore/ArrayBuffer.h> > #include <JavaScriptCore/ArrayBufferView.h> > #include <JavaScriptCore/Float32Array.h> >@@ -91,6 +92,9 @@ typedef Variant< > RefPtr<HTMLVideoElement>, > #endif > RefPtr<ImageBitmap>, >+#if ENABLE(CSS_PAINTING_API) >+ RefPtr<TypedOMCSSImageValue>, >+#endif > RefPtr<ImageData>, > RefPtr<Int32Array>, > Vector<float>, >diff --git a/Source/WebCore/bindings/js/JSCSSStyleValueCustom.cpp b/Source/WebCore/bindings/js/JSCSSStyleValueCustom.cpp >deleted file mode 100644 >index de3145cab8f3d96552aa76f7c313880dd412ca88..0000000000000000000000000000000000000000 >--- a/Source/WebCore/bindings/js/JSCSSStyleValueCustom.cpp >+++ /dev/null >@@ -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 >diff --git a/Source/WebCore/bindings/js/JSTypedOMCSSStyleValueCustom.cpp b/Source/WebCore/bindings/js/JSTypedOMCSSStyleValueCustom.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..d301add0d063958432c2721b7718514ded0b6bdf >--- /dev/null >+++ b/Source/WebCore/bindings/js/JSTypedOMCSSStyleValueCustom.cpp >@@ -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 >diff --git a/Source/WebCore/bindings/js/WebCoreBuiltinNames.h b/Source/WebCore/bindings/js/WebCoreBuiltinNames.h >index 9f614c2f51d6ed278a9199ec8e84f9412dcd3137..79452de63fc48d13ec302c23f48ca35228bebcf2 100644 >--- a/Source/WebCore/bindings/js/WebCoreBuiltinNames.h >+++ b/Source/WebCore/bindings/js/WebCoreBuiltinNames.h >@@ -58,6 +58,7 @@ namespace WebCore { > macro(Credential) \ > macro(CredentialsContainer) \ > macro(CSSAnimation) \ >+ macro(CSSImageValue) \ > macro(CSSNumericValue) \ > macro(CSSPaintSize) \ > macro(CSSStyleValue) \ >diff --git a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp b/Source/WebCore/css/CSSComputedStyleDeclaration.cpp >index f1b50fba6d9dcb2944845eb7144aa04f3da573c4..58f73fb89095da408c589e6edabba835caa8af45 100644 >--- a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp >+++ b/Source/WebCore/css/CSSComputedStyleDeclaration.cpp >@@ -2638,7 +2638,7 @@ RefPtr<CSSValue> ComputedStyleExtractor::customPropertyValue(const String& prope > 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 @@ RefPtr<CSSValue> ComputedStyleExtractor::customPropertyValue(const String& prope > 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) >diff --git a/Source/WebCore/css/CSSCustomPropertyValue.cpp b/Source/WebCore/css/CSSCustomPropertyValue.cpp >index e6966ff9bdc14426a8c899808d347faa8c2e1d16..13a73e3acfb55af0307ead5f97051e74f848aa6a 100644 >--- a/Source/WebCore/css/CSSCustomPropertyValue.cpp >+++ b/Source/WebCore/css/CSSCustomPropertyValue.cpp >@@ -33,7 +33,7 @@ bool CSSCustomPropertyValue::equals(const CSSCustomPropertyValue& other) const > { > if (m_name != other.m_name || m_value.index() != other.m_value.index()) > return false; >- 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 @@ bool CSSCustomPropertyValue::equals(const CSSCustomPropertyValue& other) const > return value.get() == WTF::get<Ref<CSSVariableData>>(other.m_value).get(); > }, [&](const Length& value) { > return value == WTF::get<Length>(other.m_value); >+ }, [&](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 @@ String CSSCustomPropertyValue::customCSSText() const > 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 @@ String CSSCustomPropertyValue::customCSSText() const > 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> CSSCustomPropertyValue::tokens() const > { > Vector<CSSParserToken> result; > >- auto visitor = WTF::makeVisitor([&](const Ref<CSSVariableReferenceValue>&) { >+ WTF::switchOn(m_value, [&](const Ref<CSSVariableReferenceValue>&) { > ASSERT_NOT_REACHED(); > }, [&](const CSSValueID&) { > // Do nothing >@@ -77,11 +79,16 @@ Vector<CSSParserToken> CSSCustomPropertyValue::tokens() const > }, [&](const Length&) { > CSSTokenizer tokenizer(cssText()); > >+ 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; > } >diff --git a/Source/WebCore/css/CSSCustomPropertyValue.h b/Source/WebCore/css/CSSCustomPropertyValue.h >index 625e19511e2ddadbad47c6917339d4997118f497..fe8502558c41e35dac9be0e78439dc437aa9b944 100644 >--- a/Source/WebCore/css/CSSCustomPropertyValue.h >+++ b/Source/WebCore/css/CSSCustomPropertyValue.h >@@ -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 RenderStyle; > > 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 @@ public: > 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 @@ private: > m_value = value.copyRef(); > }, [&](const Length& value) { > m_value = value; >+ }, [&](const Ref<StyleImage>& value) { >+ m_value = value.copyRef(); > }); > WTF::visit(visitor, other.m_value); > } >diff --git a/Source/WebCore/css/CSSPaintImageValue.cpp b/Source/WebCore/css/CSSPaintImageValue.cpp >index 14665267cd6b79324aa4182b60690aac864754cf..796846e6471f57e49c1f5bf9f6f762698bbfc152 100644 >--- a/Source/WebCore/css/CSSPaintImageValue.cpp >+++ b/Source/WebCore/css/CSSPaintImageValue.cpp >@@ -69,7 +69,11 @@ RefPtr<Image> CSSPaintImageValue::image(RenderElement& renderElement, const Floa > 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()) >diff --git a/Source/WebCore/css/typedom/CSSNumericValue.h b/Source/WebCore/css/typedom/CSSNumericValue.h >deleted file mode 100644 >index de49784889ff95c5c91280df01f9ead2ba56e955..0000000000000000000000000000000000000000 >--- a/Source/WebCore/css/typedom/CSSNumericValue.h >+++ /dev/null >@@ -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 >diff --git a/Source/WebCore/css/typedom/CSSNumericValue.idl b/Source/WebCore/css/typedom/CSSNumericValue.idl >deleted file mode 100644 >index d4a26662b29c46e2f3a36cbfc5ae6b120284550f..0000000000000000000000000000000000000000 >--- a/Source/WebCore/css/typedom/CSSNumericValue.idl >+++ /dev/null >@@ -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 { >-}; >diff --git a/Source/WebCore/css/typedom/CSSStyleValue.h b/Source/WebCore/css/typedom/CSSStyleValue.h >deleted file mode 100644 >index b662ea66e096f2a00f0bbb9982b1f13f2af60f3a..0000000000000000000000000000000000000000 >--- a/Source/WebCore/css/typedom/CSSStyleValue.h >+++ /dev/null >@@ -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 >diff --git a/Source/WebCore/css/typedom/CSSStyleValue.idl b/Source/WebCore/css/typedom/CSSStyleValue.idl >deleted file mode 100644 >index a87430c70404b87f0d60f7e92c40f997e377020c..0000000000000000000000000000000000000000 >--- a/Source/WebCore/css/typedom/CSSStyleValue.idl >+++ /dev/null >@@ -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; >-}; >diff --git a/Source/WebCore/css/typedom/CSSUnitValue.h b/Source/WebCore/css/typedom/CSSUnitValue.h >deleted file mode 100644 >index 49799746c8a6ded96cd9d3879373ea9b16f26e43..0000000000000000000000000000000000000000 >--- a/Source/WebCore/css/typedom/CSSUnitValue.h >+++ /dev/null >@@ -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 >diff --git a/Source/WebCore/css/typedom/CSSUnitValue.idl b/Source/WebCore/css/typedom/CSSUnitValue.idl >deleted file mode 100644 >index 2c78aa505b6e1e848776267d14dd6171edd22553..0000000000000000000000000000000000000000 >--- a/Source/WebCore/css/typedom/CSSUnitValue.idl >+++ /dev/null >@@ -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; >-}; >diff --git a/Source/WebCore/css/typedom/CSSUnparsedValue.h b/Source/WebCore/css/typedom/CSSUnparsedValue.h >deleted file mode 100644 >index 3bccf3a33fd57bd8abcb893ca26cca3164080797..0000000000000000000000000000000000000000 >--- a/Source/WebCore/css/typedom/CSSUnparsedValue.h >+++ /dev/null >@@ -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 >diff --git a/Source/WebCore/css/typedom/CSSUnparsedValue.idl b/Source/WebCore/css/typedom/CSSUnparsedValue.idl >deleted file mode 100644 >index d039c822864bd99b985f9793b21684957f6c58eb..0000000000000000000000000000000000000000 >--- a/Source/WebCore/css/typedom/CSSUnparsedValue.idl >+++ /dev/null >@@ -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 { >-}; >diff --git a/Source/WebCore/css/typedom/StylePropertyMapReadOnly.h b/Source/WebCore/css/typedom/StylePropertyMapReadOnly.h >index 5993f8b69101f04e9b1742c14576b83eaa1bb9b8..35104cb58e445dfcac4d361278f299d9088ba3db 100644 >--- a/Source/WebCore/css/typedom/StylePropertyMapReadOnly.h >+++ b/Source/WebCore/css/typedom/StylePropertyMapReadOnly.h >@@ -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 @@ namespace WebCore { > > 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 >diff --git a/Source/WebCore/css/typedom/StylePropertyMapReadOnly.idl b/Source/WebCore/css/typedom/StylePropertyMapReadOnly.idl >index b7e1983f33e21a7b5e86705ce7cf1d43e75e7adf..e8ff3351cabd7dbc3c0c17ebde8e2012e536485b 100644 >--- a/Source/WebCore/css/typedom/StylePropertyMapReadOnly.idl >+++ b/Source/WebCore/css/typedom/StylePropertyMapReadOnly.idl >@@ -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); > }; >diff --git a/Source/WebCore/css/typedom/TypedOMCSSImageValue.h b/Source/WebCore/css/typedom/TypedOMCSSImageValue.h >new file mode 100644 >index 0000000000000000000000000000000000000000..dde1b1d0f39ca4971a3fe4c0d71443b794645f51 >--- /dev/null >+++ b/Source/WebCore/css/typedom/TypedOMCSSImageValue.h >@@ -0,0 +1,67 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#if ENABLE(CSS_PAINTING_API) >+ >+#include "CSSImageValue.h" >+#include "ImageBitmap.h" >+#include "RenderElement.h" >+#include "TypedOMCSSStyleValue.h" >+#include <wtf/RefCounted.h> >+#include <wtf/text/StringConcatenateNumbers.h> >+#include <wtf/text/WTFString.h> >+ >+namespace WebCore { >+ >+class TypedOMCSSImageValue final : public TypedOMCSSStyleValue { >+public: >+ static Ref<TypedOMCSSImageValue> create(CSSImageValue& cssValue, RenderElement& renderer) >+ { >+ return adoptRef(*new TypedOMCSSImageValue(cssValue, renderer)); >+ } >+ >+ String toString() final { return m_cssValue->cssText(); } >+ >+ CachedImage* image() { return m_cssValue->cachedImage(); } >+ const RenderElement* renderer() const { return m_renderer.get(); } >+ >+private: >+ TypedOMCSSImageValue(CSSImageValue& cssValue, RenderElement& renderer) >+ : m_cssValue(makeRef(cssValue)) >+ , m_renderer(makeWeakPtr(renderer)) >+ { >+ } >+ >+ bool isImageValue() final { return true; } >+ >+ Ref<CSSImageValue> m_cssValue; >+ WeakPtr<RenderElement> m_renderer; >+}; >+ >+} // namespace WebCore >+ >+#endif >diff --git a/Source/WebCore/css/typedom/TypedOMCSSImageValue.idl b/Source/WebCore/css/typedom/TypedOMCSSImageValue.idl >new file mode 100644 >index 0000000000000000000000000000000000000000..8cd78e40190446bd34fa87c7b3df78f0b2b31e99 >--- /dev/null >+++ b/Source/WebCore/css/typedom/TypedOMCSSImageValue.idl >@@ -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 { >+}; >diff --git a/Source/WebCore/css/typedom/TypedOMCSSNumericValue.h b/Source/WebCore/css/typedom/TypedOMCSSNumericValue.h >new file mode 100644 >index 0000000000000000000000000000000000000000..7e623a998620f015f96d67e5092add6a990c490a >--- /dev/null >+++ b/Source/WebCore/css/typedom/TypedOMCSSNumericValue.h >@@ -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 >diff --git a/Source/WebCore/css/typedom/TypedOMCSSNumericValue.idl b/Source/WebCore/css/typedom/TypedOMCSSNumericValue.idl >new file mode 100644 >index 0000000000000000000000000000000000000000..29bd21f1f693e0aff06ae92d9d22f536e3e70b9c >--- /dev/null >+++ b/Source/WebCore/css/typedom/TypedOMCSSNumericValue.idl >@@ -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 { >+}; >diff --git a/Source/WebCore/css/typedom/TypedOMCSSStyleValue.h b/Source/WebCore/css/typedom/TypedOMCSSStyleValue.h >new file mode 100644 >index 0000000000000000000000000000000000000000..3b61b145346f785b52b733d9aab0de607885d9a4 >--- /dev/null >+++ b/Source/WebCore/css/typedom/TypedOMCSSStyleValue.h >@@ -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 >diff --git a/Source/WebCore/css/typedom/TypedOMCSSStyleValue.idl b/Source/WebCore/css/typedom/TypedOMCSSStyleValue.idl >new file mode 100644 >index 0000000000000000000000000000000000000000..c379ce9bb01e6825939e009fe8e01869424c61c0 >--- /dev/null >+++ b/Source/WebCore/css/typedom/TypedOMCSSStyleValue.idl >@@ -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; >+}; >diff --git a/Source/WebCore/css/typedom/TypedOMCSSUnitValue.h b/Source/WebCore/css/typedom/TypedOMCSSUnitValue.h >new file mode 100644 >index 0000000000000000000000000000000000000000..bb15379791d8bdbcc6dbac1e9626349d41bbea51 >--- /dev/null >+++ b/Source/WebCore/css/typedom/TypedOMCSSUnitValue.h >@@ -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 >diff --git a/Source/WebCore/css/typedom/TypedOMCSSUnitValue.idl b/Source/WebCore/css/typedom/TypedOMCSSUnitValue.idl >new file mode 100644 >index 0000000000000000000000000000000000000000..6eccf3ed6c2ab62ee3f1d9e15b8552ba634d88a7 >--- /dev/null >+++ b/Source/WebCore/css/typedom/TypedOMCSSUnitValue.idl >@@ -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; >+}; >diff --git a/Source/WebCore/css/typedom/TypedOMCSSUnparsedValue.h b/Source/WebCore/css/typedom/TypedOMCSSUnparsedValue.h >new file mode 100644 >index 0000000000000000000000000000000000000000..61f87a75153fee70c67346d8dc070fa4e81ccb73 >--- /dev/null >+++ b/Source/WebCore/css/typedom/TypedOMCSSUnparsedValue.h >@@ -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 >diff --git a/Source/WebCore/css/typedom/TypedOMCSSUnparsedValue.idl b/Source/WebCore/css/typedom/TypedOMCSSUnparsedValue.idl >new file mode 100644 >index 0000000000000000000000000000000000000000..caf4c811e2e3163bd65a2129eecee37d14d1b6f3 >--- /dev/null >+++ b/Source/WebCore/css/typedom/TypedOMCSSUnparsedValue.idl >@@ -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 { >+}; >diff --git a/Source/WebCore/html/ImageBitmap.cpp b/Source/WebCore/html/ImageBitmap.cpp >index 7de346707ac84008cbc68b9b1b428769ed2d70dd..fb9d2d7c80132cc61a2b6ea61bc1a8c68159ae75 100644 >--- a/Source/WebCore/html/ImageBitmap.cpp >+++ b/Source/WebCore/html/ImageBitmap.cpp >@@ -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 @@ void ImageBitmap::createPromise(ScriptExecutionContext& scriptExecutionContext, > } > #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 >diff --git a/Source/WebCore/html/ImageBitmap.h b/Source/WebCore/html/ImageBitmap.h >index 1200b8781646f61a6f70c46b99bcc8efcf65ad1b..fa7419e5fcee758df7872e95848a6593bd1af5c2 100644 >--- a/Source/WebCore/html/ImageBitmap.h >+++ b/Source/WebCore/html/ImageBitmap.h >@@ -44,6 +44,7 @@ class IntRect; > class IntSize; > class PendingImageBitmap; > class ScriptExecutionContext; >+class TypedOMCSSImageValue; > struct ImageBitmapOptions; > > class ImageBitmap : public ScriptWrappable, public RefCounted<ImageBitmap> { >@@ -55,6 +56,9 @@ public: > #endif > RefPtr<HTMLCanvasElement>, > RefPtr<ImageBitmap>, >+#if ENABLE(CSS_PAINTING_API) >+ RefPtr<TypedOMCSSImageValue>, >+#endif > RefPtr<Blob>, > RefPtr<ImageData> > >; >@@ -98,6 +102,7 @@ private: > static void createPromise(ScriptExecutionContext&, RefPtr<ImageBitmap>&, ImageBitmapOptions&&, std::optional<IntRect>, Promise&&); > static void createPromise(ScriptExecutionContext&, RefPtr<Blob>&, ImageBitmapOptions&&, std::optional<IntRect>, Promise&&); > static void createPromise(ScriptExecutionContext&, RefPtr<ImageData>&, ImageBitmapOptions&&, std::optional<IntRect>, Promise&&); >+ static void createPromise(ScriptExecutionContext&, RefPtr<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; >diff --git a/Source/WebCore/html/canvas/CanvasDrawImage.idl b/Source/WebCore/html/canvas/CanvasDrawImage.idl >index cbcaf72413430f2cb6015071c93c911e584eec27..75e7f6e5569a9165690779711931ce6f962ad1c9 100644 >--- a/Source/WebCore/html/canvas/CanvasDrawImage.idl >+++ b/Source/WebCore/html/canvas/CanvasDrawImage.idl >@@ -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; >diff --git a/Source/WebCore/html/canvas/CanvasFillStrokeStyles.idl b/Source/WebCore/html/canvas/CanvasFillStrokeStyles.idl >index 5c2c40f6c94df424cc10c13409cc59ae5b26f0b2..e79e3ac4f8a7c8776a239e5baccc59b3f89744ae 100644 >--- a/Source/WebCore/html/canvas/CanvasFillStrokeStyles.idl >+++ b/Source/WebCore/html/canvas/CanvasFillStrokeStyles.idl >@@ -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; >diff --git a/Source/WebCore/html/canvas/CanvasRenderingContext.cpp b/Source/WebCore/html/canvas/CanvasRenderingContext.cpp >index 704b41ffbe71797ef865dd972c9e51591a6dffe7..79202b5beec74902b14596e35f8d6c1f86e6900d 100644 >--- a/Source/WebCore/html/canvas/CanvasRenderingContext.cpp >+++ b/Source/WebCore/html/canvas/CanvasRenderingContext.cpp >@@ -144,4 +144,9 @@ void CanvasRenderingContext::checkOrigin(const URL& url) > m_canvas.setOriginTainted(); > } > >+void CanvasRenderingContext::checkOrigin(const TypedOMCSSImageValue&) >+{ >+ m_canvas.setOriginTainted(); >+} >+ > } // namespace WebCore >diff --git a/Source/WebCore/html/canvas/CanvasRenderingContext.h b/Source/WebCore/html/canvas/CanvasRenderingContext.h >index 7af43fc814c9dd814d1c1c45f4ed6ac8ca1903c6..5172e2715c7c5b27de5d64d32cd9d1e5ec3ec7b3 100644 >--- a/Source/WebCore/html/canvas/CanvasRenderingContext.h >+++ b/Source/WebCore/html/canvas/CanvasRenderingContext.h >@@ -38,6 +38,7 @@ class HTMLCanvasElement; > class HTMLImageElement; > class HTMLVideoElement; > class ImageBitmap; >+class TypedOMCSSImageValue; > class WebGLObject; > > class CanvasRenderingContext : public ScriptWrappable { >@@ -88,6 +89,7 @@ protected: > m_canvas.setOriginTainted(); > } > void checkOrigin(const URL&); >+ void checkOrigin(const TypedOMCSSImageValue&); > > bool m_callTracingActive { false }; > >diff --git a/Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp b/Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp >index 88f35662d09b5b8228d3708eb7d2db9e653d7c1b..67ae1db9a637bbc1c1ef8d81478e5015a324b5ca 100644 >--- a/Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp >+++ b/Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp >@@ -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 @@ static inline FloatSize size(HTMLVideoElement& video) > > #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()), >@@ -1486,6 +1497,36 @@ ExceptionOr<void> CanvasRenderingContext2DBase::drawImage(HTMLImageElement& imag > } > > ExceptionOr<void> CanvasRenderingContext2DBase::drawImage(HTMLImageElement& imageElement, const FloatRect& srcRect, const FloatRect& dstRect, const CompositeOperator& op, const BlendMode& blendMode) >+{ >+ 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())) >@@ -1494,13 +1535,9 @@ ExceptionOr<void> CanvasRenderingContext2DBase::drawImage(HTMLImageElement& imag > 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 @@ ExceptionOr<void> CanvasRenderingContext2DBase::drawImage(HTMLImageElement& imag > 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 @@ ExceptionOr<void> CanvasRenderingContext2DBase::drawImage(HTMLImageElement& imag > } > > 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 @@ ExceptionOr<void> CanvasRenderingContext2DBase::drawImage(HTMLImageElement& imag > if (image->isSVGImage()) > image->setImageObserver(observer); > >- checkOrigin(&imageElement); >- > return { }; > } > >@@ -1984,6 +2018,14 @@ ExceptionOr<RefPtr<CanvasPattern>> CanvasRenderingContext2DBase::createPattern(I > 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); >diff --git a/Source/WebCore/html/canvas/CanvasRenderingContext2DBase.h b/Source/WebCore/html/canvas/CanvasRenderingContext2DBase.h >index ad538cd790b476ec3218a9216a6b56689e0b687d..b4ecce42328c822ad94612ed0ebc2ab4e024a02f 100644 >--- a/Source/WebCore/html/canvas/CanvasRenderingContext2DBase.h >+++ b/Source/WebCore/html/canvas/CanvasRenderingContext2DBase.h >@@ -50,6 +50,8 @@ > > namespace WebCore { > >+class TypedOMCSSImageValue; >+class CachedImage; > class CanvasBase; > class CanvasGradient; > class CanvasPattern; >@@ -62,11 +64,14 @@ class ImageBitmap; > 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,12 +326,19 @@ protected: > 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); > >diff --git a/Source/WebCore/inspector/InspectorCanvas.cpp b/Source/WebCore/inspector/InspectorCanvas.cpp >index ea710bcc0b7630bac2b94f6b3d0c71572989548c..540b7b4efd8feb109df4cc6aa72cb1d75b5449b1 100644 >--- a/Source/WebCore/inspector/InspectorCanvas.cpp >+++ b/Source/WebCore/inspector/InspectorCanvas.cpp >@@ -619,6 +619,9 @@ Ref<JSON::ArrayOf<JSON::Value>> InspectorCanvas::buildAction(const String& name, > [&] (const RefPtr<HTMLImageElement>& value) { addParameter(indexForData(value), RecordingSwizzleTypes::Image); }, > #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); }, >diff --git a/Source/WebCore/page/WindowOrWorkerGlobalScope.idl b/Source/WebCore/page/WindowOrWorkerGlobalScope.idl >index b258fb181ca0c32a3d57332a630961d470080da4..a3615a5a9bc4ef8882dcfc9b201891fa99cea1d9 100644 >--- a/Source/WebCore/page/WindowOrWorkerGlobalScope.idl >+++ b/Source/WebCore/page/WindowOrWorkerGlobalScope.idl >@@ -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; >diff --git a/Source/WebCore/platform/graphics/CustomPaintImage.cpp b/Source/WebCore/platform/graphics/CustomPaintImage.cpp >index ec482265770d175efae8e9cd2db62d651453a27c..fa90d9f1c98972ac3af0d05fcf11aa228a1158dc 100644 >--- a/Source/WebCore/platform/graphics/CustomPaintImage.cpp >+++ b/Source/WebCore/platform/graphics/CustomPaintImage.cpp >@@ -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 <JavaScriptCore/ConstructData.h> > > namespace WebCore { >@@ -82,7 +84,7 @@ ImageDrawResult CustomPaintImage::doCustomPaint(GraphicsContext& destContext, co > 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 @@ ImageDrawResult CustomPaintImage::doCustomPaint(GraphicsContext& destContext, co > } > > 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()); >diff --git a/Source/WebCore/platform/graphics/gpu/GPUSwapChain.h b/Source/WebCore/platform/graphics/gpu/GPUSwapChain.h >index 0d1d36d7dfb49a42578eeda41e72c331b766cf17..aa9ad267f4974f8798ece7e2a6d7751a478e0647 100644 >--- a/Source/WebCore/platform/graphics/gpu/GPUSwapChain.h >+++ b/Source/WebCore/platform/graphics/gpu/GPUSwapChain.h >@@ -27,6 +27,7 @@ > > #if ENABLE(WEBGPU) > >+#include "GPUTexture.h" > #include <wtf/RefPtr.h> > #include <wtf/RetainPtr.h> > >@@ -37,7 +38,6 @@ OBJC_PROTOCOL(CAMetalDrawable); > namespace WebCore { > > class GPUDevice; >-class GPUTexture; > > enum class GPUTextureFormatEnum; > >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 6cfaf20ae6eebd747e9d537f91fd5c3927ec5e2b..f7ed47af11c6464b57238e4f5db5e85f39ce37cd 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,16 @@ >+2018-11-29 Justin Michaud <justin_michaud@apple.com> >+ >+ CSS Painting API should allow image values in inputProperties >+ https://bugs.webkit.org/show_bug.cgi?id=192200 >+ >+ Reviewed by Dean Jackson. >+ >+ * fast/css-custom-paint/arguments-expected.html: Added. >+ * fast/css-custom-paint/arguments.html: Added. >+ * fast/css-custom-paint/image-expected.html: Added. >+ * fast/css-custom-paint/image.html: Added. >+ * fast/css-custom-paint/resources/test-image.png: Added. >+ > 2018-12-03 Simon Fraser <simon.fraser@apple.com> > > REGRESSION (r238090): position:fixed sidebar on https://www.w3.org/TR/SVG2/coords.html does not stay fixed >diff --git a/LayoutTests/fast/css-custom-paint/arguments-expected.html b/LayoutTests/fast/css-custom-paint/arguments-expected.html >new file mode 100644 >index 0000000000000000000000000000000000000000..f6c56a7988428c32f0cf4ea1fe80dc9dd75665c4 >--- /dev/null >+++ b/LayoutTests/fast/css-custom-paint/arguments-expected.html >@@ -0,0 +1,11 @@ >+<!DOCTYPE html> >+<style> >+ .paint { >+ width: 150px; >+ height: 150px; >+ } >+</style> >+ >+<body> >+ <div class="paint" style="background: green;"></div> >+</body> >diff --git a/LayoutTests/fast/css-custom-paint/arguments.html b/LayoutTests/fast/css-custom-paint/arguments.html >new file mode 100644 >index 0000000000000000000000000000000000000000..59f8376d51dd6d7ad6e6f661a2c1e29a4385d52b >--- /dev/null >+++ b/LayoutTests/fast/css-custom-paint/arguments.html >@@ -0,0 +1,37 @@ >+<!DOCTYPE html><!-- webkit-test-runner [ experimental:CSSPaintingAPIEnabled=true ] --> >+<meta name="author" title="Justin Michaud" href="mailto:justin_michaud@webkit.org"> >+<meta name="assert" content="Test that paint worklets parse arguments correctly"> >+<link rel="help" content="https://drafts.css-houdini.org/css-paint-api-1/"> >+<script src="resources/testharness.js"></script> >+ >+<script id="code" type="text/worklet"> >+class MyPaint { >+ static get inputArguments() { return Array(5).fill('*') } >+ paint(ctx, geom, props, args) { >+ // Note: This does not pass on Chrome. Chrome seems to strip the whitespace. >+ const expected = [" a", " url(\"\")", " (d)", "e", " f"]; >+ for (const i of expected.keys()) { >+ assert_equals(args[i].toString(), expected[i]); >+ } >+ ctx.fillStyle = "green"; >+ ctx.fillRect(0, 0, geom.width, geom.height); >+ } >+} >+registerPaint('my-paint', MyPaint); >+</script> >+ >+<script type="text/javascript"> >+importWorklet(CSS.paintWorklet, document.getElementById('code').textContent); >+</script> >+ >+<style> >+ .paint { >+ width: 150px; >+ height: 150px; >+ background: paint(my-paint, a, url(''), (d),e, f); >+ } >+</style> >+ >+<body> >+ <div class="paint"></div> >+</body> >diff --git a/LayoutTests/fast/css-custom-paint/image-expected.html b/LayoutTests/fast/css-custom-paint/image-expected.html >new file mode 100644 >index 0000000000000000000000000000000000000000..7854b5a36533e67842498cc7644f27a100022eb4 >--- /dev/null >+++ b/LayoutTests/fast/css-custom-paint/image-expected.html >@@ -0,0 +1,21 @@ >+<!DOCTYPE html> >+<style> >+ #paint { >+ width: 150px; >+ height: 150px; >+ border: none; >+ background: url('resources/test-image.png'); >+ background-size: 150px 150px; >+ } >+</style> >+ >+<body> >+ <div id="paint"></div> >+ <div style="width: 10px; height: 200px; position: absolute; top: 0; left: 2px; background: black"></div> >+ <div style="width: 10px; height: 200px; position: absolute; top: 0; left: 155px; background: black"></div> >+ <div style="width: 10px; height: 200px; position: absolute; top: 0; left: 80px; background: black"></div> >+ <div style="width: 200px; height: 10px; position: absolute; top: 2px; left: 0; background: black"></div> >+ <div style="width: 200px; height: 10px; position: absolute; top: 155px; left: 0; background: black"></div> >+ <div style="width: 200px; height: 10px; position: absolute; top: 30px; left: 0; background: black"></div> >+ <div style="width: 200px; height: 10px; position: absolute; top: 120px; left: 0; background: black"></div> >+</body> >diff --git a/LayoutTests/fast/css-custom-paint/image.html b/LayoutTests/fast/css-custom-paint/image.html >new file mode 100644 >index 0000000000000000000000000000000000000000..97d7550f83526747c348b55246f43bb932b9474a >--- /dev/null >+++ b/LayoutTests/fast/css-custom-paint/image.html >@@ -0,0 +1,40 @@ >+<!DOCTYPE html><!-- webkit-test-runner [ experimental:CSSPaintingAPIEnabled=true ] --> >+<meta name="author" title="Justin Michaud" href="mailto:justin_michaud@webkit.org"> >+<meta name="assert" content="Test that paint worklets do not crash if the constructor throws"> >+<link rel="help" content="https://drafts.css-houdini.org/css-paint-api-1/"> >+<script src="resources/testharness.js"></script> >+ >+<script id="code" type="text/worklet"> >+ class MyPaint { >+ static get inputProperties() { return ['border-image-source']; } >+ paint(ctx, geom, properties) { >+ ctx.drawImage(properties.get('border-image-source'), 0, 0, geom.width, geom.height); >+ } >+ } >+ registerPaint('my-paint', MyPaint); >+</script> >+ >+<script type="text/javascript"> >+ importWorklet(CSS.paintWorklet, document.getElementById('code').textContent); >+</script> >+ >+<style> >+ #paint { >+ width: 150px; >+ height: 150px; >+ border: 0px solid black; >+ border-image-source: url('resources/test-image.png'); >+ background: paint(my-paint); >+ } >+</style> >+ >+<body> >+ <div id="paint"></div> >+ <div style="width: 10px; height: 200px; position: absolute; top: 0; left: 2px; background: black"></div> >+ <div style="width: 10px; height: 200px; position: absolute; top: 0; left: 155px; background: black"></div> >+ <div style="width: 10px; height: 200px; position: absolute; top: 0; left: 80px; background: black"></div> >+ <div style="width: 200px; height: 10px; position: absolute; top: 2px; left: 0; background: black"></div> >+ <div style="width: 200px; height: 10px; position: absolute; top: 155px; left: 0; background: black"></div> >+ <div style="width: 200px; height: 10px; position: absolute; top: 30px; left: 0; background: black"></div> >+ <div style="width: 200px; height: 10px; position: absolute; top: 120px; left: 0; background: black"></div> >+</body> >diff --git a/LayoutTests/fast/css-custom-paint/resources/test-image.png b/LayoutTests/fast/css-custom-paint/resources/test-image.png >new file mode 100644 >index 0000000000000000000000000000000000000000..df667c4e3ed6bce61afd2d9f0e33df112250bc32 >GIT binary patch >literal 1898 >zcmeAS@N?(olHy`uVBq!ia0y~yU}|7sV65R_1B%3#a@}EIU^n!1aSW-L^Y+F@UdKcU >zw}=0`q84p$I45M)srhEHS>q)xvklFRDq;$W-PQBbTfS%e?R)vdrk0Jte*4+fO)LiG >z+~RBu8G=A#4VeTO6x<k?7>;l_Ff>Roaxe%eGcYnFu_!P&^f0h6bc{4bGnO_p|Jf_| >zexvPs`)3T#&asb%&u9`E%_XA+1=Y*Sw3iPU>R;c@y2F3{q|AXkKSv8;8r4GqM#p|I >Z-HPH}({k0M5LkyYc)I$ztaD0e0sxw`DM<hT > >literal 0 >HcmV?d00001 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 192200
:
356091
|
356111
|
356114
|
356120
|
356135
|
356456
| 356459 |
356480