Changeset 238872 in webkit
- Timestamp:
- Dec 4, 2018 12:25:02 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 5 added
- 26 edited
- 2 copied
- 9 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r238860 r238872 1 2018-12-04 Justin Michaud <justin_michaud@apple.com> 2 3 CSS Painting API should allow image values in inputProperties 4 https://bugs.webkit.org/show_bug.cgi?id=192200 5 6 Reviewed by Dean Jackson. 7 8 * fast/css-custom-paint/arguments-expected.html: Added. 9 * fast/css-custom-paint/arguments.html: Added. 10 * fast/css-custom-paint/image-expected.html: Added. 11 * fast/css-custom-paint/image.html: Added. 12 * fast/css-custom-paint/resources/test-image.png: Added. 13 1 14 2018-12-04 Ryan Haddad <ryanhaddad@apple.com> 2 15 -
trunk/Source/WebCore/CMakeLists.txt
r238741 r238872 594 594 css/StyleSheetList.idl 595 595 596 css/typedom/CSSNumericValue.idl 597 css/typedom/CSSStyleValue.idl 598 css/typedom/CSSUnitValue.idl 599 css/typedom/CSSUnparsedValue.idl 596 css/typedom/TypedOMCSSImageValue.idl 597 css/typedom/TypedOMCSSNumericValue.idl 598 css/typedom/TypedOMCSSStyleValue.idl 599 css/typedom/TypedOMCSSUnitValue.idl 600 css/typedom/TypedOMCSSUnparsedValue.idl 600 601 css/typedom/StylePropertyMapReadOnly.idl 601 602 -
trunk/Source/WebCore/ChangeLog
r238867 r238872 1 2018-12-04 Justin Michaud <justin_michaud@apple.com> 2 3 CSS Painting API should allow image values in inputProperties 4 https://bugs.webkit.org/show_bug.cgi?id=192200 5 6 Reviewed by Dean Jackson. 7 8 Adds new TypedOMCSSImageValue wrapper. We rename all the existing ones so that the naming is consistent (CSSImageValue is already a thing). 9 Finally, we let CanvasRenderingContext2DBase render these. 10 11 Tests: fast/css-custom-paint/arguments.html 12 fast/css-custom-paint/image.html 13 14 * CMakeLists.txt: 15 * DerivedSources.make: 16 * Sources.txt: 17 * WebCore.xcodeproj/project.pbxproj: 18 * bindings/js/CallTracerTypes.h: 19 * bindings/js/JSTypedOMCSSStyleValueCustom.cpp: Renamed from Source/WebCore/bindings/js/JSCSSStyleValueCustom.cpp. 20 (WebCore::toJSNewlyCreated): 21 (WebCore::toJS): 22 * bindings/js/WebCoreBuiltinNames.h: 23 * css/CSSComputedStyleDeclaration.cpp: 24 (WebCore::ComputedStyleExtractor::customPropertyValue): 25 * css/CSSCustomPropertyValue.cpp: 26 (WebCore::CSSCustomPropertyValue::equals const): 27 (WebCore::CSSCustomPropertyValue::customCSSText const): 28 (WebCore::CSSCustomPropertyValue::tokens const): 29 * css/CSSCustomPropertyValue.h: 30 * css/CSSPaintImageValue.cpp: 31 (WebCore::CSSPaintImageValue::image): 32 * css/typedom/StylePropertyMapReadOnly.h: 33 (WebCore::StylePropertyMapReadOnly::create): 34 (WebCore::StylePropertyMapReadOnly::get const): 35 (WebCore::StylePropertyMapReadOnly::StylePropertyMapReadOnly): 36 * css/typedom/StylePropertyMapReadOnly.idl: 37 * css/typedom/TypedOMCSSImageValue.h: Copied from Source/WebCore/css/typedom/CSSUnitValue.h. 38 * css/typedom/TypedOMCSSImageValue.idl: Copied from Source/WebCore/css/typedom/CSSStyleValue.idl. 39 * css/typedom/TypedOMCSSNumericValue.h: Renamed from Source/WebCore/css/typedom/CSSNumericValue.h. 40 * css/typedom/TypedOMCSSNumericValue.idl: Renamed from Source/WebCore/css/typedom/CSSNumericValue.idl. 41 * css/typedom/TypedOMCSSStyleValue.h: Renamed from Source/WebCore/css/typedom/CSSStyleValue.h. 42 (WebCore::TypedOMCSSStyleValue::isImageValue): 43 * css/typedom/TypedOMCSSStyleValue.idl: Renamed from Source/WebCore/css/typedom/CSSStyleValue.idl. 44 * css/typedom/TypedOMCSSUnitValue.h: Renamed from Source/WebCore/css/typedom/CSSUnitValue.h. 45 * css/typedom/TypedOMCSSUnitValue.idl: Renamed from Source/WebCore/css/typedom/CSSUnitValue.idl. 46 * css/typedom/TypedOMCSSUnparsedValue.h: Renamed from Source/WebCore/css/typedom/CSSUnparsedValue.h. 47 * css/typedom/TypedOMCSSUnparsedValue.idl: Renamed from Source/WebCore/css/typedom/CSSUnparsedValue.idl. 48 * html/ImageBitmap.cpp: 49 (WebCore::ImageBitmap::createPromise): 50 * html/ImageBitmap.h: 51 * html/canvas/CanvasDrawImage.idl: 52 * html/canvas/CanvasFillStrokeStyles.idl: 53 * html/canvas/CanvasRenderingContext.cpp: 54 (WebCore::CanvasRenderingContext::checkOrigin): 55 * html/canvas/CanvasRenderingContext.h: 56 * html/canvas/CanvasRenderingContext2DBase.cpp: 57 (WebCore::size): 58 (WebCore::CanvasRenderingContext2DBase::drawImage): 59 (WebCore::CanvasRenderingContext2DBase::createPattern): 60 * html/canvas/CanvasRenderingContext2DBase.h: 61 * inspector/InspectorCanvas.cpp: 62 (WebCore::InspectorCanvas::buildAction): 63 * page/WindowOrWorkerGlobalScope.idl: 64 * platform/graphics/CustomPaintImage.cpp: 65 (WebCore::CustomPaintImage::doCustomPaint): 66 1 67 2018-12-04 Chris Dumez <cdumez@apple.com> 2 68 -
trunk/Source/WebCore/DerivedSources.make
r238741 r238872 503 503 $(WebCore)/css/StyleSheet.idl \ 504 504 $(WebCore)/css/StyleSheetList.idl \ 505 $(WebCore)/css/typedom/CSSNumericValue.idl \506 $(WebCore)/css/typedom/CSSStyleValue.idl \507 $(WebCore)/css/typedom/CSSUnitValue.idl \508 $(WebCore)/css/typedom/CSSUnparsedValue.idl \509 505 $(WebCore)/css/typedom/StylePropertyMapReadOnly.idl \ 506 $(WebCore)/css/typedom/TypedOMCSSImageValue.idl \ 507 $(WebCore)/css/typedom/TypedOMCSSNumericValue.idl \ 508 $(WebCore)/css/typedom/TypedOMCSSStyleValue.idl \ 509 $(WebCore)/css/typedom/TypedOMCSSUnitValue.idl \ 510 $(WebCore)/css/typedom/TypedOMCSSUnparsedValue.idl \ 510 511 $(WebCore)/css/WebKitCSSMatrix.idl \ 511 512 $(WebCore)/css/WebKitCSSViewportRule.idl \ -
trunk/Source/WebCore/Sources.txt
r238771 r238872 389 389 bindings/js/JSCSSRuleListCustom.cpp 390 390 bindings/js/JSCSSStyleDeclarationCustom.cpp 391 bindings/js/JSCSSStyleValueCustom.cpp392 391 bindings/js/JSDOMConvertDate.cpp 393 392 bindings/js/JSDOMConvertNumbers.cpp … … 479 478 bindings/js/JSTrackCustom.cpp 480 479 bindings/js/JSTreeWalkerCustom.cpp 480 bindings/js/JSTypedOMCSSStyleValueCustom.cpp 481 481 bindings/js/JSVideoTrackCustom.cpp 482 482 bindings/js/JSVideoTrackListCustom.cpp … … 2502 2502 JSCDATASection.cpp 2503 2503 JSCSSFontFaceRule.cpp 2504 JSTypedOMCSSImageValue.cpp 2505 JSTypedOMCSSNumericValue.cpp 2506 JSTypedOMCSSStyleValue.cpp 2507 JSTypedOMCSSUnitValue.cpp 2508 JSTypedOMCSSUnparsedValue.cpp 2504 2509 JSCSSImportRule.cpp 2505 2510 JSCSSKeyframeRule.cpp … … 2507 2512 JSCSSMediaRule.cpp 2508 2513 JSCSSNamespaceRule.cpp 2509 JSCSSNumericValue.cpp2510 2514 JSCSSPaintCallback.cpp 2511 2515 JSCSSPaintSize.cpp 2512 JSCSSStyleValue.cpp2513 JSCSSUnitValue.cpp2514 JSCSSUnparsedValue.cpp2515 2516 JSPaintWorkletGlobalScope.cpp 2516 2517 JSWorklet.cpp -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r238844 r238872 1368 1368 4B3043CD0AE0373B00A82647 /* Editor.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B3043CB0AE0373B00A82647 /* Editor.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1369 1369 4B3480940EEF50D400AC1B41 /* ImageSourceCG.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B3480920EEF50D400AC1B41 /* ImageSourceCG.h */; }; 1370 4B438650219CD56100F8D3C5 /* TypedOMCSSImageValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B43864F219CD56100F8D3C5 /* TypedOMCSSImageValue.h */; }; 1370 1371 4B5BDD9B21658A1500DD4262 /* CSSPaintCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B5BDD9A21658A1500DD4262 /* CSSPaintCallback.h */; }; 1371 1372 4B6B5CBD21640EFF00603817 /* DOMCSSPaintWorklet.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B6B5CB82163EC0700603817 /* DOMCSSPaintWorklet.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 1378 1379 4BAFD0CB2190EBD600C0AB64 /* CSSPaintSize.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BAFD0CA2190EBD600C0AB64 /* CSSPaintSize.h */; }; 1379 1380 4BAFD0CF2190F9B500C0AB64 /* StylePropertyMapReadOnly.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BAFD0CE2190F9B400C0AB64 /* StylePropertyMapReadOnly.h */; }; 1380 4BAFD0D62192146B00C0AB64 /* CSSStyleValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BAFD0D52192146B00C0AB64 /*CSSStyleValue.h */; };1381 4BAFD0D921921EA000C0AB64 /* CSSUnparsedValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BAFD0D821921EA000C0AB64 /*CSSUnparsedValue.h */; };1382 4BAFD0E0219220AB00C0AB64 /* CSSNumericValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BAFD0DF219220AB00C0AB64 /*CSSNumericValue.h */; };1383 4BAFD0E1219242A000C0AB64 /* CSSUnitValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BAFD0DD2192209200C0AB64 /*CSSUnitValue.h */; };1381 4BAFD0D62192146B00C0AB64 /* TypedOMCSSStyleValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BAFD0D52192146B00C0AB64 /* TypedOMCSSStyleValue.h */; }; 1382 4BAFD0D921921EA000C0AB64 /* TypedOMCSSUnparsedValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BAFD0D821921EA000C0AB64 /* TypedOMCSSUnparsedValue.h */; }; 1383 4BAFD0E0219220AB00C0AB64 /* TypedOMCSSNumericValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BAFD0DF219220AB00C0AB64 /* TypedOMCSSNumericValue.h */; }; 1384 4BAFD0E1219242A000C0AB64 /* TypedOMCSSUnitValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BAFD0DD2192209200C0AB64 /* TypedOMCSSUnitValue.h */; }; 1384 1385 4BDA3FFE2151B6F500FD6604 /* DOMCSSCustomPropertyDescriptor.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BDA3FF82151B6F200FD6604 /* DOMCSSCustomPropertyDescriptor.h */; }; 1385 1386 4BDA3FFF2151B6F500FD6604 /* DOMCSSRegisterCustomProperty.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BDA3FF92151B6F300FD6604 /* DOMCSSRegisterCustomProperty.h */; }; … … 7884 7885 4B3480910EEF50D400AC1B41 /* ImageSourceCGMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ImageSourceCGMac.mm; sourceTree = "<group>"; }; 7885 7886 4B3480920EEF50D400AC1B41 /* ImageSourceCG.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageSourceCG.h; sourceTree = "<group>"; }; 7887 4B43864D219CD52D00F8D3C5 /* TypedOMCSSImageValue.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = TypedOMCSSImageValue.idl; sourceTree = "<group>"; }; 7888 4B43864F219CD56100F8D3C5 /* TypedOMCSSImageValue.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TypedOMCSSImageValue.h; sourceTree = "<group>"; }; 7886 7889 4B5BDD99216588E500DD4262 /* CSSPaintCallback.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = CSSPaintCallback.idl; sourceTree = "<group>"; }; 7887 7890 4B5BDD9A21658A1500DD4262 /* CSSPaintCallback.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CSSPaintCallback.h; sourceTree = "<group>"; }; … … 7906 7909 4BAFD0CE2190F9B400C0AB64 /* StylePropertyMapReadOnly.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = StylePropertyMapReadOnly.h; sourceTree = "<group>"; }; 7907 7910 4BAFD0D02190F9C200C0AB64 /* StylePropertyMapReadOnly.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = StylePropertyMapReadOnly.idl; sourceTree = "<group>"; }; 7908 4BAFD0D32192145600C0AB64 /* CSSStyleValue.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path =CSSStyleValue.idl; sourceTree = "<group>"; };7909 4BAFD0D52192146B00C0AB64 /* CSSStyleValue.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path =CSSStyleValue.h; sourceTree = "<group>"; };7910 4BAFD0D721921E7900C0AB64 /* CSSUnparsedValue.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path =CSSUnparsedValue.idl; sourceTree = "<group>"; };7911 4BAFD0D821921EA000C0AB64 /* CSSUnparsedValue.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path =CSSUnparsedValue.h; sourceTree = "<group>"; };7912 4BAFD0DB2192202200C0AB64 /* CSSNumericValue.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path =CSSNumericValue.idl; sourceTree = "<group>"; };7913 4BAFD0DC2192204A00C0AB64 /* CSSUnitValue.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path =CSSUnitValue.idl; sourceTree = "<group>"; };7914 4BAFD0DD2192209200C0AB64 /* CSSUnitValue.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; path =CSSUnitValue.h; sourceTree = "<group>"; };7915 4BAFD0DF219220AB00C0AB64 /* CSSNumericValue.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path =CSSNumericValue.h; sourceTree = "<group>"; };7916 4BAFD0E22192604D00C0AB64 /* JS CSSStyleValueCustom.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = JSCSSStyleValueCustom.cpp; sourceTree = "<group>"; };7911 4BAFD0D32192145600C0AB64 /* TypedOMCSSStyleValue.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = TypedOMCSSStyleValue.idl; sourceTree = "<group>"; }; 7912 4BAFD0D52192146B00C0AB64 /* TypedOMCSSStyleValue.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TypedOMCSSStyleValue.h; sourceTree = "<group>"; }; 7913 4BAFD0D721921E7900C0AB64 /* TypedOMCSSUnparsedValue.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = TypedOMCSSUnparsedValue.idl; sourceTree = "<group>"; }; 7914 4BAFD0D821921EA000C0AB64 /* TypedOMCSSUnparsedValue.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TypedOMCSSUnparsedValue.h; sourceTree = "<group>"; }; 7915 4BAFD0DB2192202200C0AB64 /* TypedOMCSSNumericValue.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = TypedOMCSSNumericValue.idl; sourceTree = "<group>"; }; 7916 4BAFD0DC2192204A00C0AB64 /* TypedOMCSSUnitValue.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = TypedOMCSSUnitValue.idl; sourceTree = "<group>"; }; 7917 4BAFD0DD2192209200C0AB64 /* TypedOMCSSUnitValue.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; path = TypedOMCSSUnitValue.h; sourceTree = "<group>"; }; 7918 4BAFD0DF219220AB00C0AB64 /* TypedOMCSSNumericValue.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TypedOMCSSNumericValue.h; sourceTree = "<group>"; }; 7919 4BAFD0E22192604D00C0AB64 /* JSTypedOMCSSStyleValueCustom.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = JSTypedOMCSSStyleValueCustom.cpp; sourceTree = "<group>"; }; 7917 7920 4BDA3FF52151B6F000FD6604 /* DOMCSSRegisterCustomProperty.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DOMCSSRegisterCustomProperty.idl; sourceTree = "<group>"; }; 7918 7921 4BDA3FF72151B6F100FD6604 /* DOMCSSRegisterCustomProperty.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMCSSRegisterCustomProperty.cpp; sourceTree = "<group>"; }; … … 18108 18111 isa = PBXGroup; 18109 18112 children = ( 18110 4BAFD0DF219220AB00C0AB64 /* CSSNumericValue.h */,18111 4BAFD0DB2192202200C0AB64 /* CSSNumericValue.idl */,18112 4BAFD0D52192146B00C0AB64 /* CSSStyleValue.h */,18113 4BAFD0D32192145600C0AB64 /* CSSStyleValue.idl */,18114 4BAFD0DD2192209200C0AB64 /* CSSUnitValue.h */,18115 4BAFD0DC2192204A00C0AB64 /* CSSUnitValue.idl */,18116 4BAFD0D821921EA000C0AB64 /* CSSUnparsedValue.h */,18117 4BAFD0D721921E7900C0AB64 /* CSSUnparsedValue.idl */,18118 18113 4BAFD0CE2190F9B400C0AB64 /* StylePropertyMapReadOnly.h */, 18119 18114 4BAFD0D02190F9C200C0AB64 /* StylePropertyMapReadOnly.idl */, 18115 4B43864F219CD56100F8D3C5 /* TypedOMCSSImageValue.h */, 18116 4B43864D219CD52D00F8D3C5 /* TypedOMCSSImageValue.idl */, 18117 4BAFD0DF219220AB00C0AB64 /* TypedOMCSSNumericValue.h */, 18118 4BAFD0DB2192202200C0AB64 /* TypedOMCSSNumericValue.idl */, 18119 4BAFD0D52192146B00C0AB64 /* TypedOMCSSStyleValue.h */, 18120 4BAFD0D32192145600C0AB64 /* TypedOMCSSStyleValue.idl */, 18121 4BAFD0DD2192209200C0AB64 /* TypedOMCSSUnitValue.h */, 18122 4BAFD0DC2192204A00C0AB64 /* TypedOMCSSUnitValue.idl */, 18123 4BAFD0D821921EA000C0AB64 /* TypedOMCSSUnparsedValue.h */, 18124 4BAFD0D721921E7900C0AB64 /* TypedOMCSSUnparsedValue.idl */, 18120 18125 ); 18121 18126 path = typedom; … … 20324 20329 BC5825F20C0B89380053F1B5 /* JSCSSStyleDeclarationCustom.cpp */, 20325 20330 AD726FEA16D9F40B003A4E6D /* JSCSSStyleDeclarationCustom.h */, 20326 4BAFD0E22192604D00C0AB64 /* JSCSSStyleValueCustom.cpp */,20327 20331 BC20FB7E0C0E8E6C00D1447F /* JSDeprecatedCSSOMValueCustom.cpp */, 20328 20332 49C7BA8C1042F5B10009D447 /* JSDocumentCustom.cpp */, … … 20377 20381 07846384145B1B8E00A58DF1 /* JSTrackCustom.h */, 20378 20382 516BB7920CE91E6800512F79 /* JSTreeWalkerCustom.cpp */, 20383 4BAFD0E22192604D00C0AB64 /* JSTypedOMCSSStyleValueCustom.cpp */, 20379 20384 BE6DF708171CA2C500DD52B8 /* JSVideoTrackCustom.cpp */, 20380 20385 BE6DF70A171CA2C500DD52B8 /* JSVideoTrackListCustom.cpp */, … … 28237 28242 314BE3A11B30F6B700141982 /* CSSNamedImageValue.h in Headers */, 28238 28243 94E839511DFB2A0E007BC6A7 /* CSSNamespaceRule.h in Headers */, 28239 4BAFD0E0219220AB00C0AB64 /* CSSNumericValue.h in Headers */,28240 28244 A80E6D000A1989CA007FB8C5 /* CSSPageRule.h in Headers */, 28241 28245 4B5BDD9B21658A1500DD4262 /* CSSPaintCallback.h in Headers */, … … 28279 28283 A80E6D0C0A1989CA007FB8C5 /* CSSStyleRule.h in Headers */, 28280 28284 A8EA80070A19516E00A8EF5F /* CSSStyleSheet.h in Headers */, 28281 4BAFD0D62192146B00C0AB64 /* CSSStyleValue.h in Headers */,28282 28285 94DE5C921D83011D00164F2A /* CSSSupportsParser.h in Headers */, 28283 28286 FC54D05716A7673100575E4D /* CSSSupportsRule.h in Headers */, … … 28289 28292 715AD7212050513F00D592DC /* CSSTransition.h in Headers */, 28290 28293 371F53E90D2704F900ECE0D5 /* CSSUnicodeRangeValue.h in Headers */, 28291 4BAFD0E1219242A000C0AB64 /* CSSUnitValue.h in Headers */,28292 28294 DD7CDF250A23CF9800069928 /* CSSUnknownRule.h in Headers */, 28293 4BAFD0D921921EA000C0AB64 /* CSSUnparsedValue.h in Headers */,28294 28295 BC7D8FF01BD03B6400FFE540 /* CSSUnsetValue.h in Headers */, 28295 28296 A80E6CEE0A1989CA007FB8C5 /* CSSValue.h in Headers */, … … 31494 31495 C375D7FE16639519006184AB /* TypeAhead.h in Headers */, 31495 31496 E46A2B1C17CA65B9000DBCD8 /* TypedElementDescendantIterator.h in Headers */, 31497 4B438650219CD56100F8D3C5 /* TypedOMCSSImageValue.h in Headers */, 31498 4BAFD0E0219220AB00C0AB64 /* TypedOMCSSNumericValue.h in Headers */, 31499 4BAFD0D62192146B00C0AB64 /* TypedOMCSSStyleValue.h in Headers */, 31500 4BAFD0E1219242A000C0AB64 /* TypedOMCSSUnitValue.h in Headers */, 31501 4BAFD0D921921EA000C0AB64 /* TypedOMCSSUnparsedValue.h in Headers */, 31496 31502 93309E1A099E64920056E581 /* TypingCommand.h in Headers */, 31497 31503 85031B4E0A44EFC700F992E0 /* UIEvent.h in Headers */, -
trunk/Source/WebCore/bindings/js/CallTracerTypes.h
r228218 r238872 37 37 #include "ImageData.h" 38 38 #include "Path2D.h" 39 #include "TypedOMCSSImageValue.h" 39 40 #include <JavaScriptCore/ArrayBuffer.h> 40 41 #include <JavaScriptCore/ArrayBufferView.h> … … 92 93 #endif 93 94 RefPtr<ImageBitmap>, 95 #if ENABLE(CSS_PAINTING_API) 96 RefPtr<TypedOMCSSImageValue>, 97 #endif 94 98 RefPtr<ImageData>, 95 99 RefPtr<Int32Array>, -
trunk/Source/WebCore/bindings/js/JSTypedOMCSSStyleValueCustom.cpp
r238871 r238872 25 25 26 26 #include "config.h" 27 #include "JS CSSStyleValue.h"27 #include "JSTypedOMCSSStyleValue.h" 28 28 29 29 #if ENABLE(CSS_PAINTING_API) 30 30 31 #include "JSCSSUnitValue.h" 32 #include "JSCSSUnparsedValue.h" 31 #include "JSTypedOMCSSImageValue.h" 32 #include "JSTypedOMCSSUnitValue.h" 33 #include "JSTypedOMCSSUnparsedValue.h" 33 34 34 35 namespace WebCore { 35 36 using namespace JSC; 36 37 37 JSValue toJSNewlyCreated(ExecState*, JSDOMGlobalObject* globalObject, Ref< CSSStyleValue>&& value)38 JSValue toJSNewlyCreated(ExecState*, JSDOMGlobalObject* globalObject, Ref<TypedOMCSSStyleValue>&& value) 38 39 { 39 40 if (value->isUnitValue()) 40 return createWrapper< CSSUnitValue>(globalObject, WTFMove(value));41 return createWrapper<TypedOMCSSUnitValue>(globalObject, WTFMove(value)); 41 42 if (value->isUnparsedValue()) 42 return createWrapper<CSSUnparsedValue>(globalObject, WTFMove(value)); 43 return createWrapper<TypedOMCSSUnparsedValue>(globalObject, WTFMove(value)); 44 if (value->isImageValue()) 45 return createWrapper<TypedOMCSSImageValue>(globalObject, WTFMove(value)); 43 46 44 47 ASSERT_NOT_REACHED(); 45 return createWrapper< CSSStyleValue>(globalObject, WTFMove(value));48 return createWrapper<TypedOMCSSStyleValue>(globalObject, WTFMove(value)); 46 49 } 47 50 48 JSValue toJS(ExecState* state, JSDOMGlobalObject* globalObject, CSSStyleValue& object)51 JSValue toJS(ExecState* state, JSDOMGlobalObject* globalObject, TypedOMCSSStyleValue& object) 49 52 { 50 53 return wrap(state, globalObject, object); -
trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h
r238739 r238872 59 59 macro(CredentialsContainer) \ 60 60 macro(CSSAnimation) \ 61 macro(CSSImageValue) \ 61 62 macro(CSSNumericValue) \ 62 63 macro(CSSPaintSize) \ -
trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
r238262 r238872 2639 2639 return nullptr; 2640 2640 2641 auto visitor = WTF::makeVisitor([&](const Ref<CSSVariableReferenceValue>&) {2641 return WTF::switchOn(value->value(), [&](const Ref<CSSVariableReferenceValue>&) { 2642 2642 ASSERT_NOT_REACHED(); 2643 2643 return RefPtr<CSSValue>(); … … 2648 2648 }, [&](const Length& value) { 2649 2649 return zoomAdjustedPixelValueForLength(value, *style); 2650 }, [&](const Ref<StyleImage>&) { 2651 return CSSCustomPropertyValue::create(*value); 2650 2652 }); 2651 return WTF::visit(visitor, value->value());2652 2653 } 2653 2654 -
trunk/Source/WebCore/css/CSSCustomPropertyValue.cpp
r237697 r238872 34 34 if (m_name != other.m_name || m_value.index() != other.m_value.index()) 35 35 return false; 36 auto visitor = WTF::makeVisitor([&](const Ref<CSSVariableReferenceValue>& value) {36 return WTF::switchOn(m_value, [&](const Ref<CSSVariableReferenceValue>& value) { 37 37 return value.get() == WTF::get<Ref<CSSVariableReferenceValue>>(other.m_value).get(); 38 38 }, [&](const CSSValueID& value) { … … 42 42 }, [&](const Length& value) { 43 43 return value == WTF::get<Length>(other.m_value); 44 }, [&](const Ref<StyleImage>& value) { 45 return value.get() == WTF::get<Ref<StyleImage>>(other.m_value).get(); 44 46 }); 45 return WTF::visit(visitor, m_value);46 47 } 47 48 … … 51 52 m_serialized = true; 52 53 53 auto visitor = WTF::makeVisitor([&](const Ref<CSSVariableReferenceValue>& value) {54 WTF::switchOn(m_value, [&](const Ref<CSSVariableReferenceValue>& value) { 54 55 m_stringValue = value->cssText(); 55 56 }, [&](const CSSValueID& value) { … … 59 60 }, [&](const Length& value) { 60 61 m_stringValue = CSSPrimitiveValue::create(value.value(), CSSPrimitiveValue::CSS_PX)->cssText(); 62 }, [&](const Ref<StyleImage>& value) { 63 m_stringValue = value->cssValue()->cssText(); 61 64 }); 62 WTF::visit(visitor, m_value);63 65 } 64 66 return m_stringValue; … … 69 71 Vector<CSSParserToken> result; 70 72 71 auto visitor = WTF::makeVisitor([&](const Ref<CSSVariableReferenceValue>&) {73 WTF::switchOn(m_value, [&](const Ref<CSSVariableReferenceValue>&) { 72 74 ASSERT_NOT_REACHED(); 73 75 }, [&](const CSSValueID&) { … … 81 83 while (!tokenizerRange.atEnd()) 82 84 result.append(tokenizerRange.consume()); 85 }, [&](const Ref<StyleImage>&) { 86 CSSTokenizer tokenizer(cssText()); 87 88 auto tokenizerRange = tokenizer.tokenRange(); 89 while (!tokenizerRange.atEnd()) 90 result.append(tokenizerRange.consume()); 83 91 }); 84 WTF::visit(visitor, m_value);85 92 86 93 return result; -
trunk/Source/WebCore/css/CSSCustomPropertyValue.h
r237697 r238872 30 30 #include "CSSVariableReferenceValue.h" 31 31 #include "Length.h" 32 #include "StyleImage.h" 32 33 #include <wtf/RefPtr.h> 33 34 #include <wtf/Variant.h> … … 42 43 class CSSCustomPropertyValue final : public CSSValue { 43 44 public: 44 using VariantValue = Variant<Ref<CSSVariableReferenceValue>, CSSValueID, Ref<CSSVariableData>, Length >;45 using VariantValue = Variant<Ref<CSSVariableReferenceValue>, CSSValueID, Ref<CSSVariableData>, Length, Ref<StyleImage>>; 45 46 46 47 static Ref<CSSCustomPropertyValue> createUnresolved(const AtomicString& name, Ref<CSSVariableReferenceValue>&& value) … … 66 67 67 68 static Ref<CSSCustomPropertyValue> createSyntaxLength(const AtomicString& name, Length value) 69 { 70 return adoptRef(*new CSSCustomPropertyValue(name, { WTFMove(value) })); 71 } 72 73 static Ref<CSSCustomPropertyValue> createSyntaxImage(const AtomicString& name, Ref<StyleImage>&& value) 68 74 { 69 75 return adoptRef(*new CSSCustomPropertyValue(name, { WTFMove(value) })); … … 112 118 }, [&](const Length& value) { 113 119 m_value = value; 120 }, [&](const Ref<StyleImage>& value) { 121 m_value = value.copyRef(); 114 122 }); 115 123 WTF::visit(visitor, other.m_value); -
trunk/Source/WebCore/css/CSSPaintImageValue.cpp
r237981 r238872 70 70 if (localRange.peek() == CommentToken) 71 71 localRange.consume(); 72 else 72 else if (localRange.peek().getBlockType() == CSSParserToken::BlockStart) { 73 localRange.peek().serialize(builder); 74 builder.append(localRange.consumeBlock().serialize()); 75 builder.append(')'); 76 } else 73 77 localRange.consume().serialize(builder); 74 78 } -
trunk/Source/WebCore/css/typedom/StylePropertyMapReadOnly.h
r237981 r238872 28 28 #if ENABLE(CSS_PAINTING_API) 29 29 30 #include " CSSStyleValue.h"30 #include "TypedOMCSSStyleValue.h" 31 31 #include <wtf/HashMap.h> 32 32 #include <wtf/RefCounted.h> … … 37 37 class StylePropertyMapReadOnly : public RefCounted<StylePropertyMapReadOnly> { 38 38 public: 39 static Ref<StylePropertyMapReadOnly> create(HashMap<String, Ref< CSSStyleValue>>&& map)39 static Ref<StylePropertyMapReadOnly> create(HashMap<String, Ref<TypedOMCSSStyleValue>>&& map) 40 40 { 41 41 return adoptRef(*new StylePropertyMapReadOnly(WTFMove(map))); 42 42 } 43 43 44 CSSStyleValue* get(String property) const { return m_map.get(property); }44 TypedOMCSSStyleValue* get(String property) const { return m_map.get(property); } 45 45 46 46 private: 47 explicit StylePropertyMapReadOnly(HashMap<String, Ref< CSSStyleValue>>&& map)47 explicit StylePropertyMapReadOnly(HashMap<String, Ref<TypedOMCSSStyleValue>>&& map) 48 48 : m_map(WTFMove(map)) 49 49 { 50 50 } 51 51 52 HashMap<String, Ref< CSSStyleValue>> m_map;52 HashMap<String, Ref<TypedOMCSSStyleValue>> m_map; 53 53 }; 54 54 -
trunk/Source/WebCore/css/typedom/StylePropertyMapReadOnly.idl
r237981 r238872 33 33 ImplementationLacksVTable 34 34 ] interface StylePropertyMapReadOnly { 35 // FIXME: should be (undefined or CSSStyleValue), not null36 CSSStyleValue? get(USVString property);35 // FIXME: should be (undefined or TypedOMCSSStyleValue), not null 36 TypedOMCSSStyleValue? get(USVString property); 37 37 }; -
trunk/Source/WebCore/css/typedom/TypedOMCSSImageValue.h
r238871 r238872 28 28 #if ENABLE(CSS_PAINTING_API) 29 29 30 #include "CSSNumericValue.h" 30 #include "CSSImageValue.h" 31 #include "ImageBitmap.h" 32 #include "RenderElement.h" 33 #include "TypedOMCSSStyleValue.h" 31 34 #include <wtf/RefCounted.h> 32 35 #include <wtf/text/StringConcatenateNumbers.h> … … 35 38 namespace WebCore { 36 39 37 class CSSUnitValue final : public CSSNumericValue {40 class TypedOMCSSImageValue final : public TypedOMCSSStyleValue { 38 41 public: 39 static Ref< CSSUnitValue> create(double value, const String& unit)42 static Ref<TypedOMCSSImageValue> create(CSSImageValue& cssValue, RenderElement& renderer) 40 43 { 41 return adoptRef(*new CSSUnitValue(value, unit));44 return adoptRef(*new TypedOMCSSImageValue(cssValue, renderer)); 42 45 } 43 46 44 // FIXME: not correct. 45 String toString() final { return makeString((int) m_value, m_unit); } 47 String toString() final { return m_cssValue->cssText(); } 46 48 47 double value() const { return m_value; } 48 void setValue(double value) { m_value = value; } 49 const String& unit() const { return m_unit; } 50 void setUnit(const String& unit) { m_unit = unit; } 49 CachedImage* image() { return m_cssValue->cachedImage(); } 50 const RenderElement* renderer() const { return m_renderer.get(); } 51 51 52 52 private: 53 CSSUnitValue(double value, const String& unit)54 : m_ value(value)55 , m_ unit(unit)53 TypedOMCSSImageValue(CSSImageValue& cssValue, RenderElement& renderer) 54 : m_cssValue(makeRef(cssValue)) 55 , m_renderer(makeWeakPtr(renderer)) 56 56 { 57 57 } 58 58 59 bool is UnitValue() final { return true; }59 bool isImageValue() final { return true; } 60 60 61 double m_value;62 String m_unit;61 Ref<CSSImageValue> m_cssValue; 62 WeakPtr<RenderElement> m_renderer; 63 63 }; 64 64 -
trunk/Source/WebCore/css/typedom/TypedOMCSSImageValue.idl
r238871 r238872 28 28 // is going to be implemented, please change the runtime flag. 29 29 [ 30 CustomToJSObject,30 InterfaceName=CSSImageValue, 31 31 EnabledAtRuntime=CSSPaintingAPI, 32 32 Conditional=CSS_PAINTING_API, 33 33 Exposed=(Window,Worker,PaintWorklet), 34 SkipVTableValidation, 35 ] interface CSSStyleValue { 36 stringifier; 34 JSGenerateToNativeObject, 35 ] interface TypedOMCSSImageValue : TypedOMCSSStyleValue { 37 36 }; -
trunk/Source/WebCore/css/typedom/TypedOMCSSNumericValue.h
r238871 r238872 28 28 #if ENABLE(CSS_PAINTING_API) 29 29 30 #include " CSSStyleValue.h"30 #include "TypedOMCSSStyleValue.h" 31 31 32 32 namespace WebCore { 33 33 34 class CSSNumericValue : publicCSSStyleValue {34 class TypedOMCSSNumericValue : public TypedOMCSSStyleValue { 35 35 protected: 36 CSSNumericValue() = default;36 TypedOMCSSNumericValue() = default; 37 37 }; 38 38 } // namespace WebCore -
trunk/Source/WebCore/css/typedom/TypedOMCSSNumericValue.idl
r238871 r238872 28 28 // is going to be implemented, please change the runtime flag. 29 29 [ 30 InterfaceName=CSSNumericValue, 30 31 EnabledAtRuntime=CSSPaintingAPI, 31 32 Conditional=CSS_PAINTING_API, 32 33 Exposed=(Window,Worker,PaintWorklet), 33 ] interface CSSNumericValue :CSSStyleValue {34 ] interface TypedOMCSSNumericValue : TypedOMCSSStyleValue { 34 35 }; -
trunk/Source/WebCore/css/typedom/TypedOMCSSStyleValue.h
r238871 r238872 28 28 #if ENABLE(CSS_PAINTING_API) 29 29 30 #include "ScriptWrappable.h" 30 31 #include <wtf/RefCounted.h> 31 32 #include <wtf/text/WTFString.h> … … 33 34 namespace WebCore { 34 35 35 class CSSStyleValue : public RefCounted<CSSStyleValue>{36 class TypedOMCSSStyleValue : public RefCounted<TypedOMCSSStyleValue>, public ScriptWrappable { 36 37 public: 37 virtual ~ CSSStyleValue() = default;38 virtual ~TypedOMCSSStyleValue() = default; 38 39 virtual String toString() = 0; 39 40 40 41 virtual bool isUnitValue() { return false; } 41 42 virtual bool isUnparsedValue() { return false; } 43 virtual bool isImageValue() { return false; } 42 44 43 45 protected: 44 CSSStyleValue() = default;46 TypedOMCSSStyleValue() = default; 45 47 }; 46 48 -
trunk/Source/WebCore/css/typedom/TypedOMCSSStyleValue.idl
r238871 r238872 28 28 // is going to be implemented, please change the runtime flag. 29 29 [ 30 InterfaceName=CSSStyleValue, 30 31 CustomToJSObject, 31 32 EnabledAtRuntime=CSSPaintingAPI, … … 33 34 Exposed=(Window,Worker,PaintWorklet), 34 35 SkipVTableValidation, 35 ] interface CSSStyleValue {36 ] interface TypedOMCSSStyleValue { 36 37 stringifier; 37 38 }; -
trunk/Source/WebCore/css/typedom/TypedOMCSSUnitValue.h
r238871 r238872 28 28 #if ENABLE(CSS_PAINTING_API) 29 29 30 #include " CSSNumericValue.h"30 #include "TypedOMCSSNumericValue.h" 31 31 #include <wtf/RefCounted.h> 32 32 #include <wtf/text/StringConcatenateNumbers.h> … … 35 35 namespace WebCore { 36 36 37 class CSSUnitValue final : publicCSSNumericValue {37 class TypedOMCSSUnitValue final : public TypedOMCSSNumericValue { 38 38 public: 39 static Ref< CSSUnitValue> create(double value, const String& unit)39 static Ref<TypedOMCSSUnitValue> create(double value, const String& unit) 40 40 { 41 return adoptRef(*new CSSUnitValue(value, unit));41 return adoptRef(*new TypedOMCSSUnitValue(value, unit)); 42 42 } 43 43 … … 51 51 52 52 private: 53 CSSUnitValue(double value, const String& unit)53 TypedOMCSSUnitValue(double value, const String& unit) 54 54 : m_value(value) 55 55 , m_unit(unit) -
trunk/Source/WebCore/css/typedom/TypedOMCSSUnitValue.idl
r238871 r238872 28 28 // is going to be implemented, please change the runtime flag. 29 29 [ 30 InterfaceName=CSSUnitValue, 30 31 EnabledAtRuntime=CSSPaintingAPI, 31 32 Conditional=CSS_PAINTING_API, 32 33 Exposed=(Window,Worker,PaintWorklet), 33 34 Constructor(double value, USVString unit), 34 ] interface CSSUnitValue :CSSNumericValue {35 ] interface TypedOMCSSUnitValue : TypedOMCSSNumericValue { 35 36 attribute double value; 36 37 readonly attribute USVString unit; -
trunk/Source/WebCore/css/typedom/TypedOMCSSUnparsedValue.h
r238871 r238872 28 28 #if ENABLE(CSS_PAINTING_API) 29 29 30 #include " CSSStyleValue.h"30 #include "TypedOMCSSStyleValue.h" 31 31 #include <wtf/RefCounted.h> 32 32 #include <wtf/text/WTFString.h> … … 34 34 namespace WebCore { 35 35 36 class CSSUnparsedValue final : publicCSSStyleValue {36 class TypedOMCSSUnparsedValue final : public TypedOMCSSStyleValue { 37 37 public: 38 static Ref< CSSUnparsedValue> create(const String& serializedValue)38 static Ref<TypedOMCSSUnparsedValue> create(const String& serializedValue) 39 39 { 40 return adoptRef(*new CSSUnparsedValue(serializedValue));40 return adoptRef(*new TypedOMCSSUnparsedValue(serializedValue)); 41 41 } 42 42 … … 44 44 45 45 private: 46 explicit CSSUnparsedValue(const String& serializedValue)46 explicit TypedOMCSSUnparsedValue(const String& serializedValue) 47 47 : m_serializedValue(serializedValue) 48 48 { -
trunk/Source/WebCore/css/typedom/TypedOMCSSUnparsedValue.idl
r238871 r238872 29 29 // FIXME: wrong constructor. 30 30 [ 31 InterfaceName=CSSUnparsedValue, 31 32 EnabledAtRuntime=CSSPaintingAPI, 32 33 Conditional=CSS_PAINTING_API, 33 34 Exposed=(Window,Worker,PaintWorklet), 34 35 Constructor(USVString serializedValue), 35 ] interface CSSUnparsedValue :CSSStyleValue {36 ] interface TypedOMCSSUnparsedValue : TypedOMCSSStyleValue { 36 37 }; -
trunk/Source/WebCore/html/ImageBitmap.cpp
r231440 r238872 45 45 #include "RenderElement.h" 46 46 #include "SharedBuffer.h" 47 #include "TypedOMCSSImageValue.h" 47 48 #include <wtf/StdLibExtras.h> 48 49 … … 449 450 #endif 450 451 452 #if ENABLE(CSS_PAINTING_API) 453 void ImageBitmap::createPromise(ScriptExecutionContext&, RefPtr<TypedOMCSSImageValue>&, ImageBitmapOptions&&, std::optional<IntRect>, ImageBitmap::Promise&& promise) 454 { 455 promise.reject(InvalidStateError, "Not implemented"); 456 } 457 #endif 458 451 459 void ImageBitmap::createPromise(ScriptExecutionContext&, RefPtr<ImageBitmap>& existingImageBitmap, ImageBitmapOptions&& options, std::optional<IntRect> rect, ImageBitmap::Promise&& promise) 452 460 { -
trunk/Source/WebCore/html/ImageBitmap.h
r238771 r238872 45 45 class PendingImageBitmap; 46 46 class ScriptExecutionContext; 47 class TypedOMCSSImageValue; 47 48 struct ImageBitmapOptions; 48 49 … … 56 57 RefPtr<HTMLCanvasElement>, 57 58 RefPtr<ImageBitmap>, 59 #if ENABLE(CSS_PAINTING_API) 60 RefPtr<TypedOMCSSImageValue>, 61 #endif 58 62 RefPtr<Blob>, 59 63 RefPtr<ImageData> … … 99 103 static void createPromise(ScriptExecutionContext&, RefPtr<Blob>&, ImageBitmapOptions&&, std::optional<IntRect>, Promise&&); 100 104 static void createPromise(ScriptExecutionContext&, RefPtr<ImageData>&, ImageBitmapOptions&&, std::optional<IntRect>, Promise&&); 105 static void createPromise(ScriptExecutionContext&, RefPtr<TypedOMCSSImageValue>&, ImageBitmapOptions&&, std::optional<IntRect>, Promise&&); 101 106 static void createFromBuffer(Ref<ArrayBuffer>&&, String mimeType, long long expectedContentLength, const URL&, ImageBitmapOptions&&, std::optional<IntRect>, Promise&&); 102 107 -
trunk/Source/WebCore/html/canvas/CanvasDrawImage.idl
r222986 r238872 25 25 26 26 // FIXME: This should include SVGImageElement and ImageBitmap. 27 #if defined(ENABLE_VIDEO) && ENABLE_VIDEO 27 #if defined(ENABLE_VIDEO) && ENABLE_VIDEO && defined(ENABLE_CSS_PAINTING_API) && ENABLE_CSS_PAINTING_API 28 typedef (HTMLImageElement or HTMLVideoElement or HTMLCanvasElement or ImageBitmap or TypedOMCSSImageValue) CanvasImageSource; 29 #elif defined(ENABLE_VIDEO) && ENABLE_VIDEO 28 30 typedef (HTMLImageElement or HTMLVideoElement or HTMLCanvasElement or ImageBitmap) CanvasImageSource; 29 31 #else -
trunk/Source/WebCore/html/canvas/CanvasFillStrokeStyles.idl
r222986 r238872 25 25 26 26 // FIXME: This should include SVGImageElement and ImageBitmap. 27 #if defined(ENABLE_VIDEO) && ENABLE_VIDEO 27 #if defined(ENABLE_VIDEO) && ENABLE_VIDEO && defined(ENABLE_CSS_PAINTING_API) && ENABLE_CSS_PAINTING_API 28 typedef (HTMLImageElement or HTMLVideoElement or HTMLCanvasElement or ImageBitmap or TypedOMCSSImageValue) CanvasImageSource; 29 #elif defined(ENABLE_VIDEO) && ENABLE_VIDEO 28 30 typedef (HTMLImageElement or HTMLVideoElement or HTMLCanvasElement or ImageBitmap) CanvasImageSource; 29 31 #else -
trunk/Source/WebCore/html/canvas/CanvasRenderingContext.cpp
r238771 r238872 145 145 } 146 146 147 void CanvasRenderingContext::checkOrigin(const TypedOMCSSImageValue&) 148 { 149 m_canvas.setOriginTainted(); 150 } 151 147 152 } // namespace WebCore -
trunk/Source/WebCore/html/canvas/CanvasRenderingContext.h
r238771 r238872 39 39 class HTMLVideoElement; 40 40 class ImageBitmap; 41 class TypedOMCSSImageValue; 41 42 class WebGLObject; 42 43 … … 89 90 } 90 91 void checkOrigin(const URL&); 92 void checkOrigin(const TypedOMCSSImageValue&); 91 93 92 94 bool m_callTracingActive { false }; -
trunk/Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp
r237344 r238872 62 62 #include "TextMetrics.h" 63 63 #include "TextRun.h" 64 #include "TypedOMCSSImageValue.h" 64 65 #include <wtf/CheckedArithmetic.h> 65 66 #include <wtf/MathExtras.h> … … 1439 1440 #endif 1440 1441 1442 #if ENABLE(CSS_PAINTING_API) 1443 static inline FloatSize size(TypedOMCSSImageValue& image) 1444 { 1445 LayoutSize size; 1446 if (auto* cachedImage = image.image()) 1447 size = cachedImage->imageSizeForRenderer(image.renderer(), 1.0f); // FIXME: Not sure about this, see fixme in size(HTMLImageElement&...) 1448 return size; 1449 } 1450 #endif 1451 1441 1452 static inline FloatRect normalizeRect(const FloatRect& rect) 1442 1453 { … … 1488 1499 ExceptionOr<void> CanvasRenderingContext2DBase::drawImage(HTMLImageElement& imageElement, const FloatRect& srcRect, const FloatRect& dstRect, const CompositeOperator& op, const BlendMode& blendMode) 1489 1500 { 1501 if (!imageElement.complete()) 1502 return { }; 1503 FloatRect imageRect = FloatRect(FloatPoint(), size(imageElement, ImageSizeType::BeforeDevicePixelRatio)); 1504 1505 auto result = drawImage(imageElement.document(), imageElement.cachedImage(), imageElement.renderer(), imageRect, srcRect, dstRect, op, blendMode); 1506 1507 if (!result.hasException()) 1508 checkOrigin(&imageElement); 1509 return result; 1510 } 1511 1512 #if ENABLE(CSS_PAINTING_API) 1513 ExceptionOr<void> CanvasRenderingContext2DBase::drawImage(TypedOMCSSImageValue& image, const FloatRect& srcRect, const FloatRect& dstRect) 1514 { 1515 auto* renderer = image.renderer(); 1516 auto* cachedImage = image.image(); 1517 if (!renderer || !cachedImage) 1518 return { }; 1519 FloatRect imageRect = FloatRect(FloatPoint(), size(image)); 1520 1521 auto result = drawImage(renderer->document(), cachedImage, renderer, imageRect, srcRect, dstRect, state().globalComposite, state().globalBlend); 1522 1523 if (!result.hasException()) 1524 checkOrigin(image); 1525 return result; 1526 } 1527 #endif 1528 1529 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) 1530 { 1490 1531 if (!std::isfinite(dstRect.x()) || !std::isfinite(dstRect.y()) || !std::isfinite(dstRect.width()) || !std::isfinite(dstRect.height()) 1491 1532 || !std::isfinite(srcRect.x()) || !std::isfinite(srcRect.y()) || !std::isfinite(srcRect.width()) || !std::isfinite(srcRect.height())) … … 1495 1536 return { }; 1496 1537 1497 if (!imageElement.complete())1498 return { };1499 1500 1538 FloatRect normalizedSrcRect = normalizeRect(srcRect); 1501 1539 FloatRect normalizedDstRect = normalizeRect(dstRect); 1502 1540 1503 FloatRect imageRect = FloatRect(FloatPoint(), size(imageElement, ImageSizeType::BeforeDevicePixelRatio));1504 1541 if (!srcRect.width() || !srcRect.height()) 1505 1542 return Exception { IndexSizeError }; … … 1525 1562 return { }; 1526 1563 1527 CachedImage* cachedImage = imageElement.cachedImage();1528 1564 if (!cachedImage) 1529 1565 return { }; 1530 1566 1531 RefPtr<Image> image = cachedImage->imageForRenderer( imageElement.renderer());1567 RefPtr<Image> image = cachedImage->imageForRenderer(renderer); 1532 1568 if (!image) 1533 1569 return { }; … … 1541 1577 1542 1578 if (image->isBitmapImage()) 1543 downcast<BitmapImage>(*image).updateFromSettings( imageElement.document().settings());1579 downcast<BitmapImage>(*image).updateFromSettings(document.settings()); 1544 1580 1545 1581 if (rectContainsCanvas(normalizedDstRect)) { … … 1561 1597 image->setImageObserver(observer); 1562 1598 1563 checkOrigin(&imageElement);1564 1565 1599 return { }; 1566 1600 } … … 1985 2019 } 1986 2020 2021 #if ENABLE(CSS_PAINTING_API) 2022 ExceptionOr<RefPtr<CanvasPattern>> CanvasRenderingContext2DBase::createPattern(TypedOMCSSImageValue&, bool, bool) 2023 { 2024 // FIXME: Implement. 2025 return Exception { TypeError }; 2026 } 2027 #endif 2028 1987 2029 void CanvasRenderingContext2DBase::didDrawEntireCanvas() 1988 2030 { -
trunk/Source/WebCore/html/canvas/CanvasRenderingContext2DBase.h
r237344 r238872 51 51 namespace WebCore { 52 52 53 class TypedOMCSSImageValue; 54 class CachedImage; 53 55 class CanvasBase; 54 56 class CanvasGradient; … … 63 65 class Path2D; 64 66 class RenderStyle; 67 class RenderObject; 65 68 class TextMetrics; 66 69 67 70 struct DOMMatrix2DInit; 68 71 69 #if ENABLE(VIDEO) 72 #if ENABLE(VIDEO) && ENABLE(CSS_PAINTING_API) 73 using CanvasImageSource = Variant<RefPtr<HTMLImageElement>, RefPtr<HTMLVideoElement>, RefPtr<HTMLCanvasElement>, RefPtr<ImageBitmap>, RefPtr<TypedOMCSSImageValue>>; 74 #elif ENABLE(VIDEO) 70 75 using CanvasImageSource = Variant<RefPtr<HTMLImageElement>, RefPtr<HTMLVideoElement>, RefPtr<HTMLCanvasElement>, RefPtr<ImageBitmap>>; 71 76 #else … … 322 327 #endif 323 328 ExceptionOr<RefPtr<CanvasPattern>> createPattern(ImageBitmap&, bool repeatX, bool repeatY); 329 #if ENABLE(CSS_PAINTING_API) 330 ExceptionOr<RefPtr<CanvasPattern>> createPattern(TypedOMCSSImageValue&, bool repeatX, bool repeatY); 331 #endif 324 332 325 333 ExceptionOr<void> drawImage(HTMLImageElement&, const FloatRect& srcRect, const FloatRect& dstRect); 326 334 ExceptionOr<void> drawImage(HTMLImageElement&, const FloatRect& srcRect, const FloatRect& dstRect, const CompositeOperator&, const BlendMode&); 327 335 ExceptionOr<void> drawImage(HTMLCanvasElement&, const FloatRect& srcRect, const FloatRect& dstRect); 336 ExceptionOr<void> drawImage(Document&, CachedImage*, const RenderObject*, const FloatRect& imageRect, const FloatRect& srcRect, const FloatRect& dstRect, const CompositeOperator&, const BlendMode&); 328 337 #if ENABLE(VIDEO) 329 338 ExceptionOr<void> drawImage(HTMLVideoElement&, const FloatRect& srcRect, const FloatRect& dstRect); 339 #endif 340 #if ENABLE(CSS_PAINTING_API) 341 ExceptionOr<void> drawImage(TypedOMCSSImageValue&, const FloatRect& srcRect, const FloatRect& dstRect); 330 342 #endif 331 343 ExceptionOr<void> drawImage(ImageBitmap&, const FloatRect& srcRect, const FloatRect& dstRect); -
trunk/Source/WebCore/inspector/InspectorCanvas.cpp
r238199 r238872 621 621 [&] (const RefPtr<HTMLVideoElement>& value) { addParameter(indexForData(value), RecordingSwizzleTypes::Image); }, 622 622 #endif 623 #if ENABLE(CSS_PAINTING_API) 624 [&] (const RefPtr<TypedOMCSSImageValue>&) { /* FIXME implement. */ }, 625 #endif 623 626 [&] (const RefPtr<ImageBitmap>& value) { addParameter(indexForData(value), RecordingSwizzleTypes::ImageBitmap); }, 624 627 [&] (const RefPtr<ImageData>& value) { addParameter(indexForData(value), RecordingSwizzleTypes::ImageData); }, -
trunk/Source/WebCore/page/WindowOrWorkerGlobalScope.idl
r237717 r238872 26 26 */ 27 27 28 #if defined(ENABLE_VIDEO) && ENABLE_VIDEO 28 #if defined(ENABLE_VIDEO) && ENABLE_VIDEO && defined(ENABLE_CSS_PAINTING_API) && ENABLE_CSS_PAINTING_API 29 typedef (HTMLImageElement or HTMLVideoElement or HTMLCanvasElement or ImageBitmap or TypedOMCSSImageValue) CanvasImageSource; 30 #elif defined(ENABLE_VIDEO) && ENABLE_VIDEO 29 31 typedef (HTMLImageElement or HTMLVideoElement or HTMLCanvasElement or ImageBitmap) CanvasImageSource; 30 32 #else -
trunk/Source/WebCore/platform/graphics/CustomPaintImage.cpp
r238839 r238872 30 30 31 31 #include "CSSComputedStyleDeclaration.h" 32 #include "CSSImageValue.h" 32 33 #include "CSSPrimitiveValue.h" 33 34 #include "CSSPropertyParser.h" 34 #include "CSSUnitValue.h"35 #include "CSSUnparsedValue.h"36 35 #include "CustomPaintCanvas.h" 37 36 #include "GraphicsContext.h" … … 41 40 #include "PaintRenderingContext2D.h" 42 41 #include "RenderElement.h" 42 #include "TypedOMCSSImageValue.h" 43 #include "TypedOMCSSUnitValue.h" 44 #include "TypedOMCSSUnparsedValue.h" 43 45 #include <JavaScriptCore/ConstructData.h> 44 46 … … 83 85 auto context = contextOrException.releaseReturnValue(); 84 86 85 HashMap<String, Ref< CSSStyleValue>> propertyValues;87 HashMap<String, Ref<TypedOMCSSStyleValue>> propertyValues; 86 88 ComputedStyleExtractor extractor(m_element->element()); 87 89 … … 98 100 99 101 if (!value) { 100 propertyValues.add(name, CSSUnparsedValue::create(emptyString()));102 propertyValues.add(name, TypedOMCSSUnparsedValue::create(emptyString())); 101 103 continue; 102 104 } … … 104 106 // FIXME: Properly reify all length values. 105 107 if (is<CSSPrimitiveValue>(*value) && downcast<CSSPrimitiveValue>(*value).primitiveType() == CSSPrimitiveValue::CSS_PX) 106 propertyValues.add(name, CSSUnitValue::create(downcast<CSSPrimitiveValue>(*value).doubleValue(), "px")); 108 propertyValues.add(name, TypedOMCSSUnitValue::create(downcast<CSSPrimitiveValue>(*value).doubleValue(), "px")); 109 else if (is<CSSImageValue>(*value)) 110 propertyValues.add(name, TypedOMCSSImageValue::create(downcast<CSSImageValue>(*value), *m_element)); 107 111 else 108 propertyValues.add(name, CSSUnparsedValue::create(value->cssText()));112 propertyValues.add(name, TypedOMCSSUnparsedValue::create(value->cssText())); 109 113 } 110 114 -
trunk/Source/WebCore/platform/graphics/gpu/GPUSwapChain.h
r238760 r238872 28 28 #if ENABLE(WEBGPU) 29 29 30 #include "GPUTexture.h" 30 31 #include <wtf/RefPtr.h> 31 32 #include <wtf/RetainPtr.h> … … 38 39 39 40 class GPUDevice; 40 class GPUTexture;41 41 42 42 enum class GPUTextureFormatEnum;
Note: See TracChangeset
for help on using the changeset viewer.