diff --git a/Macaw.xcodeproj/project.pbxproj b/Macaw.xcodeproj/project.pbxproj index 934c7325..1211c38b 100644 --- a/Macaw.xcodeproj/project.pbxproj +++ b/Macaw.xcodeproj/project.pbxproj @@ -512,6 +512,8 @@ A74C81ED229284790085A832 /* struct-use-01-t-manual.svg in Resources */ = {isa = PBXBuildFile; fileRef = A74C81EB229284780085A832 /* struct-use-01-t-manual.svg */; }; A74C81F12292B3940085A832 /* color-prop-05-t-manual.svg in Resources */ = {isa = PBXBuildFile; fileRef = A74C81F02292B3940085A832 /* color-prop-05-t-manual.svg */; }; A74C81F32292B45E0085A832 /* color-prop-05-t-manual.reference in Resources */ = {isa = PBXBuildFile; fileRef = A74C81F22292B45D0085A832 /* color-prop-05-t-manual.reference */; }; + A74C82032296BE5F0085A832 /* paths-data-20-f-manual.svg in Resources */ = {isa = PBXBuildFile; fileRef = A74C82022296BE5F0085A832 /* paths-data-20-f-manual.svg */; }; + A74C82052296BFC60085A832 /* paths-data-20-f-manual.reference in Resources */ = {isa = PBXBuildFile; fileRef = A74C82042296BFC60085A832 /* paths-data-20-f-manual.reference */; }; A74C821F2297D4810085A832 /* coords-trans-13-f-manual.svg in Resources */ = {isa = PBXBuildFile; fileRef = A74C821A2297D4800085A832 /* coords-trans-13-f-manual.svg */; }; A74C82202297D4810085A832 /* coords-trans-14-f-manual.svg in Resources */ = {isa = PBXBuildFile; fileRef = A74C821B2297D4800085A832 /* coords-trans-14-f-manual.svg */; }; A74C82212297D4810085A832 /* coords-trans-11-f-manual.svg in Resources */ = {isa = PBXBuildFile; fileRef = A74C821C2297D4800085A832 /* coords-trans-11-f-manual.svg */; }; @@ -530,8 +532,10 @@ A74C823E2297DB2C0085A832 /* shapes-rect-03-t-manual.reference in Resources */ = {isa = PBXBuildFile; fileRef = A74C823A2297DB2B0085A832 /* shapes-rect-03-t-manual.reference */; }; A74C823F2297DB2C0085A832 /* shapes-rect-06-f-manual.reference in Resources */ = {isa = PBXBuildFile; fileRef = A74C823B2297DB2B0085A832 /* shapes-rect-06-f-manual.reference */; }; A74C82412297DC220085A832 /* shapes-rect-02-t-manual.reference in Resources */ = {isa = PBXBuildFile; fileRef = A74C82402297DC220085A832 /* shapes-rect-02-t-manual.reference */; }; - A74C82032296BE5F0085A832 /* paths-data-20-f-manual.svg in Resources */ = {isa = PBXBuildFile; fileRef = A74C82022296BE5F0085A832 /* paths-data-20-f-manual.svg */; }; - A74C82052296BFC60085A832 /* paths-data-20-f-manual.reference in Resources */ = {isa = PBXBuildFile; fileRef = A74C82042296BFC60085A832 /* paths-data-20-f-manual.reference */; }; + A74C8307229E9CCE0085A832 /* masking-filter-01-f-manual.svg in Resources */ = {isa = PBXBuildFile; fileRef = A74C8305229E9CCD0085A832 /* masking-filter-01-f-manual.svg */; }; + A74C8308229E9CCE0085A832 /* masking-mask-02-f-manual.svg in Resources */ = {isa = PBXBuildFile; fileRef = A74C8306229E9CCE0085A832 /* masking-mask-02-f-manual.svg */; }; + A74C830B229E9D700085A832 /* masking-filter-01-f-manual.reference in Resources */ = {isa = PBXBuildFile; fileRef = A74C8309229E9D6F0085A832 /* masking-filter-01-f-manual.reference */; }; + A74C830C229E9D700085A832 /* masking-mask-02-f-manual.reference in Resources */ = {isa = PBXBuildFile; fileRef = A74C830A229E9D700085A832 /* masking-mask-02-f-manual.reference */; }; A7E675561EC4213500BD9ECB /* NodeBoundsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7E675551EC4213500BD9ECB /* NodeBoundsTests.swift */; }; C410148E1F834D290022EE44 /* style.svg in Resources */ = {isa = PBXBuildFile; fileRef = C410148D1F834D280022EE44 /* style.svg */; }; C4153A8F1F8793DE001BA5EE /* small-logo.png in Resources */ = {isa = PBXBuildFile; fileRef = C4153A8E1F8793DD001BA5EE /* small-logo.png */; }; @@ -951,6 +955,8 @@ A74C81EB229284780085A832 /* struct-use-01-t-manual.svg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "struct-use-01-t-manual.svg"; sourceTree = ""; }; A74C81F02292B3940085A832 /* color-prop-05-t-manual.svg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "color-prop-05-t-manual.svg"; sourceTree = ""; }; A74C81F22292B45D0085A832 /* color-prop-05-t-manual.reference */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "color-prop-05-t-manual.reference"; sourceTree = ""; }; + A74C82022296BE5F0085A832 /* paths-data-20-f-manual.svg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "paths-data-20-f-manual.svg"; sourceTree = ""; }; + A74C82042296BFC60085A832 /* paths-data-20-f-manual.reference */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "paths-data-20-f-manual.reference"; sourceTree = ""; }; A74C821A2297D4800085A832 /* coords-trans-13-f-manual.svg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "coords-trans-13-f-manual.svg"; sourceTree = ""; }; A74C821B2297D4800085A832 /* coords-trans-14-f-manual.svg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "coords-trans-14-f-manual.svg"; sourceTree = ""; }; A74C821C2297D4800085A832 /* coords-trans-11-f-manual.svg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "coords-trans-11-f-manual.svg"; sourceTree = ""; }; @@ -969,8 +975,10 @@ A74C823A2297DB2B0085A832 /* shapes-rect-03-t-manual.reference */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "shapes-rect-03-t-manual.reference"; sourceTree = ""; }; A74C823B2297DB2B0085A832 /* shapes-rect-06-f-manual.reference */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "shapes-rect-06-f-manual.reference"; sourceTree = ""; }; A74C82402297DC220085A832 /* shapes-rect-02-t-manual.reference */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "shapes-rect-02-t-manual.reference"; sourceTree = ""; }; - A74C82022296BE5F0085A832 /* paths-data-20-f-manual.svg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "paths-data-20-f-manual.svg"; sourceTree = ""; }; - A74C82042296BFC60085A832 /* paths-data-20-f-manual.reference */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "paths-data-20-f-manual.reference"; sourceTree = ""; }; + A74C8305229E9CCD0085A832 /* masking-filter-01-f-manual.svg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "masking-filter-01-f-manual.svg"; sourceTree = ""; }; + A74C8306229E9CCE0085A832 /* masking-mask-02-f-manual.svg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "masking-mask-02-f-manual.svg"; sourceTree = ""; }; + A74C8309229E9D6F0085A832 /* masking-filter-01-f-manual.reference */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "masking-filter-01-f-manual.reference"; sourceTree = ""; }; + A74C830A229E9D700085A832 /* masking-mask-02-f-manual.reference */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "masking-mask-02-f-manual.reference"; sourceTree = ""; }; A7E675551EC4213500BD9ECB /* NodeBoundsTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = NodeBoundsTests.swift; path = Bounds/NodeBoundsTests.swift; sourceTree = ""; }; C410148D1F834D280022EE44 /* style.svg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = style.svg; sourceTree = ""; }; C4153A8E1F8793DD001BA5EE /* small-logo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "small-logo.png"; sourceTree = ""; }; @@ -1468,6 +1476,10 @@ 5B7E79DD20D2781A00C50BCF /* masking-intro-01-f-manual.svg */, 5B7E79CC20CBE69600C50BCF /* masking-path-02-b-manual.reference */, 5B7E79CD20CBE69700C50BCF /* masking-path-02-b-manual.svg */, + A74C8309229E9D6F0085A832 /* masking-filter-01-f-manual.reference */, + A74C8305229E9CCD0085A832 /* masking-filter-01-f-manual.svg */, + A74C830A229E9D700085A832 /* masking-mask-02-f-manual.reference */, + A74C8306229E9CCE0085A832 /* masking-mask-02-f-manual.svg */, 5B1AE19E20B6A669007EECCB /* metadata-example-01-t-manual.reference */, 5B1AE22A20B6A669007EECCB /* metadata-example-01-t-manual.svg */, 5B1AE20C20B6A669007EECCB /* painting-control-01-f-manual.reference */, @@ -1834,6 +1846,7 @@ 5B1AE2A420B6A669007EECCB /* paths-data-12-t-manual.reference in Resources */, 57CAB1361D7832E000FD8E47 /* triangle.svg in Resources */, 5B7E79CF20CBE69700C50BCF /* masking-path-02-b-manual.svg in Resources */, + A74C830C229E9D700085A832 /* masking-mask-02-f-manual.reference in Resources */, 5BFEF5D620BC1C1F008DAC11 /* paths-data-18-f-manual.svg in Resources */, A74C81ED229284790085A832 /* struct-use-01-t-manual.svg in Resources */, 5B1AE23620B6A669007EECCB /* paths-data-07-t-manual.svg in Resources */, @@ -1883,10 +1896,12 @@ A74C82052296BFC60085A832 /* paths-data-20-f-manual.reference in Resources */, 5B1AE29020B6A669007EECCB /* painting-stroke-08-t-manual.svg in Resources */, 5B1AE2A720B6A669007EECCB /* paths-data-09-t-manual.svg in Resources */, + A74C830B229E9D700085A832 /* masking-filter-01-f-manual.reference in Resources */, 5B1AE2AB20B6A669007EECCB /* painting-stroke-08-t-manual.reference in Resources */, A74C82352297D8B40085A832 /* shapes-rect-07-f-manual.svg in Resources */, 5B1AE2A520B6A669007EECCB /* coords-trans-02-t-manual.reference in Resources */, 5B1AE23220B6A669007EECCB /* text-align-01-b-manual.svg in Resources */, + A74C8308229E9CCE0085A832 /* masking-mask-02-f-manual.svg in Resources */, 5B1AE2B220B6A669007EECCB /* types-basic-01-f-manual.svg in Resources */, 58944BDA20AC8A9A00657640 /* logo_base64.txt in Resources */, 5B1AE2C520B6A669007EECCB /* coords-trans-02-t-manual.svg in Resources */, @@ -2057,6 +2072,7 @@ 5B1AE27A20B6A669007EECCB /* coords-transformattr-01-f-manual.reference in Resources */, 5B1AE24C20B6A669007EECCB /* metadata-example-01-t-manual.reference in Resources */, 5B1AE29720B6A669007EECCB /* render-elems-01-t-manual.svg in Resources */, + A74C8307229E9CCE0085A832 /* masking-filter-01-f-manual.svg in Resources */, 5B1AE26220B6A669007EECCB /* coords-transformattr-02-f-manual.svg in Resources */, 5B1AE28F20B6A669007EECCB /* shapes-polyline-02-t-manual.svg in Resources */, 5B1AE24420B6A669007EECCB /* shapes-rect-05-f-manual.reference in Resources */, diff --git a/MacawTests/MacawSVGTests.swift b/MacawTests/MacawSVGTests.swift index e6755d8a..40fb3d85 100644 --- a/MacawTests/MacawSVGTests.swift +++ b/MacawTests/MacawSVGTests.swift @@ -680,4 +680,12 @@ class MacawSVGTests: XCTestCase { func testPserversGrad03() { validateJSON("pservers-grad-03-b-manual") } + + func testMaskingFilter01() { + validateJSON("masking-filter-01-f-manual") + } + + func testMaskingMask02() { + validateJSON("masking-mask-02-f-manual") + } } diff --git a/MacawTests/w3cSVGTests/masking-filter-01-f-manual.reference b/MacawTests/w3cSVGTests/masking-filter-01-f-manual.reference new file mode 100644 index 00000000..5955192c --- /dev/null +++ b/MacawTests/w3cSVGTests/masking-filter-01-f-manual.reference @@ -0,0 +1,152 @@ +{ + "contents" : [ + { + "contents" : [ + { + "contents" : [ + { + "align" : "min", + "baseline" : "bottom", + "fill" : { + "type" : "Color", + "val" : 0 + }, + "font" : { + "name" : "SVGFreeSansASCII,sans-serif", + "size" : 18, + "weight" : "normal" + }, + "node" : "Text", + "place" : "1, 0, 0, 1, 10, 35", + "text" : "Testing 'filter' applied to 'mask'" + }, + { + "contents" : [ + { + "fill" : { + "type" : "Color", + "val" : 32768 + }, + "form" : { + "h" : 100, + "type" : "Rect", + "w" : 100, + "x" : 0, + "y" : 0 + }, + "mask" : { + "fill" : { + "type" : "Color", + "val" : 16777215 + }, + "form" : { + "h" : 100, + "type" : "Rect", + "w" : 100, + "x" : 0, + "y" : 0 + }, + "node" : "Shape" + }, + "node" : "Shape" + }, + { + "fill" : { + "type" : "Color", + "val" : 16711680 + }, + "form" : { + "h" : 99, + "type" : "Rect", + "w" : 99, + "x" : 101, + "y" : 101 + }, + "mask" : { + "fill" : { + "type" : "Color", + "val" : 16777215 + }, + "form" : { + "h" : 100, + "type" : "Rect", + "w" : 100, + "x" : 0, + "y" : 0 + }, + "node" : "Shape" + }, + "node" : "Shape" + } + ], + "node" : "Group", + "place" : "1, 0, 0, 1, 10, 50" + } + ], + "node" : "Group" + } + ], + "node" : "Group" + }, + { + "contents" : [ + { + "align" : "min", + "baseline" : "bottom", + "fill" : { + "type" : "Color", + "val" : 0 + }, + "font" : { + "name" : "SVGFreeSansASCII,sans-serif", + "size" : 32, + "weight" : "normal" + }, + "node" : "Text", + "place" : "1, 0, 0, 1, 10, 340", + "text" : "$Revision: 1.7 $" + } + ], + "node" : "Group" + }, + { + "form" : { + "h" : 358, + "type" : "Rect", + "w" : 478, + "x" : 1, + "y" : 1 + }, + "node" : "Shape", + "stroke" : { + "cap" : "butt", + "dashes" : [ + + ], + "fill" : { + "type" : "Color", + "val" : 0 + }, + "join" : "miter", + "width" : 1 + } + } + ], + "layout" : { + "scalingMode" : "meet", + "svgSize" : { + "height" : "100.0%", + "width" : "100.0%" + }, + "viewBox" : { + "h" : 360, + "type" : "Rect", + "w" : 480, + "x" : 0, + "y" : 0 + }, + "xAligningMode" : "mid", + "yAligningMode" : "mid" + }, + "node" : "Canvas" +} \ No newline at end of file diff --git a/MacawTests/w3cSVGTests/masking-filter-01-f-manual.svg b/MacawTests/w3cSVGTests/masking-filter-01-f-manual.svg new file mode 100644 index 00000000..777c6c69 --- /dev/null +++ b/MacawTests/w3cSVGTests/masking-filter-01-f-manual.svg @@ -0,0 +1,81 @@ + + + + + + + + + + + + +

