Skip to content

Commit

Permalink
Merge pull request #379 from f3dm76/task/parseGradients
Browse files Browse the repository at this point in the history
Fix #378: Gradient color in rgb() format is not being parsed
  • Loading branch information
ystrot authored May 30, 2018
2 parents 4907cc3 + fb778a0 commit 5ea9312
Show file tree
Hide file tree
Showing 10 changed files with 674 additions and 36 deletions.
24 changes: 24 additions & 0 deletions Macaw.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,12 @@
5B1AE2DD20B6A669007EECCB /* coords-transformattr-05-f-manual.reference in Resources */ = {isa = PBXBuildFile; fileRef = 5B1AE22F20B6A669007EECCB /* coords-transformattr-05-f-manual.reference */; };
5B1AE2DE20B6A669007EECCB /* painting-control-03-f-manual.svg in Resources */ = {isa = PBXBuildFile; fileRef = 5B1AE23020B6A669007EECCB /* painting-control-03-f-manual.svg */; };
5B1AE2DF20B6A669007EECCB /* coords-trans-07-t-manual.reference in Resources */ = {isa = PBXBuildFile; fileRef = 5B1AE23120B6A669007EECCB /* coords-trans-07-t-manual.reference */; };
5B37139720BE95D7004BB6EE /* pservers-grad-07-b-manual.reference in Resources */ = {isa = PBXBuildFile; fileRef = 5B37139120BE95D6004BB6EE /* pservers-grad-07-b-manual.reference */; };
5B37139820BE95D7004BB6EE /* pservers-grad-01-b-manual.svg in Resources */ = {isa = PBXBuildFile; fileRef = 5B37139220BE95D6004BB6EE /* pservers-grad-01-b-manual.svg */; };
5B37139920BE95D7004BB6EE /* pservers-grad-02-b-manual.reference in Resources */ = {isa = PBXBuildFile; fileRef = 5B37139320BE95D6004BB6EE /* pservers-grad-02-b-manual.reference */; };
5B37139A20BE95D7004BB6EE /* pservers-grad-02-b-manual.svg in Resources */ = {isa = PBXBuildFile; fileRef = 5B37139420BE95D6004BB6EE /* pservers-grad-02-b-manual.svg */; };
5B37139B20BE95D7004BB6EE /* pservers-grad-07-b-manual.svg in Resources */ = {isa = PBXBuildFile; fileRef = 5B37139520BE95D7004BB6EE /* pservers-grad-07-b-manual.svg */; };
5B37139C20BE95D7004BB6EE /* pservers-grad-01-b-manual.reference in Resources */ = {isa = PBXBuildFile; fileRef = 5B37139620BE95D7004BB6EE /* pservers-grad-01-b-manual.reference */; };
5B6E192120AC58F900454E7E /* AlphaEffect.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B6E190F20AC58F700454E7E /* AlphaEffect.swift */; };
5B6E192220AC58F900454E7E /* AlphaEffect.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B6E190F20AC58F700454E7E /* AlphaEffect.swift */; };
5B6E192320AC58F900454E7E /* OffsetEffect.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B6E191020AC58F700454E7E /* OffsetEffect.swift */; };
Expand Down Expand Up @@ -810,6 +816,12 @@
5B1AE22F20B6A669007EECCB /* coords-transformattr-05-f-manual.reference */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "coords-transformattr-05-f-manual.reference"; sourceTree = "<group>"; };
5B1AE23020B6A669007EECCB /* painting-control-03-f-manual.svg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "painting-control-03-f-manual.svg"; sourceTree = "<group>"; };
5B1AE23120B6A669007EECCB /* coords-trans-07-t-manual.reference */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "coords-trans-07-t-manual.reference"; sourceTree = "<group>"; };
5B37139120BE95D6004BB6EE /* pservers-grad-07-b-manual.reference */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "pservers-grad-07-b-manual.reference"; sourceTree = "<group>"; };
5B37139220BE95D6004BB6EE /* pservers-grad-01-b-manual.svg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "pservers-grad-01-b-manual.svg"; sourceTree = "<group>"; };
5B37139320BE95D6004BB6EE /* pservers-grad-02-b-manual.reference */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "pservers-grad-02-b-manual.reference"; sourceTree = "<group>"; };
5B37139420BE95D6004BB6EE /* pservers-grad-02-b-manual.svg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "pservers-grad-02-b-manual.svg"; sourceTree = "<group>"; };
5B37139520BE95D7004BB6EE /* pservers-grad-07-b-manual.svg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "pservers-grad-07-b-manual.svg"; sourceTree = "<group>"; };
5B37139620BE95D7004BB6EE /* pservers-grad-01-b-manual.reference */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "pservers-grad-01-b-manual.reference"; sourceTree = "<group>"; };
5B6E190F20AC58F700454E7E /* AlphaEffect.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AlphaEffect.swift; sourceTree = "<group>"; };
5B6E191020AC58F700454E7E /* OffsetEffect.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OffsetEffect.swift; sourceTree = "<group>"; };
5B6E191120AC58F700454E7E /* GaussianBlur.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GaussianBlur.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1403,6 +1415,12 @@
5BFEF5D420BC1C1E008DAC11 /* paths-data-18-f-manual.svg */,
5B1AE1D720B6A669007EECCB /* paths-data-19-f-manual.reference */,
5B1AE21A20B6A669007EECCB /* paths-data-19-f-manual.svg */,
5B37139620BE95D7004BB6EE /* pservers-grad-01-b-manual.reference */,
5B37139220BE95D6004BB6EE /* pservers-grad-01-b-manual.svg */,
5B37139320BE95D6004BB6EE /* pservers-grad-02-b-manual.reference */,
5B37139420BE95D6004BB6EE /* pservers-grad-02-b-manual.svg */,
5B37139120BE95D6004BB6EE /* pservers-grad-07-b-manual.reference */,
5B37139520BE95D7004BB6EE /* pservers-grad-07-b-manual.svg */,
5B1AE1F020B6A669007EECCB /* pservers-grad-stops-01-f-manual.reference */,
5B1AE1EB20B6A669007EECCB /* pservers-grad-stops-01-f-manual.svg */,
5B1AE1A220B6A669007EECCB /* render-elems-01-t-manual.reference */,
Expand Down Expand Up @@ -1676,6 +1694,7 @@
5B1AE2DA20B6A669007EECCB /* color-prop-02-f-manual.reference in Resources */,
5B1AE26620B6A669007EECCB /* painting-fill-04-t-manual.svg in Resources */,
5B1AE26C20B6A669007EECCB /* painting-fill-05-b-manual.svg in Resources */,
5B37139920BE95D7004BB6EE /* pservers-grad-02-b-manual.reference in Resources */,
5B1AE2D620B6A669007EECCB /* coords-trans-03-t-manual.svg in Resources */,
5B1AE26920B6A669007EECCB /* struct-use-03-t-manual.reference in Resources */,
5B1AE27820B6A669007EECCB /* struct-group-01-t-manual.reference in Resources */,
Expand All @@ -1685,6 +1704,7 @@
5B1AE2C220B6A669007EECCB /* coords-trans-05-t-manual.svg in Resources */,
5B1AE29D20B6A669007EECCB /* types-basic-01-f-manual.reference in Resources */,
5B1AE25820B6A669007EECCB /* paths-data-08-t-manual.reference in Resources */,
5B37139720BE95D7004BB6EE /* pservers-grad-07-b-manual.reference in Resources */,
5B1AE24A20B6A669007EECCB /* struct-frag-02-t-manual.reference in Resources */,
5B1AE2DF20B6A669007EECCB /* coords-trans-07-t-manual.reference in Resources */,
5BAE204B208E163D006BF277 /* clip.reference in Resources */,
Expand Down Expand Up @@ -1734,6 +1754,7 @@
5B1AE26E20B6A669007EECCB /* struct-frag-01-t-manual.svg in Resources */,
5B1AE2B420B6A669007EECCB /* shapes-ellipse-02-t-manual.svg in Resources */,
5B1AE2A120B6A669007EECCB /* paths-data-02-t-manual.reference in Resources */,
5B37139B20BE95D7004BB6EE /* pservers-grad-07-b-manual.svg in Resources */,
5B1AE2B920B6A669007EECCB /* painting-control-02-f-manual.svg in Resources */,
5B1AE28A20B6A669007EECCB /* shapes-polygon-01-t-manual.reference in Resources */,
5B1AE27920B6A669007EECCB /* shapes-circle-01-t-manual.svg in Resources */,
Expand Down Expand Up @@ -1796,6 +1817,7 @@
5B1AE24920B6A669007EECCB /* painting-control-06-f-manual.svg in Resources */,
5B1AE2B320B6A669007EECCB /* coords-trans-04-t-manual.reference in Resources */,
5BAE2038208E163D006BF277 /* polyline.reference in Resources */,
5B37139C20BE95D7004BB6EE /* pservers-grad-01-b-manual.reference in Resources */,
5B1AE28020B6A669007EECCB /* coords-transformattr-03-f-manual.svg in Resources */,
C43B06661F99EE7300787A35 /* cubicAbsolute.svg in Resources */,
5B1AE26A20B6A669007EECCB /* painting-control-06-f-manual.reference in Resources */,
Expand All @@ -1818,6 +1840,7 @@
57CAB1351D7832E000FD8E47 /* roundRect.svg in Resources */,
5BAE203D208E163D006BF277 /* clipManual.reference in Resources */,
5B1AE29620B6A669007EECCB /* shapes-circle-02-t-manual.svg in Resources */,
5B37139820BE95D7004BB6EE /* pservers-grad-01-b-manual.svg in Resources */,
5B1AE28320B6A669007EECCB /* paths-data-03-f-manual.svg in Resources */,
5B1AE29E20B6A669007EECCB /* pservers-grad-stops-01-f-manual.reference in Resources */,
5B1AE23E20B6A669007EECCB /* render-elems-02-t-manual.reference in Resources */,
Expand Down Expand Up @@ -1852,6 +1875,7 @@
5B1AE25A20B6A669007EECCB /* painting-stroke-06-t-manual.svg in Resources */,
5B1AE24320B6A669007EECCB /* painting-stroke-07-t-manual.svg in Resources */,
5B1AE27B20B6A669007EECCB /* painting-fill-02-t-manual.svg in Resources */,
5B37139A20BE95D7004BB6EE /* pservers-grad-02-b-manual.svg in Resources */,
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 */,
Expand Down
12 changes: 12 additions & 0 deletions MacawTests/MacawSVGTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -548,4 +548,16 @@ class MacawSVGTests: XCTestCase {
func testPathsData10() {
validateJSON("paths-data-10-t-manual")
}

func testPserversGrad01() {
validateJSON("pservers-grad-01-b-manual")
}

func testPserversGrad02() {
validateJSON("pservers-grad-02-b-manual")
}

func testPserversGrad07() {
validateJSON("pservers-grad-07-b-manual")
}
}
4 changes: 2 additions & 2 deletions MacawTests/w3c-test-suite.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ There are 521 SVG tests in total. 212 files uses features that are not covered b
* [switch/object](https://www.w3.org/TR/SVG11/backward.html) (7)

The rest 309 tests can be split into following categories:
* 28.4% passed (88)
* 20% not yet covered (62)
* 29.4% passed (91)
* 19% not yet covered (59)
* 14% filters (43)
* 7.8% images (24)
* 2.6% markers (8)
Expand Down
121 changes: 121 additions & 0 deletions MacawTests/w3cSVGTests/pservers-grad-01-b-manual.reference
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
{
"layout" : {
"yAligningMode" : "mid",
"scalingMode" : "meet",
"svgSize" : {
"height" : "100.0%",
"width" : "100.0%"
},
"xAligningMode" : "mid",
"viewBox" : {
"x" : 0,
"w" : 480,
"type" : "Rect",
"y" : 0,
"h" : 360
}
},
"contents" : [
{
"contents" : [
{
"form" : {
"x" : 20,
"w" : 440,
"type" : "Rect",
"y" : 20,
"h" : 80
},
"node" : "Shape"
},
{
"baseline" : "bottom",
"fill" : {
"type" : "Color",
"val" : 0
},
"node" : "Text",
"align" : "min",
"text" : "Linear gradient.",
"place" : "1, 0, 0, 1, 20, 130",
"font" : {
"name" : "SVGFreeSansASCII,sans-serif",
"size" : 30,
"weight" : "normal"
}
},
{
"form" : {
"x" : 20,
"w" : 440,
"type" : "Rect",
"y" : 150,
"h" : 80
},
"node" : "Shape"
},
{
"baseline" : "bottom",
"fill" : {
"type" : "Color",
"val" : 0
},
"node" : "Text",
"align" : "min",
"text" : "Referencing gradient below.",
"place" : "1, 0, 0, 1, 20, 260",
"font" : {
"name" : "SVGFreeSansASCII,sans-serif",
"size" : 30,
"weight" : "normal"
}
}
],
"node" : "Group"
},
{
"contents" : [
{
"baseline" : "bottom",
"fill" : {
"type" : "Color",
"val" : 0
},
"node" : "Text",
"align" : "min",
"text" : "$Revision: 1.7 $",
"place" : "1, 0, 0, 1, 10, 340",
"font" : {
"name" : "SVGFreeSansASCII,sans-serif",
"size" : 32,
"weight" : "normal"
}
}
],
"node" : "Group"
},
{
"stroke" : {
"join" : "miter",
"cap" : "butt",
"fill" : {
"type" : "Color",
"val" : 0
},
"dashes" : [

],
"width" : 1
},
"form" : {
"x" : 1,
"w" : 478,
"type" : "Rect",
"y" : 1,
"h" : 358
},
"node" : "Shape"
}
],
"node" : "Canvas"
}
69 changes: 69 additions & 0 deletions MacawTests/w3cSVGTests/pservers-grad-01-b-manual.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 5ea9312

Please sign in to comment.