From ee31b069f372acad7e54a78431abc5dfd83d91b0 Mon Sep 17 00:00:00 2001 From: Daniil Manin Date: Mon, 20 May 2019 17:17:18 +0700 Subject: [PATCH] Fix #388: add test for color-prop-05-t-manual --- Macaw.xcodeproj/project.pbxproj | 12 ++- MacawTests/MacawSVGTests.swift | 4 + .../color-prop-05-t-manual.reference | 88 +++++++++++++++++++ .../w3cSVGTests/color-prop-05-t-manual.svg | 60 +++++++++++++ 4 files changed, 162 insertions(+), 2 deletions(-) create mode 100644 MacawTests/w3cSVGTests/color-prop-05-t-manual.reference create mode 100644 MacawTests/w3cSVGTests/color-prop-05-t-manual.svg diff --git a/Macaw.xcodeproj/project.pbxproj b/Macaw.xcodeproj/project.pbxproj index e9df761b..06b80715 100644 --- a/Macaw.xcodeproj/project.pbxproj +++ b/Macaw.xcodeproj/project.pbxproj @@ -508,6 +508,8 @@ A718CD4F1F45C28F00966E06 /* MDisplayLink_macOS.swift in Sources */ = {isa = PBXBuildFile; fileRef = A718CD4B1F45C28F00966E06 /* MDisplayLink_macOS.swift */; }; A718CD501F45C28F00966E06 /* MView_macOS.swift in Sources */ = {isa = PBXBuildFile; fileRef = A718CD4C1F45C28F00966E06 /* MView_macOS.swift */; }; A718CD521F45C2A400966E06 /* MBezierPath+Extension_macOS.swift in Sources */ = {isa = PBXBuildFile; fileRef = A718CD511F45C2A400966E06 /* MBezierPath+Extension_macOS.swift */; }; + 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 */; }; 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 */; }; @@ -923,6 +925,8 @@ A718CD4B1F45C28F00966E06 /* MDisplayLink_macOS.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = MDisplayLink_macOS.swift; path = Source/platform/macOS/MDisplayLink_macOS.swift; sourceTree = SOURCE_ROOT; }; A718CD4C1F45C28F00966E06 /* MView_macOS.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = MView_macOS.swift; path = Source/platform/macOS/MView_macOS.swift; sourceTree = SOURCE_ROOT; }; A718CD511F45C2A400966E06 /* MBezierPath+Extension_macOS.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "MBezierPath+Extension_macOS.swift"; path = "Source/platform/macOS/MBezierPath+Extension_macOS.swift"; sourceTree = SOURCE_ROOT; }; + 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 = ""; }; 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 = ""; }; @@ -1364,14 +1368,16 @@ 5B1AE18320B6A669007EECCB /* w3cSVGTests */ = { isa = PBXGroup; children = ( - 421C664F2225196900DD73F5 /* color-prop-04-t-manual.svg */, - 4269F43D2257265700D91393 /* color-prop-04-t-manual.reference */, 5B1AE22D20B6A669007EECCB /* color-prop-01-b-manual.reference */, 5B1AE18A20B6A669007EECCB /* color-prop-01-b-manual.svg */, 5B1AE22C20B6A669007EECCB /* color-prop-02-f-manual.reference */, 5B1AE1C620B6A669007EECCB /* color-prop-02-f-manual.svg */, 5B1AE1FA20B6A669007EECCB /* color-prop-03-t-manual.reference */, 5B1AE20320B6A669007EECCB /* color-prop-03-t-manual.svg */, + 4269F43D2257265700D91393 /* color-prop-04-t-manual.reference */, + 421C664F2225196900DD73F5 /* color-prop-04-t-manual.svg */, + A74C81F22292B45D0085A832 /* color-prop-05-t-manual.reference */, + A74C81F02292B3940085A832 /* color-prop-05-t-manual.svg */, 5B1AE1D420B6A669007EECCB /* coords-coord-01-t-manual.reference */, 5B1AE19A20B6A669007EECCB /* coords-coord-01-t-manual.svg */, 5B1AE1B920B6A669007EECCB /* coords-coord-02-t-manual.reference */, @@ -1810,6 +1816,7 @@ 5B1AE2B220B6A669007EECCB /* types-basic-01-f-manual.svg in Resources */, 58944BDA20AC8A9A00657640 /* logo_base64.txt in Resources */, 5B1AE2C520B6A669007EECCB /* coords-trans-02-t-manual.svg in Resources */, + A74C81F12292B3940085A832 /* color-prop-05-t-manual.svg in Resources */, 5B1AE26120B6A669007EECCB /* paths-data-13-t-manual.reference in Resources */, 5B1AE24820B6A669007EECCB /* coords-coord-01-t-manual.svg in Resources */, 5B1AE2B620B6A669007EECCB /* paths-data-04-t-manual.svg in Resources */, @@ -1872,6 +1879,7 @@ 5B1AE2D720B6A669007EECCB /* coords-trans-04-t-manual.svg in Resources */, 5B1AE2AC20B6A669007EECCB /* struct-use-12-f-manual.svg in Resources */, 5B1AE28220B6A669007EECCB /* coords-coord-01-t-manual.reference in Resources */, + A74C81F32292B45E0085A832 /* color-prop-05-t-manual.reference in Resources */, 5B1AE23420B6A669007EECCB /* painting-control-03-f-manual.reference in Resources */, 5B1AE26820B6A669007EECCB /* shapes-polyline-01-t-manual.svg in Resources */, 5B1AE29A20B6A669007EECCB /* struct-frag-02-t-manual.svg in Resources */, diff --git a/MacawTests/MacawSVGTests.swift b/MacawTests/MacawSVGTests.swift index c3bc656b..edc15bb6 100644 --- a/MacawTests/MacawSVGTests.swift +++ b/MacawTests/MacawSVGTests.swift @@ -265,6 +265,10 @@ class MacawSVGTests: XCTestCase { validateJSON("color-prop-01-b-manual") } + func testColorProp05() { + validateJSON("color-prop-05-t-manual") + } + func testShapesEllipse01() { validateJSON("shapes-ellipse-01-t-manual") } diff --git a/MacawTests/w3cSVGTests/color-prop-05-t-manual.reference b/MacawTests/w3cSVGTests/color-prop-05-t-manual.reference new file mode 100644 index 00000000..f2df0f8b --- /dev/null +++ b/MacawTests/w3cSVGTests/color-prop-05-t-manual.reference @@ -0,0 +1,88 @@ +{ + "contents" : [ + { + "contents" : [ + { + "contents" : [ + { + "fill" : { + "type" : "Color", + "val" : 65280 + }, + "form" : { + "h" : 150, + "type" : "Rect", + "w" : 150, + "x" : 120, + "y" : 60 + }, + "node" : "Shape" + } + ], + "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.8 $" + } + ], + "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/color-prop-05-t-manual.svg b/MacawTests/w3cSVGTests/color-prop-05-t-manual.svg new file mode 100644 index 00000000..466dcda5 --- /dev/null +++ b/MacawTests/w3cSVGTests/color-prop-05-t-manual.svg @@ -0,0 +1,60 @@ + + + + + + + + + + + + +

+ Tests the color that is used for the currentColor value in the fill + attribute when more than one color is specified. +

+

+ This is illustrated using a single rectangle that is a child of a group + element. A fill is specified for the group element but not the + rectangle. Colour is specifed for the rectangle and the group element. +

+ + +

Run the test. No interaction required.

+
+ +

+ The test is passed if the user agent renders the rectangle with a green + fill. +

+
+ + $RCSfile: color-prop-05-t.svg,v $ + + + + + + + + + + + + + + $Revision: 1.8 $ + + + + +