+ This tests that the 'filter' property does not apply to 'mask'. +

+

+ The mask 'm' covers a rectangular area (200 x 200) except for a window + (100 x 100) in the top left hand corner. Initially the mask window is + set on top of the green square. Hence, the green square is shown and + the red square is covered. If filters are supported the window within + the mask will be shifted by an offset of 100,100 placing it on top of + the red square. +

+ + +

+ Run the test. No interaction required. +

+
+ +

+ The test passes if a green square is shown. If any + red shows, the test has failed. +

+
+ + $RCSfile: masking-filter-01-f.svg,v $ + + + + + + + + + + Testing 'filter' applied to 'mask' + + + + + + + + + + + + + + + + + + $Revision: 1.7 $ + + + + + diff --git a/MacawTests/w3cSVGTests/masking-mask-02-f-manual.reference b/MacawTests/w3cSVGTests/masking-mask-02-f-manual.reference new file mode 100644 index 00000000..6ebf8434 --- /dev/null +++ b/MacawTests/w3cSVGTests/masking-mask-02-f-manual.reference @@ -0,0 +1,83 @@ +{ + "contents" : [ + { + "contents" : [ + { + "fill" : { + "type" : "Color", + "val" : 32768 + }, + "form" : { + "h" : 150, + "type" : "Rect", + "w" : 250, + "x" : 100, + "y" : 100 + }, + "node" : "Shape" + } + ], + "node" : "Group" + }, + { + "contents" : [ + { + "align" : "min", + "baseline" : "bottom", + "fill" : { + "type" : "Color", + "val" : 0 + }, + "font" : { + "name" : "SVGFreeSansASCII,sans-serif", + "size" : 32, + "weight" : "normal" + }, + "node" : "Text", + "place" : "1, 0, 0, 1, 10, 340", + "text" : "$Revision: 1.3 $" + } + ], + "node" : "Group" + }, + { + "form" : { + "h" : 358, + "type" : "Rect", + "w" : 478, + "x" : 1, + "y" : 1 + }, + "node" : "Shape", + "stroke" : { + "cap" : "butt", + "dashes" : [ + + ], + "fill" : { + "type" : "Color", + "val" : 0 + }, + "join" : "miter", + "width" : 1 + } + } + ], + "layout" : { + "scalingMode" : "meet", + "svgSize" : { + "height" : "100.0%", + "width" : "100.0%" + }, + "viewBox" : { + "h" : 360, + "type" : "Rect", + "w" : 480, + "x" : 0, + "y" : 0 + }, + "xAligningMode" : "mid", + "yAligningMode" : "mid" + }, + "node" : "Canvas" +} \ No newline at end of file diff --git a/MacawTests/w3cSVGTests/masking-mask-02-f-manual.svg b/MacawTests/w3cSVGTests/masking-mask-02-f-manual.svg new file mode 100644 index 00000000..c96a4564 --- /dev/null +++ b/MacawTests/w3cSVGTests/masking-mask-02-f-manual.svg @@ -0,0 +1,50 @@ + + + + + + + + + + +

+ If the 'mask' property references a 'mask' element containing no children, the element referencing it is not rendered. +

+ + +

Run the test. No interaction required.

+
+ +

+ Test passes if there is a single green rectangle, with no red visible on the page. +

+
+ + $RCSfile: masking-mask-02-f.svg,v $ + + + + + + + + + + + + + + $Revision: 1.3 $ + + + +