@@ -43,6 +43,7 @@ source product.
43
43
using System ;
44
44
using System . Collections . Generic ;
45
45
using iText . StyledXmlParser . Node . Impl . Jsoup . Node ;
46
+ using iText . Svg ;
46
47
using iText . Svg . Css . Impl ;
47
48
using iText . Svg . Processors . Impl ;
48
49
using iText . Test ;
@@ -63,31 +64,25 @@ public virtual void SvgCssResolveMalformedXlinkTest() {
63
64
IDictionary < String , String > attr = sr . ResolveStyles ( node , new SvgCssContext ( ) ) ;
64
65
NUnit . Framework . Assert . AreEqual ( value , attr . Get ( "xlink:href" ) ) ;
65
66
}
66
-
67
+
67
68
[ NUnit . Framework . Test ]
68
69
public virtual void SvgCssResolveDataXlinkTest ( ) {
69
70
iText . StyledXmlParser . Jsoup . Nodes . Element jsoupImage = new iText . StyledXmlParser . Jsoup . Nodes . Element ( iText . StyledXmlParser . Jsoup . Parser . Tag
70
- . ValueOf ( "image" ) , "" ) ;
71
+ . ValueOf ( SvgConstants . Tags . IMAGE ) , "" ) ;
71
72
iText . StyledXmlParser . Jsoup . Nodes . Attributes imageAttributes = jsoupImage . Attributes ( ) ;
72
73
JsoupElementNode node = new JsoupElementNode ( jsoupImage ) ;
73
-
74
74
String value1 = "data:image/png;base64,iVBORw0KGgoAAAANSU" ;
75
75
imageAttributes . Put ( new iText . StyledXmlParser . Jsoup . Nodes . Attribute ( "xlink:href" , value1 ) ) ;
76
-
77
76
SvgStyleResolver sr = new SvgStyleResolver ( new SvgProcessorContext ( new SvgConverterProperties ( ) ) ) ;
78
77
IDictionary < String , String > attr = sr . ResolveStyles ( node , new SvgCssContext ( ) ) ;
79
78
NUnit . Framework . Assert . AreEqual ( value1 , attr . Get ( "xlink:href" ) ) ;
80
-
81
79
String value2 = "data:...,." ;
82
80
imageAttributes . Put ( new iText . StyledXmlParser . Jsoup . Nodes . Attribute ( "xlink:href" , value2 ) ) ;
83
-
84
81
sr = new SvgStyleResolver ( new SvgProcessorContext ( new SvgConverterProperties ( ) ) ) ;
85
82
attr = sr . ResolveStyles ( node , new SvgCssContext ( ) ) ;
86
83
NUnit . Framework . Assert . AreEqual ( value2 , attr . Get ( "xlink:href" ) ) ;
87
-
88
84
String value3 = "dAtA:...,." ;
89
85
imageAttributes . Put ( new iText . StyledXmlParser . Jsoup . Nodes . Attribute ( "xlink:href" , value3 ) ) ;
90
-
91
86
sr = new SvgStyleResolver ( new SvgProcessorContext ( new SvgConverterProperties ( ) ) ) ;
92
87
attr = sr . ResolveStyles ( node , new SvgCssContext ( ) ) ;
93
88
NUnit . Framework . Assert . AreEqual ( value3 , attr . Get ( "xlink:href" ) ) ;
0 commit comments