diff --git a/SVGView.xcodeproj/project.pbxproj b/SVGView.xcodeproj/project.pbxproj index e798689..3a77930 100644 --- a/SVGView.xcodeproj/project.pbxproj +++ b/SVGView.xcodeproj/project.pbxproj @@ -7,6 +7,10 @@ objects = { /* Begin PBXBuildFile section */ + 0E068A7C2DE5719A00DE4DC9 /* SVGDefs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E068A7A2DE5719900DE4DC9 /* SVGDefs.swift */; }; + 0E068A7D2DE5719A00DE4DC9 /* SVGMarker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E068A7B2DE5719900DE4DC9 /* SVGMarker.swift */; }; + 0E068A7E2DE5719A00DE4DC9 /* SVGDefs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E068A7A2DE5719900DE4DC9 /* SVGDefs.swift */; }; + 0E068A7F2DE5719A00DE4DC9 /* SVGMarker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E068A7B2DE5719900DE4DC9 /* SVGMarker.swift */; }; 5815294025B6C8F600E8D23A /* SVGPaint.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5815293F25B6C8F600E8D23A /* SVGPaint.swift */; }; 5815294425B6C90F00E8D23A /* SVGColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5815294325B6C90F00E8D23A /* SVGColor.swift */; }; 5815298A25B752E600E8D23A /* SVGPreserveAspectRatio.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5815298925B752E600E8D23A /* SVGPreserveAspectRatio.swift */; }; @@ -134,6 +138,8 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + 0E068A7A2DE5719900DE4DC9 /* SVGDefs.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SVGDefs.swift; sourceTree = ""; }; + 0E068A7B2DE5719900DE4DC9 /* SVGMarker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SVGMarker.swift; sourceTree = ""; }; 5815293F25B6C8F600E8D23A /* SVGPaint.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SVGPaint.swift; sourceTree = ""; }; 5815294325B6C90F00E8D23A /* SVGColor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SVGColor.swift; sourceTree = ""; }; 5815298925B752E600E8D23A /* SVGPreserveAspectRatio.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SVGPreserveAspectRatio.swift; sourceTree = ""; }; @@ -372,6 +378,8 @@ 5BE3323924E144B200BB0D60 /* SVGText.swift */, 5B1018192536C64700105E9A /* SVGUserSpaceNode.swift */, 5B1017E625358E4400105E9A /* SVGViewport.swift */, + 0E068A7A2DE5719900DE4DC9 /* SVGDefs.swift */, + 0E068A7B2DE5719900DE4DC9 /* SVGMarker.swift */, ); path = Nodes; sourceTree = ""; @@ -601,6 +609,8 @@ 58A66522283E9A0100F1F6FD /* MBezierPath+Extension_macOS.swift in Sources */, 5B0BD94224EE66A400F23286 /* SVGView.swift in Sources */, 5BE3327124E144B200BB0D60 /* SVGFont.swift in Sources */, + 0E068A7C2DE5719A00DE4DC9 /* SVGDefs.swift in Sources */, + 0E068A7D2DE5719A00DE4DC9 /* SVGMarker.swift in Sources */, 5BE3326F24E144B200BB0D60 /* XMLNode.swift in Sources */, 5B1017E725358E4400105E9A /* SVGViewport.swift in Sources */, 582D0C262840189A00F945D8 /* SVGLinker.swift in Sources */, @@ -617,6 +627,8 @@ 582D0C2B28401A5600F945D8 /* SVGScreen.swift in Sources */, 58A66500283E999B00F1F6FD /* SVGGroup.swift in Sources */, 58A664F8283E977600F1F6FD /* SVGParserExtensions.swift in Sources */, + 0E068A7E2DE5719A00DE4DC9 /* SVGDefs.swift in Sources */, + 0E068A7F2DE5719A00DE4DC9 /* SVGMarker.swift in Sources */, 58A6650E283E99C100F1F6FD /* SVGDataImage.swift in Sources */, 582D0C272840189A00F945D8 /* SVGLinker.swift in Sources */, 585A5C2F25D007B6000E8B88 /* SVG11Tests.swift in Sources */, diff --git a/SVGViewTests/SVG11Tests.swift b/SVGViewTests/SVG11Tests.swift index a531daf..cc35bd2 100644 --- a/SVGViewTests/SVG11Tests.swift +++ b/SVGViewTests/SVG11Tests.swift @@ -153,6 +153,10 @@ class SVG11Tests: BaseTestCase { compareToReference("painting-fill-05-b") } + func testPaintingMarker01F() { + compareToReference("painting-marker-01-f") + } + func testPaintingStroke01T() { compareToReference("painting-stroke-01-t") } diff --git a/SVGViewTests/SVG12Tests.swift b/SVGViewTests/SVG12Tests.swift index 1982bda..b1b2883 100644 --- a/SVGViewTests/SVG12Tests.swift +++ b/SVGViewTests/SVG12Tests.swift @@ -56,7 +56,7 @@ class SVG12Tests: BaseTestCase { func testPaintFill04T() { compareToReference("paint-fill-04-t") } - + func testPaintFill06T() { compareToReference("paint-fill-06-t") } diff --git a/SVGViewTests/SVGRefGenerator.swift b/SVGViewTests/SVGRefGenerator.swift index 60f2009..84c2381 100644 --- a/SVGViewTests/SVGRefGenerator.swift +++ b/SVGViewTests/SVGRefGenerator.swift @@ -46,6 +46,7 @@ class SVGRefGenerator: XCTestCase { createReference(name: "masking-opacity-01-b", version: v11) createReference(name: "painting-control-02-f", version: v11) createReference(name: "painting-control-03-f", version: v11) + createReference(name: "painting-marker-01-f", version: v11) createReference(name: "painting-fill-01-t", version: v11) createReference(name: "painting-fill-02-t", version: v11) createReference(name: "painting-fill-03-t", version: v11) @@ -129,6 +130,7 @@ class SVGRefGenerator: XCTestCase { createReference(name: "paint-color-03-t", version: v12) createReference(name: "paint-color-201-t", version: v12) createReference(name: "paint-fill-04-t", version: v12) + createReference(name: "paint-fill-06-t", version: v12) createReference(name: "paint-stroke-01-t", version: v12) createReference(name: "paths-data-01-t", version: v12) createReference(name: "paths-data-02-t", version: v12) diff --git a/SVGViewTests/w3c/1.1F2/refs/color-prop-01-b.ref b/SVGViewTests/w3c/1.1F2/refs/color-prop-01-b.ref index 6fa6428..539735a 100644 --- a/SVGViewTests/w3c/1.1F2/refs/color-prop-01-b.ref +++ b/SVGViewTests/w3c/1.1F2/refs/color-prop-01-b.ref @@ -1,10 +1,13 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ + SVGDefs { }, SVGGroup { contents: [ SVGGroup { diff --git a/SVGViewTests/w3c/1.1F2/refs/color-prop-02-f.ref b/SVGViewTests/w3c/1.1F2/refs/color-prop-02-f.ref index 12da7d2..4b7921d 100644 --- a/SVGViewTests/w3c/1.1F2/refs/color-prop-02-f.ref +++ b/SVGViewTests/w3c/1.1F2/refs/color-prop-02-f.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/color-prop-03-t.ref b/SVGViewTests/w3c/1.1F2/refs/color-prop-03-t.ref index 1b2cfb9..f8a381b 100644 --- a/SVGViewTests/w3c/1.1F2/refs/color-prop-03-t.ref +++ b/SVGViewTests/w3c/1.1F2/refs/color-prop-03-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/color-prop-04-t.ref b/SVGViewTests/w3c/1.1F2/refs/color-prop-04-t.ref index 0c8c283..a241920 100644 --- a/SVGViewTests/w3c/1.1F2/refs/color-prop-04-t.ref +++ b/SVGViewTests/w3c/1.1F2/refs/color-prop-04-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/color-prop-05-t.ref b/SVGViewTests/w3c/1.1F2/refs/color-prop-05-t.ref index 19141af..a8e3ad7 100644 --- a/SVGViewTests/w3c/1.1F2/refs/color-prop-05-t.ref +++ b/SVGViewTests/w3c/1.1F2/refs/color-prop-05-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/coords-coord-01-t.ref b/SVGViewTests/w3c/1.1F2/refs/coords-coord-01-t.ref index 8c05b11..e90fac8 100644 --- a/SVGViewTests/w3c/1.1F2/refs/coords-coord-01-t.ref +++ b/SVGViewTests/w3c/1.1F2/refs/coords-coord-01-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/coords-coord-02-t.ref b/SVGViewTests/w3c/1.1F2/refs/coords-coord-02-t.ref index e3bea53..ca4d2ee 100644 --- a/SVGViewTests/w3c/1.1F2/refs/coords-coord-02-t.ref +++ b/SVGViewTests/w3c/1.1F2/refs/coords-coord-02-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/coords-trans-01-b.ref b/SVGViewTests/w3c/1.1F2/refs/coords-trans-01-b.ref index 0441491..13d0dc5 100644 --- a/SVGViewTests/w3c/1.1F2/refs/coords-trans-01-b.ref +++ b/SVGViewTests/w3c/1.1F2/refs/coords-trans-01-b.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/coords-trans-02-t.ref b/SVGViewTests/w3c/1.1F2/refs/coords-trans-02-t.ref index 9a763c8..3849643 100644 --- a/SVGViewTests/w3c/1.1F2/refs/coords-trans-02-t.ref +++ b/SVGViewTests/w3c/1.1F2/refs/coords-trans-02-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/coords-trans-03-t.ref b/SVGViewTests/w3c/1.1F2/refs/coords-trans-03-t.ref index a540963..8d09c3d 100644 --- a/SVGViewTests/w3c/1.1F2/refs/coords-trans-03-t.ref +++ b/SVGViewTests/w3c/1.1F2/refs/coords-trans-03-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/coords-trans-04-t.ref b/SVGViewTests/w3c/1.1F2/refs/coords-trans-04-t.ref index 2b88abe..117e086 100644 --- a/SVGViewTests/w3c/1.1F2/refs/coords-trans-04-t.ref +++ b/SVGViewTests/w3c/1.1F2/refs/coords-trans-04-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/coords-trans-05-t.ref b/SVGViewTests/w3c/1.1F2/refs/coords-trans-05-t.ref index d611929..1fb0ce9 100644 --- a/SVGViewTests/w3c/1.1F2/refs/coords-trans-05-t.ref +++ b/SVGViewTests/w3c/1.1F2/refs/coords-trans-05-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/coords-trans-06-t.ref b/SVGViewTests/w3c/1.1F2/refs/coords-trans-06-t.ref index f5ae544..53e1cc0 100644 --- a/SVGViewTests/w3c/1.1F2/refs/coords-trans-06-t.ref +++ b/SVGViewTests/w3c/1.1F2/refs/coords-trans-06-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/coords-trans-07-t.ref b/SVGViewTests/w3c/1.1F2/refs/coords-trans-07-t.ref index 6f588a2..729b4fd 100644 --- a/SVGViewTests/w3c/1.1F2/refs/coords-trans-07-t.ref +++ b/SVGViewTests/w3c/1.1F2/refs/coords-trans-07-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/coords-trans-08-t.ref b/SVGViewTests/w3c/1.1F2/refs/coords-trans-08-t.ref index 4ff220c..8628601 100644 --- a/SVGViewTests/w3c/1.1F2/refs/coords-trans-08-t.ref +++ b/SVGViewTests/w3c/1.1F2/refs/coords-trans-08-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/coords-trans-09-t.ref b/SVGViewTests/w3c/1.1F2/refs/coords-trans-09-t.ref index 92c216a..21dbe9d 100644 --- a/SVGViewTests/w3c/1.1F2/refs/coords-trans-09-t.ref +++ b/SVGViewTests/w3c/1.1F2/refs/coords-trans-09-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/coords-trans-10-f.ref b/SVGViewTests/w3c/1.1F2/refs/coords-trans-10-f.ref index d270387..e8314f4 100644 --- a/SVGViewTests/w3c/1.1F2/refs/coords-trans-10-f.ref +++ b/SVGViewTests/w3c/1.1F2/refs/coords-trans-10-f.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/coords-trans-11-f.ref b/SVGViewTests/w3c/1.1F2/refs/coords-trans-11-f.ref index 021ca5c..a74059e 100644 --- a/SVGViewTests/w3c/1.1F2/refs/coords-trans-11-f.ref +++ b/SVGViewTests/w3c/1.1F2/refs/coords-trans-11-f.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/coords-trans-12-f.ref b/SVGViewTests/w3c/1.1F2/refs/coords-trans-12-f.ref index 437c260..a5a0321 100644 --- a/SVGViewTests/w3c/1.1F2/refs/coords-trans-12-f.ref +++ b/SVGViewTests/w3c/1.1F2/refs/coords-trans-12-f.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/coords-trans-13-f.ref b/SVGViewTests/w3c/1.1F2/refs/coords-trans-13-f.ref index be8ef6b..6427b6d 100644 --- a/SVGViewTests/w3c/1.1F2/refs/coords-trans-13-f.ref +++ b/SVGViewTests/w3c/1.1F2/refs/coords-trans-13-f.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/coords-trans-14-f.ref b/SVGViewTests/w3c/1.1F2/refs/coords-trans-14-f.ref index bccdf1a..1d19607 100644 --- a/SVGViewTests/w3c/1.1F2/refs/coords-trans-14-f.ref +++ b/SVGViewTests/w3c/1.1F2/refs/coords-trans-14-f.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/coords-transformattr-01-f.ref b/SVGViewTests/w3c/1.1F2/refs/coords-transformattr-01-f.ref index 5bc5ed8..d1c5347 100644 --- a/SVGViewTests/w3c/1.1F2/refs/coords-transformattr-01-f.ref +++ b/SVGViewTests/w3c/1.1F2/refs/coords-transformattr-01-f.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/coords-transformattr-02-f.ref b/SVGViewTests/w3c/1.1F2/refs/coords-transformattr-02-f.ref index 8e0e12f..57a7d92 100644 --- a/SVGViewTests/w3c/1.1F2/refs/coords-transformattr-02-f.ref +++ b/SVGViewTests/w3c/1.1F2/refs/coords-transformattr-02-f.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/coords-transformattr-03-f.ref b/SVGViewTests/w3c/1.1F2/refs/coords-transformattr-03-f.ref index 6f99e13..2973ad8 100644 --- a/SVGViewTests/w3c/1.1F2/refs/coords-transformattr-03-f.ref +++ b/SVGViewTests/w3c/1.1F2/refs/coords-transformattr-03-f.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/coords-transformattr-04-f.ref b/SVGViewTests/w3c/1.1F2/refs/coords-transformattr-04-f.ref index e45a281..fd9e50d 100644 --- a/SVGViewTests/w3c/1.1F2/refs/coords-transformattr-04-f.ref +++ b/SVGViewTests/w3c/1.1F2/refs/coords-transformattr-04-f.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/coords-transformattr-05-f.ref b/SVGViewTests/w3c/1.1F2/refs/coords-transformattr-05-f.ref index c778a43..4747df2 100644 --- a/SVGViewTests/w3c/1.1F2/refs/coords-transformattr-05-f.ref +++ b/SVGViewTests/w3c/1.1F2/refs/coords-transformattr-05-f.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/coords-units-02-b.ref b/SVGViewTests/w3c/1.1F2/refs/coords-units-02-b.ref index aafa245..514ff2b 100644 --- a/SVGViewTests/w3c/1.1F2/refs/coords-units-02-b.ref +++ b/SVGViewTests/w3c/1.1F2/refs/coords-units-02-b.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/coords-units-03-b.ref b/SVGViewTests/w3c/1.1F2/refs/coords-units-03-b.ref index eb573b8..4fc0f23 100644 --- a/SVGViewTests/w3c/1.1F2/refs/coords-units-03-b.ref +++ b/SVGViewTests/w3c/1.1F2/refs/coords-units-03-b.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/masking-opacity-01-b.ref b/SVGViewTests/w3c/1.1F2/refs/masking-opacity-01-b.ref index 5e24d45..99a9ac8 100644 --- a/SVGViewTests/w3c/1.1F2/refs/masking-opacity-01-b.ref +++ b/SVGViewTests/w3c/1.1F2/refs/masking-opacity-01-b.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/painting-control-02-f.ref b/SVGViewTests/w3c/1.1F2/refs/painting-control-02-f.ref index 438d779..20ad0ae 100644 --- a/SVGViewTests/w3c/1.1F2/refs/painting-control-02-f.ref +++ b/SVGViewTests/w3c/1.1F2/refs/painting-control-02-f.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/painting-control-03-f.ref b/SVGViewTests/w3c/1.1F2/refs/painting-control-03-f.ref index 575468f..e803553 100644 --- a/SVGViewTests/w3c/1.1F2/refs/painting-control-03-f.ref +++ b/SVGViewTests/w3c/1.1F2/refs/painting-control-03-f.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/painting-fill-01-t.ref b/SVGViewTests/w3c/1.1F2/refs/painting-fill-01-t.ref index a3083bd..26c032a 100644 --- a/SVGViewTests/w3c/1.1F2/refs/painting-fill-01-t.ref +++ b/SVGViewTests/w3c/1.1F2/refs/painting-fill-01-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/painting-fill-02-t.ref b/SVGViewTests/w3c/1.1F2/refs/painting-fill-02-t.ref index abc7257..e159796 100644 --- a/SVGViewTests/w3c/1.1F2/refs/painting-fill-02-t.ref +++ b/SVGViewTests/w3c/1.1F2/refs/painting-fill-02-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/painting-fill-03-t.ref b/SVGViewTests/w3c/1.1F2/refs/painting-fill-03-t.ref index 4adb331..fc0c78b 100644 --- a/SVGViewTests/w3c/1.1F2/refs/painting-fill-03-t.ref +++ b/SVGViewTests/w3c/1.1F2/refs/painting-fill-03-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/painting-fill-04-t.ref b/SVGViewTests/w3c/1.1F2/refs/painting-fill-04-t.ref index 3279865..1612fe5 100644 --- a/SVGViewTests/w3c/1.1F2/refs/painting-fill-04-t.ref +++ b/SVGViewTests/w3c/1.1F2/refs/painting-fill-04-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/painting-fill-05-b.ref b/SVGViewTests/w3c/1.1F2/refs/painting-fill-05-b.ref index 7e57753..ba68a68 100644 --- a/SVGViewTests/w3c/1.1F2/refs/painting-fill-05-b.ref +++ b/SVGViewTests/w3c/1.1F2/refs/painting-fill-05-b.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/painting-marker-01-f.ref b/SVGViewTests/w3c/1.1F2/refs/painting-marker-01-f.ref new file mode 100644 index 0000000..59cdbae --- /dev/null +++ b/SVGViewTests/w3c/1.1F2/refs/painting-marker-01-f.ref @@ -0,0 +1,226 @@ +SVGViewport { + id: "svg-root", + viewBox: { width: 480, height: 360 }, + scaling: "none", + contents: [ + SVGDefs { }, + SVGGroup { + id: "test-body-content", + contents: [ + SVGDefs { + contents: [ + SVGMarker { + id: "marker1", + contents: [ + SVGRect { width: 10, height: 10, fill: "purple" } + ], + markerHeight: "2", + markerUnits: "strokeWidth", + markerWidth: "2", + orient: "0.0", + scaling: "none", + refX: "5", + refY: "5", + viewBox: { width: 10, height: 10 } + }, + SVGMarker { + id: "marker2", + contents: [ + SVGPath { path: "M5,0 L10,10 L0,10 z", fill: "blue" } + ], + markerHeight: "2", + markerUnits: "strokeWidth", + markerWidth: "2", + orient: "auto", + scaling: "none", + refX: "5", + refY: "5", + viewBox: { width: 10, height: 10 } + }, + SVGMarker { + id: "markerStart", + contents: [ + SVGRect { width: 10, height: 10, fill: "purple" } + ], + markerHeight: "2", + markerUnits: "strokeWidth", + markerWidth: "2", + orient: "0.0", + scaling: "none", + refX: "5", + refY: "5", + viewBox: { width: 10, height: 10 } + }, + SVGMarker { + id: "markerMiddle", + contents: [ + SVGCircle { cx: 5, cy: 5, r: 5, fill: "green" } + ], + markerHeight: "2", + markerUnits: "strokeWidth", + markerWidth: "2", + orient: "0.0", + scaling: "none", + refX: "5", + refY: "5", + viewBox: { width: 10, height: 10 } + }, + SVGMarker { + id: "markerEnd", + contents: [ + SVGPath { path: "M5,0 L10,10 L0,10 z", fill: "blue" } + ], + markerHeight: "2", + markerUnits: "strokeWidth", + markerWidth: "2", + orient: "0.0", + scaling: "none", + refX: "5", + refY: "5", + viewBox: { width: 10, height: 10 } + } + ] + }, + SVGText { + text: "Basic Markers", + font: { name: "SVGFreeSansASCII,sans-serif", size: 14 }, + fill: "black", + transform: [1, 0, 0, 1, 170, 30] + }, + SVGPath { + path: "M130,40 L180,40 L180,90", + stroke: { fill: "black", width: 8 }, + marker-start: "marker1", + marker-mid: "marker1", + marker-end: "marker1" + }, + SVGGroup { + transform: [1, 0, 0, 1, 120, 0], + contents: [ + SVGPath { + path: "M130,40 L180,40 L180,90", + stroke: { fill: "black", width: 8 } + }, + SVGGroup { + transform: [1.6, 0, 0, 1.6, 122, 32], + contents: [ + SVGRect { width: 10, height: 10, fill: "purple" } + ] + }, + SVGGroup { + transform: [1.6, 0, 0, 1.6, 172, 32], + contents: [ + SVGRect { width: 10, height: 10, fill: "purple" } + ] + }, + SVGGroup { + transform: [1.6, 0, 0, 1.6, 172, 82], + contents: [ + SVGRect { width: 10, height: 10, fill: "purple" } + ] + } + ] + }, + SVGText { + text: "Start, Middle and End", + font: { name: "SVGFreeSansASCII,sans-serif", size: 14 }, + fill: "black", + transform: [1, 0, 0, 1, 145, 125] + }, + SVGPath { + path: "M130,135 L180,135 L180,185", + stroke: { fill: "black", width: 8 }, + marker-start: "markerStart", + marker-mid: "markerMiddle", + marker-end: "markerEnd" + }, + SVGGroup { + transform: [1, 0, 0, 1, 120, 0], + contents: [ + SVGPath { + path: "M130,135 L180,135 L180,185", + stroke: { fill: "black", width: 8 } + }, + SVGGroup { + transform: [1.6, 0, 0, 1.6, 122, 127], + contents: [ + SVGRect { width: 10, height: 10, fill: "purple" } + ] + }, + SVGGroup { + transform: [1.6, 0, 0, 1.6, 172, 127], + contents: [ + SVGCircle { cx: 5, cy: 5, r: 5, fill: "green" } + ] + }, + SVGGroup { + transform: [1.6, 0, 0, 1.6, 172, 177], + contents: [ + SVGPath { path: "M5,0 L10,10 L0,10 z", fill: "blue" } + ] + } + ] + }, + SVGText { + text: "Automatic Orientation", + font: { name: "SVGFreeSansASCII,sans-serif", size: 14 }, + fill: "black", + transform: [1, 0, 0, 1, 145, 220] + }, + SVGPath { + path: "M130,230 L180,230 L180,280", + stroke: { fill: "black", width: 8 }, + marker-start: "marker2", + marker-mid: "marker2", + marker-end: "marker2" + }, + SVGGroup { + transform: [1, 0, 0, 1, 120, 0], + contents: [ + SVGPath { + path: "M130,230 L180,230 L180,280", + stroke: { fill: "black", width: 8 } + }, + SVGGroup { + transform: [1.6, 0, 0, 1.6, 122, 222], + contents: [ + SVGPath { path: "M5,0 L10,10 L0,10 z", fill: "blue" } + ] + }, + SVGGroup { + transform: [1.1313708499, 1.1313708499, -1.1313708499, 1.1313708499, 180, 218.686291501], + contents: [ + SVGPath { path: "M5,0 L10,10 L0,10 z", fill: "blue" } + ] + }, + SVGGroup { + transform: [0, 1.6, -1.6, 0, 188, 272], + contents: [ + SVGPath { path: "M5,0 L10,10 L0,10 z", fill: "blue" } + ] + } + ] + } + ] + }, + SVGGroup { + contents: [ + SVGText { + id: "revision", + text: "$Revision: 1.7 $", + font: { name: "SVGFreeSansASCII,sans-serif", size: 32 }, + fill: "black", + transform: [1, 0, 0, 1, 10, 340] + } + ] + }, + SVGRect { + id: "test-frame", + x: 1, + y: 1, + width: 478, + height: 358, + stroke: { fill: "black" } + } + ] +} diff --git a/SVGViewTests/w3c/1.1F2/refs/painting-stroke-01-t.ref b/SVGViewTests/w3c/1.1F2/refs/painting-stroke-01-t.ref index e8d1187..854437f 100644 --- a/SVGViewTests/w3c/1.1F2/refs/painting-stroke-01-t.ref +++ b/SVGViewTests/w3c/1.1F2/refs/painting-stroke-01-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/painting-stroke-02-t.ref b/SVGViewTests/w3c/1.1F2/refs/painting-stroke-02-t.ref index c2f1f3c..8097b0b 100644 --- a/SVGViewTests/w3c/1.1F2/refs/painting-stroke-02-t.ref +++ b/SVGViewTests/w3c/1.1F2/refs/painting-stroke-02-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/painting-stroke-03-t.ref b/SVGViewTests/w3c/1.1F2/refs/painting-stroke-03-t.ref index ab5c8ca..ffe1090 100644 --- a/SVGViewTests/w3c/1.1F2/refs/painting-stroke-03-t.ref +++ b/SVGViewTests/w3c/1.1F2/refs/painting-stroke-03-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/painting-stroke-04-t.ref b/SVGViewTests/w3c/1.1F2/refs/painting-stroke-04-t.ref index 160b4fd..96cc1d7 100644 --- a/SVGViewTests/w3c/1.1F2/refs/painting-stroke-04-t.ref +++ b/SVGViewTests/w3c/1.1F2/refs/painting-stroke-04-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/painting-stroke-05-t.ref b/SVGViewTests/w3c/1.1F2/refs/painting-stroke-05-t.ref index c60eeae..9f21e11 100644 --- a/SVGViewTests/w3c/1.1F2/refs/painting-stroke-05-t.ref +++ b/SVGViewTests/w3c/1.1F2/refs/painting-stroke-05-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/painting-stroke-07-t.ref b/SVGViewTests/w3c/1.1F2/refs/painting-stroke-07-t.ref index addeb94..9af6da2 100644 --- a/SVGViewTests/w3c/1.1F2/refs/painting-stroke-07-t.ref +++ b/SVGViewTests/w3c/1.1F2/refs/painting-stroke-07-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/painting-stroke-08-t.ref b/SVGViewTests/w3c/1.1F2/refs/painting-stroke-08-t.ref index 6ed673b..bfd13b3 100644 --- a/SVGViewTests/w3c/1.1F2/refs/painting-stroke-08-t.ref +++ b/SVGViewTests/w3c/1.1F2/refs/painting-stroke-08-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/painting-stroke-09-t.ref b/SVGViewTests/w3c/1.1F2/refs/painting-stroke-09-t.ref index cc3d185..ef14c11 100644 --- a/SVGViewTests/w3c/1.1F2/refs/painting-stroke-09-t.ref +++ b/SVGViewTests/w3c/1.1F2/refs/painting-stroke-09-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/paths-data-01-t.ref b/SVGViewTests/w3c/1.1F2/refs/paths-data-01-t.ref index 61bf2c7..dcb04a2 100644 --- a/SVGViewTests/w3c/1.1F2/refs/paths-data-01-t.ref +++ b/SVGViewTests/w3c/1.1F2/refs/paths-data-01-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/paths-data-02-t.ref b/SVGViewTests/w3c/1.1F2/refs/paths-data-02-t.ref index fb06a5b..3edc1e8 100644 --- a/SVGViewTests/w3c/1.1F2/refs/paths-data-02-t.ref +++ b/SVGViewTests/w3c/1.1F2/refs/paths-data-02-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/paths-data-03-f.ref b/SVGViewTests/w3c/1.1F2/refs/paths-data-03-f.ref index 4795d08..1521411 100644 --- a/SVGViewTests/w3c/1.1F2/refs/paths-data-03-f.ref +++ b/SVGViewTests/w3c/1.1F2/refs/paths-data-03-f.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/paths-data-04-t.ref b/SVGViewTests/w3c/1.1F2/refs/paths-data-04-t.ref index c27c468..343db63 100644 --- a/SVGViewTests/w3c/1.1F2/refs/paths-data-04-t.ref +++ b/SVGViewTests/w3c/1.1F2/refs/paths-data-04-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/paths-data-05-t.ref b/SVGViewTests/w3c/1.1F2/refs/paths-data-05-t.ref index 124525d..1fd2131 100644 --- a/SVGViewTests/w3c/1.1F2/refs/paths-data-05-t.ref +++ b/SVGViewTests/w3c/1.1F2/refs/paths-data-05-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/paths-data-06-t.ref b/SVGViewTests/w3c/1.1F2/refs/paths-data-06-t.ref index 6ec79cc..5dba0ed 100644 --- a/SVGViewTests/w3c/1.1F2/refs/paths-data-06-t.ref +++ b/SVGViewTests/w3c/1.1F2/refs/paths-data-06-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/paths-data-07-t.ref b/SVGViewTests/w3c/1.1F2/refs/paths-data-07-t.ref index 60e1159..897aaa3 100644 --- a/SVGViewTests/w3c/1.1F2/refs/paths-data-07-t.ref +++ b/SVGViewTests/w3c/1.1F2/refs/paths-data-07-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/paths-data-08-t.ref b/SVGViewTests/w3c/1.1F2/refs/paths-data-08-t.ref index a651ecd..7679107 100644 --- a/SVGViewTests/w3c/1.1F2/refs/paths-data-08-t.ref +++ b/SVGViewTests/w3c/1.1F2/refs/paths-data-08-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/paths-data-09-t.ref b/SVGViewTests/w3c/1.1F2/refs/paths-data-09-t.ref index e40f4c9..f58ab78 100644 --- a/SVGViewTests/w3c/1.1F2/refs/paths-data-09-t.ref +++ b/SVGViewTests/w3c/1.1F2/refs/paths-data-09-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/paths-data-10-t.ref b/SVGViewTests/w3c/1.1F2/refs/paths-data-10-t.ref index 50ca797..a962462 100644 --- a/SVGViewTests/w3c/1.1F2/refs/paths-data-10-t.ref +++ b/SVGViewTests/w3c/1.1F2/refs/paths-data-10-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/paths-data-12-t.ref b/SVGViewTests/w3c/1.1F2/refs/paths-data-12-t.ref index fd0d7b5..01dad04 100644 --- a/SVGViewTests/w3c/1.1F2/refs/paths-data-12-t.ref +++ b/SVGViewTests/w3c/1.1F2/refs/paths-data-12-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/paths-data-13-t.ref b/SVGViewTests/w3c/1.1F2/refs/paths-data-13-t.ref index 95aa311..7eb3b76 100644 --- a/SVGViewTests/w3c/1.1F2/refs/paths-data-13-t.ref +++ b/SVGViewTests/w3c/1.1F2/refs/paths-data-13-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/paths-data-14-t.ref b/SVGViewTests/w3c/1.1F2/refs/paths-data-14-t.ref index 900a2be..1d9c783 100644 --- a/SVGViewTests/w3c/1.1F2/refs/paths-data-14-t.ref +++ b/SVGViewTests/w3c/1.1F2/refs/paths-data-14-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/paths-data-15-t.ref b/SVGViewTests/w3c/1.1F2/refs/paths-data-15-t.ref index 9d36c2a..2b91a08 100644 --- a/SVGViewTests/w3c/1.1F2/refs/paths-data-15-t.ref +++ b/SVGViewTests/w3c/1.1F2/refs/paths-data-15-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/paths-data-16-t.ref b/SVGViewTests/w3c/1.1F2/refs/paths-data-16-t.ref index cdd6f63..cb856cd 100644 --- a/SVGViewTests/w3c/1.1F2/refs/paths-data-16-t.ref +++ b/SVGViewTests/w3c/1.1F2/refs/paths-data-16-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/paths-data-17-f.ref b/SVGViewTests/w3c/1.1F2/refs/paths-data-17-f.ref index a0d5da5..99dac83 100644 --- a/SVGViewTests/w3c/1.1F2/refs/paths-data-17-f.ref +++ b/SVGViewTests/w3c/1.1F2/refs/paths-data-17-f.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/paths-data-18-f.ref b/SVGViewTests/w3c/1.1F2/refs/paths-data-18-f.ref index 5ca86c2..3fbeeae 100644 --- a/SVGViewTests/w3c/1.1F2/refs/paths-data-18-f.ref +++ b/SVGViewTests/w3c/1.1F2/refs/paths-data-18-f.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/paths-data-19-f.ref b/SVGViewTests/w3c/1.1F2/refs/paths-data-19-f.ref index df05762..3d5cef9 100644 --- a/SVGViewTests/w3c/1.1F2/refs/paths-data-19-f.ref +++ b/SVGViewTests/w3c/1.1F2/refs/paths-data-19-f.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/paths-data-20-f.ref b/SVGViewTests/w3c/1.1F2/refs/paths-data-20-f.ref index bace40f..658cf87 100644 --- a/SVGViewTests/w3c/1.1F2/refs/paths-data-20-f.ref +++ b/SVGViewTests/w3c/1.1F2/refs/paths-data-20-f.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/pservers-grad-01-b.ref b/SVGViewTests/w3c/1.1F2/refs/pservers-grad-01-b.ref index af9c1b6..79ea6b5 100644 --- a/SVGViewTests/w3c/1.1F2/refs/pservers-grad-01-b.ref +++ b/SVGViewTests/w3c/1.1F2/refs/pservers-grad-01-b.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/pservers-grad-02-b.ref b/SVGViewTests/w3c/1.1F2/refs/pservers-grad-02-b.ref index 363a4e0..c183595 100644 --- a/SVGViewTests/w3c/1.1F2/refs/pservers-grad-02-b.ref +++ b/SVGViewTests/w3c/1.1F2/refs/pservers-grad-02-b.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/pservers-grad-04-b.ref b/SVGViewTests/w3c/1.1F2/refs/pservers-grad-04-b.ref index 30dbefa..cb822a2 100644 --- a/SVGViewTests/w3c/1.1F2/refs/pservers-grad-04-b.ref +++ b/SVGViewTests/w3c/1.1F2/refs/pservers-grad-04-b.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/pservers-grad-05-b.ref b/SVGViewTests/w3c/1.1F2/refs/pservers-grad-05-b.ref index ffafc11..570b646 100644 --- a/SVGViewTests/w3c/1.1F2/refs/pservers-grad-05-b.ref +++ b/SVGViewTests/w3c/1.1F2/refs/pservers-grad-05-b.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/pservers-grad-07-b.ref b/SVGViewTests/w3c/1.1F2/refs/pservers-grad-07-b.ref index 21caf6b..7e84727 100644 --- a/SVGViewTests/w3c/1.1F2/refs/pservers-grad-07-b.ref +++ b/SVGViewTests/w3c/1.1F2/refs/pservers-grad-07-b.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/pservers-grad-09-b.ref b/SVGViewTests/w3c/1.1F2/refs/pservers-grad-09-b.ref index 05a789f..71724c2 100644 --- a/SVGViewTests/w3c/1.1F2/refs/pservers-grad-09-b.ref +++ b/SVGViewTests/w3c/1.1F2/refs/pservers-grad-09-b.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/render-elems-01-t.ref b/SVGViewTests/w3c/1.1F2/refs/render-elems-01-t.ref index 99fb6e1..b036bf9 100644 --- a/SVGViewTests/w3c/1.1F2/refs/render-elems-01-t.ref +++ b/SVGViewTests/w3c/1.1F2/refs/render-elems-01-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/render-elems-02-t.ref b/SVGViewTests/w3c/1.1F2/refs/render-elems-02-t.ref index 8d2f4ea..c49ca62 100644 --- a/SVGViewTests/w3c/1.1F2/refs/render-elems-02-t.ref +++ b/SVGViewTests/w3c/1.1F2/refs/render-elems-02-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/render-elems-03-t.ref b/SVGViewTests/w3c/1.1F2/refs/render-elems-03-t.ref index 532bbce..e74231a 100644 --- a/SVGViewTests/w3c/1.1F2/refs/render-elems-03-t.ref +++ b/SVGViewTests/w3c/1.1F2/refs/render-elems-03-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/shapes-circle-01-t.ref b/SVGViewTests/w3c/1.1F2/refs/shapes-circle-01-t.ref index 7eb9f99..ad98bb4 100644 --- a/SVGViewTests/w3c/1.1F2/refs/shapes-circle-01-t.ref +++ b/SVGViewTests/w3c/1.1F2/refs/shapes-circle-01-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/shapes-circle-02-t.ref b/SVGViewTests/w3c/1.1F2/refs/shapes-circle-02-t.ref index bc1be4d..6afb6c5 100644 --- a/SVGViewTests/w3c/1.1F2/refs/shapes-circle-02-t.ref +++ b/SVGViewTests/w3c/1.1F2/refs/shapes-circle-02-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/shapes-ellipse-01-t.ref b/SVGViewTests/w3c/1.1F2/refs/shapes-ellipse-01-t.ref index 8bea217..ceda1a4 100644 --- a/SVGViewTests/w3c/1.1F2/refs/shapes-ellipse-01-t.ref +++ b/SVGViewTests/w3c/1.1F2/refs/shapes-ellipse-01-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/shapes-ellipse-02-t.ref b/SVGViewTests/w3c/1.1F2/refs/shapes-ellipse-02-t.ref index c5e8d7e..70846b9 100644 --- a/SVGViewTests/w3c/1.1F2/refs/shapes-ellipse-02-t.ref +++ b/SVGViewTests/w3c/1.1F2/refs/shapes-ellipse-02-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/shapes-ellipse-03-f.ref b/SVGViewTests/w3c/1.1F2/refs/shapes-ellipse-03-f.ref index 3fa2b0c..da1a2fe 100644 --- a/SVGViewTests/w3c/1.1F2/refs/shapes-ellipse-03-f.ref +++ b/SVGViewTests/w3c/1.1F2/refs/shapes-ellipse-03-f.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/shapes-grammar-01-f.ref b/SVGViewTests/w3c/1.1F2/refs/shapes-grammar-01-f.ref index cd378bc..d18f908 100644 --- a/SVGViewTests/w3c/1.1F2/refs/shapes-grammar-01-f.ref +++ b/SVGViewTests/w3c/1.1F2/refs/shapes-grammar-01-f.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/shapes-intro-01-t.ref b/SVGViewTests/w3c/1.1F2/refs/shapes-intro-01-t.ref index 65d03b6..3dc4178 100644 --- a/SVGViewTests/w3c/1.1F2/refs/shapes-intro-01-t.ref +++ b/SVGViewTests/w3c/1.1F2/refs/shapes-intro-01-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/shapes-line-01-t.ref b/SVGViewTests/w3c/1.1F2/refs/shapes-line-01-t.ref index 3a49e4c..5de824f 100644 --- a/SVGViewTests/w3c/1.1F2/refs/shapes-line-01-t.ref +++ b/SVGViewTests/w3c/1.1F2/refs/shapes-line-01-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/shapes-line-02-f.ref b/SVGViewTests/w3c/1.1F2/refs/shapes-line-02-f.ref index 1374d34..c2bd6cc 100644 --- a/SVGViewTests/w3c/1.1F2/refs/shapes-line-02-f.ref +++ b/SVGViewTests/w3c/1.1F2/refs/shapes-line-02-f.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/shapes-polygon-01-t.ref b/SVGViewTests/w3c/1.1F2/refs/shapes-polygon-01-t.ref index 3cdabe7..2da47d9 100644 --- a/SVGViewTests/w3c/1.1F2/refs/shapes-polygon-01-t.ref +++ b/SVGViewTests/w3c/1.1F2/refs/shapes-polygon-01-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/shapes-polygon-02-t.ref b/SVGViewTests/w3c/1.1F2/refs/shapes-polygon-02-t.ref index 1724970..cb9cda8 100644 --- a/SVGViewTests/w3c/1.1F2/refs/shapes-polygon-02-t.ref +++ b/SVGViewTests/w3c/1.1F2/refs/shapes-polygon-02-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/shapes-polygon-03-t.ref b/SVGViewTests/w3c/1.1F2/refs/shapes-polygon-03-t.ref index 02b5af7..9c27077 100644 --- a/SVGViewTests/w3c/1.1F2/refs/shapes-polygon-03-t.ref +++ b/SVGViewTests/w3c/1.1F2/refs/shapes-polygon-03-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/shapes-polyline-01-t.ref b/SVGViewTests/w3c/1.1F2/refs/shapes-polyline-01-t.ref index 1eb54b9..fc2e900 100644 --- a/SVGViewTests/w3c/1.1F2/refs/shapes-polyline-01-t.ref +++ b/SVGViewTests/w3c/1.1F2/refs/shapes-polyline-01-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/shapes-polyline-02-t.ref b/SVGViewTests/w3c/1.1F2/refs/shapes-polyline-02-t.ref index e219c68..2547c93 100644 --- a/SVGViewTests/w3c/1.1F2/refs/shapes-polyline-02-t.ref +++ b/SVGViewTests/w3c/1.1F2/refs/shapes-polyline-02-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/shapes-rect-02-t.ref b/SVGViewTests/w3c/1.1F2/refs/shapes-rect-02-t.ref index 32db594..2154a62 100644 --- a/SVGViewTests/w3c/1.1F2/refs/shapes-rect-02-t.ref +++ b/SVGViewTests/w3c/1.1F2/refs/shapes-rect-02-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/shapes-rect-04-f.ref b/SVGViewTests/w3c/1.1F2/refs/shapes-rect-04-f.ref index c851658..db3527d 100644 --- a/SVGViewTests/w3c/1.1F2/refs/shapes-rect-04-f.ref +++ b/SVGViewTests/w3c/1.1F2/refs/shapes-rect-04-f.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/shapes-rect-05-f.ref b/SVGViewTests/w3c/1.1F2/refs/shapes-rect-05-f.ref index 9781b63..b3aa9e5 100644 --- a/SVGViewTests/w3c/1.1F2/refs/shapes-rect-05-f.ref +++ b/SVGViewTests/w3c/1.1F2/refs/shapes-rect-05-f.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/shapes-rect-06-f.ref b/SVGViewTests/w3c/1.1F2/refs/shapes-rect-06-f.ref index d75c1bb..832c696 100644 --- a/SVGViewTests/w3c/1.1F2/refs/shapes-rect-06-f.ref +++ b/SVGViewTests/w3c/1.1F2/refs/shapes-rect-06-f.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/struct-defs-01-t.ref b/SVGViewTests/w3c/1.1F2/refs/struct-defs-01-t.ref index 85e5c2e..56403f7 100644 --- a/SVGViewTests/w3c/1.1F2/refs/struct-defs-01-t.ref +++ b/SVGViewTests/w3c/1.1F2/refs/struct-defs-01-t.ref @@ -1,11 +1,24 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ - SVGRect { x: 140, y: 80, width: 200, height: 200, fill: "lime" } + SVGDefs { + id: "references", + contents: [ + SVGRect { id: "rect11", width: 480, height: 360, fill: "black" } + ] + }, + SVGRect { x: 140, y: 80, width: 200, height: 200, fill: "lime" }, + SVGDefs { + contents: [ + SVGRect { x: 160, y: 100, width: 160, height: 160, fill: "red" } + ] + } ] }, SVGGroup { diff --git a/SVGViewTests/w3c/1.1F2/refs/struct-frag-01-t.ref b/SVGViewTests/w3c/1.1F2/refs/struct-frag-01-t.ref index 838e9d0..afae494 100644 --- a/SVGViewTests/w3c/1.1F2/refs/struct-frag-01-t.ref +++ b/SVGViewTests/w3c/1.1F2/refs/struct-frag-01-t.ref @@ -1,6 +1,8 @@ SVGViewport { id: "svg-root", + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content" } ] } diff --git a/SVGViewTests/w3c/1.1F2/refs/struct-frag-06-t.ref b/SVGViewTests/w3c/1.1F2/refs/struct-frag-06-t.ref index 2342b41..7bdd31b 100644 --- a/SVGViewTests/w3c/1.1F2/refs/struct-frag-06-t.ref +++ b/SVGViewTests/w3c/1.1F2/refs/struct-frag-06-t.ref @@ -2,6 +2,7 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/struct-group-01-t.ref b/SVGViewTests/w3c/1.1F2/refs/struct-group-01-t.ref index 221d508..86b2d5e 100644 --- a/SVGViewTests/w3c/1.1F2/refs/struct-group-01-t.ref +++ b/SVGViewTests/w3c/1.1F2/refs/struct-group-01-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/struct-image-01-t.ref b/SVGViewTests/w3c/1.1F2/refs/struct-image-01-t.ref index 1ab27ac..8c1e39a 100644 --- a/SVGViewTests/w3c/1.1F2/refs/struct-image-01-t.ref +++ b/SVGViewTests/w3c/1.1F2/refs/struct-image-01-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/struct-image-04-t.ref b/SVGViewTests/w3c/1.1F2/refs/struct-image-04-t.ref index 33ad043..6e47940 100644 --- a/SVGViewTests/w3c/1.1F2/refs/struct-image-04-t.ref +++ b/SVGViewTests/w3c/1.1F2/refs/struct-image-04-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/struct-use-03-t.ref b/SVGViewTests/w3c/1.1F2/refs/struct-use-03-t.ref index 63d5e38..9c7652e 100644 --- a/SVGViewTests/w3c/1.1F2/refs/struct-use-03-t.ref +++ b/SVGViewTests/w3c/1.1F2/refs/struct-use-03-t.ref @@ -1,10 +1,23 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ + SVGDefs { + contents: [ + SVGRect { + id: "usedRect", + width: 100, + height: 100, + fill: "aqua", + stroke: { fill: "blue", width: 20 } + } + ] + }, SVGText { text: "Reference", font: { name: "SVGFreeSansASCII,sans-serif", size: 18 }, diff --git a/SVGViewTests/w3c/1.1F2/refs/styling-class-01-f.ref b/SVGViewTests/w3c/1.1F2/refs/styling-class-01-f.ref index 5ac1e34..9c79786 100644 --- a/SVGViewTests/w3c/1.1F2/refs/styling-class-01-f.ref +++ b/SVGViewTests/w3c/1.1F2/refs/styling-class-01-f.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/styling-css-01-b.ref b/SVGViewTests/w3c/1.1F2/refs/styling-css-01-b.ref index e93be1b..d7afd92 100644 --- a/SVGViewTests/w3c/1.1F2/refs/styling-css-01-b.ref +++ b/SVGViewTests/w3c/1.1F2/refs/styling-css-01-b.ref @@ -1,10 +1,17 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ + SVGDefs { + contents: [ + SVGDefs { } + ] + }, SVGText { text: "element selectors:", font: { name: "SVGFreeSansASCII,sans-serif", size: 12 }, diff --git a/SVGViewTests/w3c/1.1F2/refs/styling-pres-01-t.ref b/SVGViewTests/w3c/1.1F2/refs/styling-pres-01-t.ref index 9a54752..5d9e2aa 100644 --- a/SVGViewTests/w3c/1.1F2/refs/styling-pres-01-t.ref +++ b/SVGViewTests/w3c/1.1F2/refs/styling-pres-01-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.1F2/refs/types-basic-01-f.ref b/SVGViewTests/w3c/1.1F2/refs/types-basic-01-f.ref index f6cd430..0367218 100644 --- a/SVGViewTests/w3c/1.1F2/refs/types-basic-01-f.ref +++ b/SVGViewTests/w3c/1.1F2/refs/types-basic-01-f.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.2T/refs/coords-trans-01-t.ref b/SVGViewTests/w3c/1.2T/refs/coords-trans-01-t.ref index 88f5029..61ab041 100644 --- a/SVGViewTests/w3c/1.2T/refs/coords-trans-01-t.ref +++ b/SVGViewTests/w3c/1.2T/refs/coords-trans-01-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.2T/refs/coords-trans-02-t.ref b/SVGViewTests/w3c/1.2T/refs/coords-trans-02-t.ref index 6378b1c..4f81059 100644 --- a/SVGViewTests/w3c/1.2T/refs/coords-trans-02-t.ref +++ b/SVGViewTests/w3c/1.2T/refs/coords-trans-02-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.2T/refs/coords-trans-03-t.ref b/SVGViewTests/w3c/1.2T/refs/coords-trans-03-t.ref index b3cf351..d5a9d74 100644 --- a/SVGViewTests/w3c/1.2T/refs/coords-trans-03-t.ref +++ b/SVGViewTests/w3c/1.2T/refs/coords-trans-03-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.2T/refs/coords-trans-04-t.ref b/SVGViewTests/w3c/1.2T/refs/coords-trans-04-t.ref index 48d3338..fb93788 100644 --- a/SVGViewTests/w3c/1.2T/refs/coords-trans-04-t.ref +++ b/SVGViewTests/w3c/1.2T/refs/coords-trans-04-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.2T/refs/coords-trans-05-t.ref b/SVGViewTests/w3c/1.2T/refs/coords-trans-05-t.ref index fb2563c..ee46056 100644 --- a/SVGViewTests/w3c/1.2T/refs/coords-trans-05-t.ref +++ b/SVGViewTests/w3c/1.2T/refs/coords-trans-05-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.2T/refs/coords-trans-06-t.ref b/SVGViewTests/w3c/1.2T/refs/coords-trans-06-t.ref index 9d50a8b..b1d5754 100644 --- a/SVGViewTests/w3c/1.2T/refs/coords-trans-06-t.ref +++ b/SVGViewTests/w3c/1.2T/refs/coords-trans-06-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.2T/refs/coords-trans-07-t.ref b/SVGViewTests/w3c/1.2T/refs/coords-trans-07-t.ref index 77452e6..86ba7c7 100644 --- a/SVGViewTests/w3c/1.2T/refs/coords-trans-07-t.ref +++ b/SVGViewTests/w3c/1.2T/refs/coords-trans-07-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.2T/refs/coords-trans-08-t.ref b/SVGViewTests/w3c/1.2T/refs/coords-trans-08-t.ref index 3921008..cd908f0 100644 --- a/SVGViewTests/w3c/1.2T/refs/coords-trans-08-t.ref +++ b/SVGViewTests/w3c/1.2T/refs/coords-trans-08-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.2T/refs/coords-trans-09-t.ref b/SVGViewTests/w3c/1.2T/refs/coords-trans-09-t.ref index e6ff258..1707091 100644 --- a/SVGViewTests/w3c/1.2T/refs/coords-trans-09-t.ref +++ b/SVGViewTests/w3c/1.2T/refs/coords-trans-09-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.2T/refs/paint-color-03-t.ref b/SVGViewTests/w3c/1.2T/refs/paint-color-03-t.ref index 5831043..94cfd37 100644 --- a/SVGViewTests/w3c/1.2T/refs/paint-color-03-t.ref +++ b/SVGViewTests/w3c/1.2T/refs/paint-color-03-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.2T/refs/paint-color-201-t.ref b/SVGViewTests/w3c/1.2T/refs/paint-color-201-t.ref index 23481fb..0f19a31 100644 --- a/SVGViewTests/w3c/1.2T/refs/paint-color-201-t.ref +++ b/SVGViewTests/w3c/1.2T/refs/paint-color-201-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.2T/refs/paint-fill-04-t.ref b/SVGViewTests/w3c/1.2T/refs/paint-fill-04-t.ref index 93f2b48..28fac19 100644 --- a/SVGViewTests/w3c/1.2T/refs/paint-fill-04-t.ref +++ b/SVGViewTests/w3c/1.2T/refs/paint-fill-04-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.2T/refs/paint-fill-06-t.ref b/SVGViewTests/w3c/1.2T/refs/paint-fill-06-t.ref index b601685..3ab6bb8 100644 --- a/SVGViewTests/w3c/1.2T/refs/paint-fill-06-t.ref +++ b/SVGViewTests/w3c/1.2T/refs/paint-fill-06-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.2T/refs/paint-stroke-01-t.ref b/SVGViewTests/w3c/1.2T/refs/paint-stroke-01-t.ref index 1adc022..185e55a 100644 --- a/SVGViewTests/w3c/1.2T/refs/paint-stroke-01-t.ref +++ b/SVGViewTests/w3c/1.2T/refs/paint-stroke-01-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.2T/refs/paths-data-01-t.ref b/SVGViewTests/w3c/1.2T/refs/paths-data-01-t.ref index 4cd7348..4a1be4c 100644 --- a/SVGViewTests/w3c/1.2T/refs/paths-data-01-t.ref +++ b/SVGViewTests/w3c/1.2T/refs/paths-data-01-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.2T/refs/paths-data-02-t.ref b/SVGViewTests/w3c/1.2T/refs/paths-data-02-t.ref index 0ca0d21..8a4daa1 100644 --- a/SVGViewTests/w3c/1.2T/refs/paths-data-02-t.ref +++ b/SVGViewTests/w3c/1.2T/refs/paths-data-02-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.2T/refs/render-elems-01-t.ref b/SVGViewTests/w3c/1.2T/refs/render-elems-01-t.ref index ed092af..9572deb 100644 --- a/SVGViewTests/w3c/1.2T/refs/render-elems-01-t.ref +++ b/SVGViewTests/w3c/1.2T/refs/render-elems-01-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.2T/refs/render-elems-02-t.ref b/SVGViewTests/w3c/1.2T/refs/render-elems-02-t.ref index 3455de3..1b6ece2 100644 --- a/SVGViewTests/w3c/1.2T/refs/render-elems-02-t.ref +++ b/SVGViewTests/w3c/1.2T/refs/render-elems-02-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.2T/refs/render-elems-03-t.ref b/SVGViewTests/w3c/1.2T/refs/render-elems-03-t.ref index 2540f88..e35ef99 100644 --- a/SVGViewTests/w3c/1.2T/refs/render-elems-03-t.ref +++ b/SVGViewTests/w3c/1.2T/refs/render-elems-03-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.2T/refs/shapes-circle-01-t.ref b/SVGViewTests/w3c/1.2T/refs/shapes-circle-01-t.ref index 2a207c9..1648e7b 100644 --- a/SVGViewTests/w3c/1.2T/refs/shapes-circle-01-t.ref +++ b/SVGViewTests/w3c/1.2T/refs/shapes-circle-01-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.2T/refs/shapes-ellipse-01-t.ref b/SVGViewTests/w3c/1.2T/refs/shapes-ellipse-01-t.ref index 684e985..f2f64cc 100644 --- a/SVGViewTests/w3c/1.2T/refs/shapes-ellipse-01-t.ref +++ b/SVGViewTests/w3c/1.2T/refs/shapes-ellipse-01-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.2T/refs/shapes-line-01-t.ref b/SVGViewTests/w3c/1.2T/refs/shapes-line-01-t.ref index 7c15c3f..ddf2c08 100644 --- a/SVGViewTests/w3c/1.2T/refs/shapes-line-01-t.ref +++ b/SVGViewTests/w3c/1.2T/refs/shapes-line-01-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.2T/refs/shapes-polygon-01-t.ref b/SVGViewTests/w3c/1.2T/refs/shapes-polygon-01-t.ref index 032d049..9d328d9 100644 --- a/SVGViewTests/w3c/1.2T/refs/shapes-polygon-01-t.ref +++ b/SVGViewTests/w3c/1.2T/refs/shapes-polygon-01-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.2T/refs/shapes-polyline-01-t.ref b/SVGViewTests/w3c/1.2T/refs/shapes-polyline-01-t.ref index 544e1df..393ce72 100644 --- a/SVGViewTests/w3c/1.2T/refs/shapes-polyline-01-t.ref +++ b/SVGViewTests/w3c/1.2T/refs/shapes-polyline-01-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.2T/refs/shapes-rect-02-t.ref b/SVGViewTests/w3c/1.2T/refs/shapes-rect-02-t.ref index b8edbc1..f25f6d4 100644 --- a/SVGViewTests/w3c/1.2T/refs/shapes-rect-02-t.ref +++ b/SVGViewTests/w3c/1.2T/refs/shapes-rect-02-t.ref @@ -1,7 +1,9 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ diff --git a/SVGViewTests/w3c/1.2T/refs/struct-defs-01-t.ref b/SVGViewTests/w3c/1.2T/refs/struct-defs-01-t.ref index 2b5904d..add1b17 100644 --- a/SVGViewTests/w3c/1.2T/refs/struct-defs-01-t.ref +++ b/SVGViewTests/w3c/1.2T/refs/struct-defs-01-t.ref @@ -1,10 +1,23 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ + SVGDefs { + id: "references", + contents: [ + SVGRect { id: "rect11", width: 480, height: 360, fill: "black" } + ] + }, + SVGDefs { + contents: [ + SVGRect { x: 160, y: 100, width: 160, height: 160, fill: "green" } + ] + }, SVGRect { x: 140, y: 80, width: 200, height: 200, fill: "red" } ] }, diff --git a/SVGViewTests/w3c/1.2T/refs/struct-frag-01-t.ref b/SVGViewTests/w3c/1.2T/refs/struct-frag-01-t.ref index 838e9d0..afae494 100644 --- a/SVGViewTests/w3c/1.2T/refs/struct-frag-01-t.ref +++ b/SVGViewTests/w3c/1.2T/refs/struct-frag-01-t.ref @@ -1,6 +1,8 @@ SVGViewport { id: "svg-root", + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content" } ] } diff --git a/SVGViewTests/w3c/1.2T/refs/struct-use-03-t.ref b/SVGViewTests/w3c/1.2T/refs/struct-use-03-t.ref index e60b944..1070873 100644 --- a/SVGViewTests/w3c/1.2T/refs/struct-use-03-t.ref +++ b/SVGViewTests/w3c/1.2T/refs/struct-use-03-t.ref @@ -1,10 +1,23 @@ SVGViewport { id: "svg-root", viewBox: { width: 480, height: 360 }, + scaling: "none", contents: [ + SVGDefs { }, SVGGroup { id: "test-body-content", contents: [ + SVGDefs { + contents: [ + SVGRect { + id: "usedRect", + width: 100, + height: 100, + fill: "#FADC00", + stroke: { fill: "#C82828", width: 20 } + } + ] + }, SVGText { text: "Reference", font: { name: "SVGFreeSansASCII,sans-serif", size: 18 }, diff --git a/Source/Model/Nodes/SVGDefs.swift b/Source/Model/Nodes/SVGDefs.swift new file mode 100644 index 0000000..525c76b --- /dev/null +++ b/Source/Model/Nodes/SVGDefs.swift @@ -0,0 +1,9 @@ +#if os(WASI) || os(Linux) +import Foundation +#else +import SwiftUI +import Combine +#endif + +public class SVGDefs: SVGGroup {} + diff --git a/Source/Model/Nodes/SVGGroup.swift b/Source/Model/Nodes/SVGGroup.swift index 406839a..ce143cc 100644 --- a/Source/Model/Nodes/SVGGroup.swift +++ b/Source/Model/Nodes/SVGGroup.swift @@ -11,7 +11,14 @@ public class SVGGroup: SVGNode { #else @Published public var contents: [SVGNode] = [] #endif - public init(contents: [SVGNode], transform: CGAffineTransform = .identity, opaque: Bool = true, opacity: Double = 1, clip: SVGUserSpaceNode? = nil, mask: SVGNode? = nil) { + public init( + contents: [SVGNode], + transform: CGAffineTransform = .identity, + opaque: Bool = true, + opacity: Double = 1, + clip: SVGUserSpaceNode? = nil, + mask: SVGNode? = nil + ) { super.init(transform: transform, opaque: opaque, opacity: opacity, clip: clip, mask: mask) self.contents = contents } diff --git a/Source/Model/Nodes/SVGMarker.swift b/Source/Model/Nodes/SVGMarker.swift new file mode 100644 index 0000000..c7ed050 --- /dev/null +++ b/Source/Model/Nodes/SVGMarker.swift @@ -0,0 +1,165 @@ +#if os(WASI) || os(Linux) +import Foundation +#else +import SwiftUI +import Combine +#endif + +public class SVGMarker: SVGGroup { + public enum Orient { + case auto + case autoStartReverse + case angle(Float) + + public init(rawValue: String) { + if rawValue == "auto" { + self = .auto + } else if rawValue == "auto-start-reverse" { + self = .autoStartReverse + } else if let angle = Float(rawValue) { + self = .angle(angle) + } else { + self = .angle(0) + } + } + + public func toString() -> String { + switch self { + case .auto: + return "auto" + case .autoStartReverse: + return "auto-start-reverse" + case .angle(let f): + return "\(f)" + } + } + } + + public enum RefMagnitude { + case left + case center + case right + case coordinate(SVGLength) + + public func toString() -> String { + switch self { + case .left: + return "left" + case .center: + return "center" + case .right: + return "right" + case .coordinate(let f): + return f.toString() + } + } + } + + public enum MarkerUnits: String, SerializableEnum { + case userSpaceOnUse + case strokeWidth + } + + #if os(WASI) || os(Linux) + public var markerHeight: SVGLength + public var markerUnits: MarkerUnits + public var markerWidth: SVGLength + public var orient: Orient + public var preserveAspectRatio: SVGPreserveAspectRatio + public var refX: RefMagnitude? + public var refY: RefMagnitude? + public var viewBox: CGRect? + #else + @Published public var markerHeight: SVGLength + @Published public var markerUnits: MarkerUnits + @Published public var markerWidth: SVGLength + @Published public var orient: Orient + @Published public var preserveAspectRatio: SVGPreserveAspectRatio + @Published public var refX: RefMagnitude? + @Published public var refY: RefMagnitude? + @Published public var viewBox: CGRect? + #endif + + public init( + markerHeight: SVGLength, + markerUnits: MarkerUnits, + markerWidth: SVGLength, + orient: Orient, + preserveAspectRatio: SVGPreserveAspectRatio, + refX: RefMagnitude?, + refY: RefMagnitude?, + viewBox: CGRect? = nil, + contents: [SVGNode] + ) { + self.markerHeight = markerHeight + self.markerUnits = markerUnits + self.markerWidth = markerWidth + self.orient = orient + self.preserveAspectRatio = preserveAspectRatio + self.refX = refX + self.refY = refY + self.viewBox = viewBox + super.init(contents: contents) + } + + override func serialize(_ serializer: Serializer) { + serializer.add("contents", contents) + serializer.add("markerHeight", markerHeight.toString(), "100%") + serializer.add("markerUnits", markerUnits) + serializer.add("markerWidth", markerWidth.toString(), "100%") + serializer.add("orient", orient.toString()) + + // preserveAspectRatio, please refer to the implementation in SVGViewport + serializer.add("scaling", preserveAspectRatio.scaling) + serializer.add("xAlign", preserveAspectRatio.xAlign) + serializer.add("yAlign", preserveAspectRatio.yAlign) + + if let refXStr = refX?.toString() { + serializer.add("refX", refXStr) + } + if let refYStr = refY?.toString() { + serializer.add("refY", refYStr) + } + + serializer.add("viewBox", viewBox) + + super.serialize(serializer) + + } + + #if canImport(SwiftUI) + public func contentView() -> some View { + SVGMarkerView(model: self) + } + #endif + + override var typeName: String { + return String(describing: type(of: self)) + } + + func parseContents(context: SVGNodeContext, delegate: (XMLElement) -> SVGNode?) -> [SVGNode] { + return context.element.contents + .compactMap { $0 as? XMLElement } + .compactMap { delegate($0) } + } +} + +#if canImport(SwiftUI) +struct SVGMarkerView: View { + + @ObservedObject var model: SVGMarker + + public var body: some View { + ZStack { + ForEach(0.. CGRect { diff --git a/Source/Model/Nodes/SVGShape.swift b/Source/Model/Nodes/SVGShape.swift index ea23743..e186de2 100644 --- a/Source/Model/Nodes/SVGShape.swift +++ b/Source/Model/Nodes/SVGShape.swift @@ -18,6 +18,9 @@ public class SVGShape: SVGNode { override func serialize(_ serializer: Serializer) { fill?.serialize(key: "fill", serializer: serializer) serializer.add("stroke", stroke) + serializer.add("marker-start", markerStart) + serializer.add("marker-mid", markerMid) + serializer.add("marker-end", markerEnd) super.serialize(serializer) } } diff --git a/Source/Parser/SVG/Elements/SVGElementParser.swift b/Source/Parser/SVG/Elements/SVGElementParser.swift index 527e1ca..4b1d1b8 100644 --- a/Source/Parser/SVG/Elements/SVGElementParser.swift +++ b/Source/Parser/SVG/Elements/SVGElementParser.swift @@ -28,6 +28,10 @@ class SVGBaseElementParser: SVGElementParser { } node.id = SVGHelper.parseId(context.properties) + + node.markerStart = SVGHelper.parseMarkerInAttribute(context.properties, key: "marker-start") + node.markerMid = SVGHelper.parseMarkerInAttribute(context.properties, key: "marker-mid") + node.markerEnd = SVGHelper.parseMarkerInAttribute(context.properties, key: "marker-end") return node } diff --git a/Source/Parser/SVG/Elements/SVGStructureParsers.swift b/Source/Parser/SVG/Elements/SVGStructureParsers.swift index 4a13745..1b1bb10 100644 --- a/Source/Parser/SVG/Elements/SVGStructureParsers.swift +++ b/Source/Parser/SVG/Elements/SVGStructureParsers.swift @@ -12,67 +12,13 @@ class SVGViewportParser: SVGGroupParser { override func doParse(context: SVGNodeContext, delegate: (XMLElement) -> SVGNode?) -> SVGNode? { let attributes = context.properties - let w = Self.parseDimension(attributes, "width") ?? SVGLength(percent: 100) - let h = Self.parseDimension(attributes, "height") ?? SVGLength(percent: 100) - let viewBox = Self.parseViewBox(attributes, context: context) - let par = Self.parsePreserveAspectRation(string: attributes["preserveAspectRatio"], context: context) + let w = SVGHelper.parseDimension(attributes, "width") ?? SVGLength(percent: 100) + let h = SVGHelper.parseDimension(attributes, "height") ?? SVGLength(percent: 100) + let viewBox = SVGHelper.parseViewBox(attributes, context: context) + let par = SVGHelper.parsePreserveAspectRatio(string: attributes["preserveAspectRatio"], context: context, defaultValue: SVGPreserveAspectRatio(scaling: SVGHelper.parseScaling("meet"), xAlign: .mid, yAlign: .mid)) return SVGViewport(width: w, height: h, viewBox: viewBox, preserveAspectRatio: par, contents: parseContents(context: context, delegate: delegate)) } - static func parseDimension(_ attributes: [String: String], _ key: String) -> SVGLength? { - guard let string = attributes[key] else { - return .none - } - if string.hasSuffix("%"), let value = Double(string.dropLast()) { - return SVGLength(percent: CGFloat(value)) - } - if let value = Double(string) { - return SVGLength(pixels: CGFloat(value)) - } - return .none - } - - static func parseViewBox(_ attributes: [String: String], context: SVGContext) -> CGRect? { - // TODO: temporary solution, all attributes should be case insensitive - if let string = attributes[ignoreCase: "viewBox"] { - let nums = string.components(separatedBy: .whitespaces) - if nums.count == 4, - let x = SVGLengthParser.xAxis.double(string: nums[0], context: context), - let y = SVGLengthParser.yAxis.double(string: nums[1], context: context), - let width = SVGLengthParser.xAxis.double(string: nums[2], context: context), - let height = SVGLengthParser.yAxis.double(string: nums[3], context: context) { - return CGRect(x: x, y: y, width: width, height: height) - } - } - return nil - } - - static func parsePreserveAspectRation(string: String?, context: SVGContext) -> SVGPreserveAspectRatio { - if let contentModeString = string { - let strings = contentModeString.components(separatedBy: CharacterSet(charactersIn: " ")) - if strings.count == 1 { // none - return SVGPreserveAspectRatio(scaling: parseScaling(strings[0])) - } - guard strings.count == 2 else { - context.log(message: "Invalid content mode \(contentModeString)") - return SVGPreserveAspectRatio() - } - - let alignString = strings[0] - var xAlign = alignString.prefix(4).lowercased() - xAlign.remove(at: xAlign.startIndex) - let xAligningMode = parseAlign(xAlign) - - var yAlign = alignString.suffix(4).lowercased() - yAlign.remove(at: yAlign.startIndex) - let yAligningMode = parseAlign(yAlign) - - let scalingMode = parseScaling(strings[1]) - return SVGPreserveAspectRatio(scaling: scalingMode, xAlign: xAligningMode, yAlign: yAligningMode) - } - return SVGPreserveAspectRatio() - } - static func parseAlign(_ string: String) -> SVGPreserveAspectRatio.Align { switch string { case "min": return .min @@ -119,3 +65,81 @@ class SVGUseParser: SVGBaseElementParser { return useNode } } + +class SVGVDefParser: SVGGroupParser { + override func doParse(context: SVGNodeContext, delegate: (XMLElement) -> SVGNode?) -> SVGNode? { + return SVGDefs(contents: parseContents(context: context, delegate: delegate)) + } + + override func parseContents(context: SVGNodeContext, delegate: (XMLElement) -> SVGNode?) -> [SVGNode] { + return context.element.contents + .compactMap { $0 as? XMLElement } + .compactMap { delegate($0) } + } +} + +class SVGMarkerParser: SVGBaseElementParser { + + override func doParse(context: SVGNodeContext, delegate: (XMLElement) -> SVGNode?) -> SVGNode? { + let attributes = context.properties + + let markerWidth = SVGHelper.parseDimension(attributes, "markerWidth") ?? SVGLength(percent: 100) + let markerHeight = SVGHelper.parseDimension(attributes, "markerHeight") ?? SVGLength(percent: 100) + let markerUnits = Self.parseMarkerUnits(attributes["markerUnits"]) + let orient = Self.parseOrient(attributes["orient"]) + let viewBox = SVGHelper.parseViewBox(attributes, context: context) + let par = SVGHelper.parsePreserveAspectRatio(string: attributes["preserveAspectRatio"], context: context, defaultValue: SVGPreserveAspectRatio(scaling: SVGHelper.parseScaling("meet"), xAlign: .mid, yAlign: .mid)) + let refX = Self.parseRefMagnitude(attributes, "refX") + let refY = Self.parseRefMagnitude(attributes, "refY") + return SVGMarker(markerHeight: markerHeight, markerUnits: markerUnits, markerWidth: markerWidth, orient: orient, preserveAspectRatio: par, refX: refX, refY: refY, viewBox: viewBox, contents: parseContents(context: context, delegate: delegate)) + } + + func parseContents(context: SVGNodeContext, delegate: (XMLElement) -> SVGNode?) -> [SVGNode] { + return context.element.contents + .compactMap { $0 as? XMLElement } + .compactMap { delegate($0) } + } + + static func parseMarkerUnits(_ string: String?) -> SVGMarker.MarkerUnits { + if let anchor = string { + if anchor == "userSpaceOnUse" { + return .userSpaceOnUse + } else if anchor == "strokeWidth" { + return .strokeWidth + } + } + return .strokeWidth + } + + static func parseOrient(_ value: String?) -> SVGMarker.Orient { + guard let value else { + return .angle(0) + } + if value == "auto" { + return .auto + } else if value == "auto-start-reverse" { + return .autoStartReverse + } else if let angle = Float(value) { + return .angle(angle) + } else { + return .angle(0) + } + } + + static func parseRefMagnitude(_ attributes: [String: String], _ key: String) -> SVGMarker.RefMagnitude? { + guard let value = attributes[key] else { + return nil + } + if value == "right" { + return .right + } else if value == "left" { + return .left + } else if value == "center" { + return .center + } else if let magnitude = SVGHelper.parseDimension(attributes, key) { + return .coordinate(magnitude) + } else { + return nil + } + } +} diff --git a/Source/Parser/SVG/SVGContext.swift b/Source/Parser/SVG/SVGContext.swift index 2bd58ea..5506fcc 100644 --- a/Source/Parser/SVG/SVGContext.swift +++ b/Source/Parser/SVG/SVGContext.swift @@ -115,7 +115,7 @@ class SVGNodeContext: SVGContext { private static func replaceRoot(element: XMLElement, context: SVGContext) -> SVGRootContext { if element.name == "svg" { - if let viewBox = SVGViewportParser.parseViewBox(element.attributes, context: context) { + if let viewBox = SVGHelper.parseViewBox(element.attributes, context: context) { let screen = SVGScreen(ppi: context.screen.ppi, width: viewBox.width, height: viewBox.height) return SVGRootContext(logger: context.logger, linker: context.linker, screen: screen, index: context.index, defaultFontSize: context.defaultFontSize) } diff --git a/Source/Parser/SVG/SVGParser.swift b/Source/Parser/SVG/SVGParser.swift index 125970e..1c11de2 100644 --- a/Source/Parser/SVG/SVGParser.swift +++ b/Source/Parser/SVG/SVGParser.swift @@ -63,6 +63,8 @@ public struct SVGParser { "polygon": SVGPolygonParser(), "polyline": SVGPolylineParser(), "path": SVGPathParser(), + "marker": SVGMarkerParser(), + "defs": SVGVDefParser(), ] private static func parse(context: SVGNodeContext) -> SVGNode? { diff --git a/Source/Parser/SVG/SVGParserPrimitives.swift b/Source/Parser/SVG/SVGParserPrimitives.swift index 250c5ef..7570527 100644 --- a/Source/Parser/SVG/SVGParserPrimitives.swift +++ b/Source/Parser/SVG/SVGParserPrimitives.swift @@ -25,6 +25,14 @@ public class SVGHelper: NSObject { return dict["id"] ?? dict["xml:id"] } + static func parseMarkerInAttribute(_ dict: [String: String], key: String) -> String? { + guard let markerId = dict[key] else { + return .none + } + return markerId.replacingOccurrences(of: "url(#", with: "") + .replacingOccurrences(of: ")", with: "") + } + static func parseStroke(_ style: [String: String], index: SVGIndex) -> SVGStroke? { guard let fill = SVGHelper.parseStrokeFill(style, index) else { return .none @@ -180,4 +188,74 @@ public class SVGHelper: NSObject { let move = CGAffineTransform(translationX: absoluteBounds.minX, y: absoluteBounds.minY) return scale.concatenating(move) } + + static func parseViewBox(_ attributes: [String: String], context: SVGContext) -> CGRect? { + // TODO: temporary solution, all attributes should be case insensitive + if let string = attributes[ignoreCase: "viewBox"] { + let nums = string.components(separatedBy: .whitespaces) + if nums.count == 4, + let x = SVGLengthParser.xAxis.double(string: nums[0], context: context), + let y = SVGLengthParser.yAxis.double(string: nums[1], context: context), + let width = SVGLengthParser.xAxis.double(string: nums[2], context: context), + let height = SVGLengthParser.yAxis.double(string: nums[3], context: context) { + return CGRect(x: x, y: y, width: width, height: height) + } + } + return nil + } + + static func parseDimension(_ attributes: [String: String], _ key: String) -> SVGLength? { + guard let string = attributes[key] else { + return .none + } + if string.hasSuffix("%"), let value = Double(string.dropLast()) { + return SVGLength(percent: CGFloat(value)) + } + if let value = Double(string) { + return SVGLength(pixels: CGFloat(value)) + } + return .none + } + + static func parsePreserveAspectRatio(string: String?, context: SVGContext, defaultValue: SVGPreserveAspectRatio) -> SVGPreserveAspectRatio { + if let contentModeString = string { + let strings = contentModeString.components(separatedBy: CharacterSet(charactersIn: " ")) + if strings.count == 1 { // none + return SVGPreserveAspectRatio(scaling: parseScaling(strings[0])) + } + guard strings.count == 2 else { + context.log(message: "Invalid content mode \(contentModeString)") + return SVGPreserveAspectRatio() + } + + let alignString = strings[0] + var xAlign = alignString.prefix(4).lowercased() + xAlign.remove(at: xAlign.startIndex) + let xAligningMode = parseAlign(xAlign) + + var yAlign = alignString.suffix(4).lowercased() + yAlign.remove(at: yAlign.startIndex) + let yAligningMode = parseAlign(yAlign) + + let scalingMode = parseScaling(strings[1]) + return SVGPreserveAspectRatio(scaling: scalingMode, xAlign: xAligningMode, yAlign: yAligningMode) + } + return SVGPreserveAspectRatio(scaling: parseScaling("xMidYMid")) + } + + static func parseAlign(_ string: String) -> SVGPreserveAspectRatio.Align { + switch string { + case "min": return .min + case "max": return .max + default: return .mid + } + } + + static func parseScaling(_ string: String) -> SVGPreserveAspectRatio.Scaling { + switch string { + case "meet": return .meet + case "slice": return .slice + default: return .none + } + } } diff --git a/Source/Serialization/Serializations.swift b/Source/Serialization/Serializations.swift index ca5e652..06e2613 100644 --- a/Source/Serialization/Serializations.swift +++ b/Source/Serialization/Serializations.swift @@ -47,7 +47,19 @@ extension Double: SerializableAtom { extension CGAffineTransform: SerializableAtom { func serialize() -> String { - return String(format: "[%.10f, %.10f, %.10f, %.10f, %.10f, %.10f]", a, b, c, d, tx, ty) + let formatter = NumberFormatter() + formatter.minimumFractionDigits = 0 + formatter.maximumFractionDigits = 10 + formatter.decimalSeparator = "." + + let nums = [a, b, c, d, tx, ty] + + var result = "" + for num in nums { + result += formatter.string(for: num) ?? "n/a" + result += ", " + } + return "[\(result.dropLast(2))]" } } diff --git a/w3c-coverage.md b/w3c-coverage.md index 4946415..fa0af1c 100644 --- a/w3c-coverage.md +++ b/w3c-coverage.md @@ -2,7 +2,7 @@ This page is automatically generated and shows actual coverage of the [W3C SVG Test Suite](https://github.com/web-platform-tests/wpt/tree/master/svg) by this `SVGView` implementation. Currently there are two standards supported: [SVG 1.1 (Second Edition)](https://www.w3.org/TR/SVG11/) and [SVG Tiny 1.2](https://www.w3.org/TR/SVGTiny12/). - * [SVG 1.1 (Second Edition)](#svg-11-second-edition): `19.3%` + * [SVG 1.1 (Second Edition)](#svg-11-second-edition): `19.5%` * [Animate](#animate-1): `0.0%` * [Color](#color-1): `83.3%` * [Conform](#conform-1): `0.0%` @@ -15,7 +15,7 @@ This page is automatically generated and shows actual coverage of the [W3C SVG T * [Linking](#linking-1): `0.0%` * [Masking](#masking-1): `5.2%` * [Metadata](#metadata-1): `0.0%` - * [Painting](#painting-1): `48.3%` + * [Painting](#painting-1): `51.6%` * [Paths](#paths-1): `90.4%` * [Pservers](#pservers-1): `18.1%` * [Render](#render-1): `37.5%` @@ -26,7 +26,7 @@ This page is automatically generated and shows actual coverage of the [W3C SVG T * [Svgdom](#svgdom-1): `0.0%` * [Text](#text-1): `0.0%` * [Types](#types-1): `6.6%` - * [SVG Tiny 1.2](#svg-tiny-12): `4.5%` + * [SVG Tiny 1.2](#svg-tiny-12): `4.7%` * [Animate](#animate-2): `0.0%` * [Conf](#conf-2): `0.0%` * [Coords](#coords-2): `50.0%` @@ -38,7 +38,7 @@ This page is automatically generated and shows actual coverage of the [W3C SVG T * [Linking](#linking-2): `0.0%` * [Media](#media-2): `0.0%` * [Metadata](#metadata-2): `0.0%` - * [Paint](#paint-2): `7.4%` + * [Paint](#paint-2): `9.0%` * [Paths](#paths-2): `15.3%` * [Render](#render-2): `37.5%` * [Script](#script-2): `0.0%` @@ -51,7 +51,7 @@ This page is automatically generated and shows actual coverage of the [W3C SVG T ## [SVG 1.1 (Second Edition)](https://www.w3.org/TR/SVG11/) -`19.3%` of tests covered (101/522). They can be splitted into following categories: +`19.5%` of tests covered (102/522). They can be splitted into following categories: ### [Animate](https://www.w3.org/TR/SVG11/animate.html): `0.0%` @@ -398,10 +398,10 @@ This page is automatically generated and shows actual coverage of the [W3C SVG T |❌|[metadata-example-01-t](SVGViewTests/w3c/1.1F2/svg/metadata-example-01-t.svg)| -### [Painting](https://www.w3.org/TR/SVG11/painting.html): `48.3%` +### [Painting](https://www.w3.org/TR/SVG11/painting.html): `51.6%`
- (15/31) tests covered... + (16/31) tests covered... |Status | Name| |------|-------| @@ -416,7 +416,7 @@ This page is automatically generated and shows actual coverage of the [W3C SVG T |✅|[painting-fill-03-t](SVGViewTests/w3c/1.1F2/svg/painting-fill-03-t.svg)| |✅|[painting-fill-04-t](SVGViewTests/w3c/1.1F2/svg/painting-fill-04-t.svg)| |✅|[painting-fill-05-b](SVGViewTests/w3c/1.1F2/svg/painting-fill-05-b.svg)| -|❌|[painting-marker-01-f](SVGViewTests/w3c/1.1F2/svg/painting-marker-01-f.svg)| +|✅|[painting-marker-01-f](SVGViewTests/w3c/1.1F2/svg/painting-marker-01-f.svg)| |❌|[painting-marker-02-f](SVGViewTests/w3c/1.1F2/svg/painting-marker-02-f.svg)| |❌|[painting-marker-03-f](SVGViewTests/w3c/1.1F2/svg/painting-marker-03-f.svg)| |❌|[painting-marker-04-f](SVGViewTests/w3c/1.1F2/svg/painting-marker-04-f.svg)| @@ -785,7 +785,7 @@ This page is automatically generated and shows actual coverage of the [W3C SVG T ## [SVG Tiny 1.2](https://www.w3.org/TR/SVGTiny12/) -`4.5%` of tests covered (27/590). They can be splitted into following categories: +`4.7%` of tests covered (28/591). They can be splitted into following categories: ### [Animate](https://www.w3.org/TR/SVGTiny12/animate.html): `0.0%` @@ -1135,10 +1135,10 @@ This page is automatically generated and shows actual coverage of the [W3C SVG T |❌|[metadata-example-01-t](SVGViewTests/w3c/1.2T/svg/metadata-example-01-t.svg)|
-### [Paint](https://www.w3.org/TR/SVGTiny12/paint.html): `7.4%` +### [Paint](https://www.w3.org/TR/SVGTiny12/paint.html): `9.0%`
- (4/54) tests covered... + (5/55) tests covered... |Status | Name| |------|-------| @@ -1152,6 +1152,7 @@ This page is automatically generated and shows actual coverage of the [W3C SVG T |❌|[paint-fill-03-t](SVGViewTests/w3c/1.2T/svg/paint-fill-03-t.svg)| |✅|[paint-fill-04-t](SVGViewTests/w3c/1.2T/svg/paint-fill-04-t.svg)| |❌|[paint-fill-05-t](SVGViewTests/w3c/1.2T/svg/paint-fill-05-t.svg)| +|✅|[paint-fill-06-t](SVGViewTests/w3c/1.2T/svg/paint-fill-06-t.svg)| |❌|[paint-grad-04-t](SVGViewTests/w3c/1.2T/svg/paint-grad-04-t.svg)| |❌|[paint-grad-05-t](SVGViewTests/w3c/1.2T/svg/paint-grad-05-t.svg)| |❌|[paint-grad-07-t](SVGViewTests/w3c/1.2T/svg/paint-grad-07-t.svg)|