Skip to content

Commit f208129

Browse files
introfogiText-CI
authored andcommitted
Add SVG symbol processing by adding SymbolSvgNodeRenderer
* Add AbstractContainerSvgNodeRenderer class * Add INoDrawSvgNodeRenderer interface * Update unit tests * Add minor code style improvements DEVSIX-2257 Autoported commit. Original commit hash: [cb316405a]
1 parent 2e64d7f commit f208129

File tree

54 files changed

+260
-202
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+260
-202
lines changed

itext.tests/itext.svg.tests/itext/svg/renderers/impl/ClipPathSvgNodeRendererIntegrationTest.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,9 @@ source product.
4141
4242
*/
4343
using System;
44-
using iText.Svg.Exceptions;
4544
using iText.Svg.Processors.Impl;
4645
using iText.Svg.Renderers;
4746
using iText.Test;
48-
using iText.Test.Attributes;
4947

5048
namespace iText.Svg.Renderers.Impl {
5149
public class ClipPathSvgNodeRendererIntegrationTest : SvgIntegrationTest {
@@ -127,7 +125,6 @@ public virtual void ClipPathCssProperty() {
127125
}
128126

129127
[NUnit.Framework.Test]
130-
[LogMessage(SvgLogMessageConstant.UNMAPPEDTAG, Count = 27)]
131128
public virtual void ClipPathRulesCombined() {
132129
//TODO: update after DEVSIX-2377
133130
ConvertAndCompareSinglePage(sourceFolder, destinationFolder, "clipPathRulesCombined");

itext.tests/itext.svg.tests/itext/svg/renderers/impl/OverflowAttributeTest.cs

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,9 @@ You should have received a copy of the GNU Affero General Public License
2222
*/
2323
using System;
2424
using iText.Svg;
25-
using iText.Svg.Exceptions;
2625
using iText.Svg.Processors;
2726
using iText.Svg.Processors.Impl;
2827
using iText.Test;
29-
using iText.Test.Attributes;
3028

3129
namespace iText.Svg.Renderers.Impl {
3230
public class OverflowAttributeTest : ExtendedITextTest {
@@ -84,37 +82,29 @@ public virtual void OverflowInitialInMarkerElementTest() {
8482
}
8583

8684
[NUnit.Framework.Test]
87-
[LogMessage(SvgLogMessageConstant.UNMAPPEDTAG, Count = 2)]
88-
[LogMessage(iText.StyledXmlParser.LogMessageConstant.ERROR_RESOLVING_PARENT_STYLES, Count = 2)]
8985
public virtual void OverflowVisibleInSymbolElementTest() {
90-
//TODO: update when DEVSIX-3482, DEVSIX-2257 fixed
86+
//TODO: update when DEVSIX-3482 fixed
9187
SvgNodeRendererIntegrationTestUtil.ConvertAndCompareSinglePage(SOURCE_FOLDER, DESTINATION_FOLDER, "overflowVisibleInSymbol"
9288
);
9389
}
9490

9591
[NUnit.Framework.Test]
96-
[LogMessage(SvgLogMessageConstant.UNMAPPEDTAG)]
97-
[LogMessage(iText.StyledXmlParser.LogMessageConstant.ERROR_RESOLVING_PARENT_STYLES)]
9892
public virtual void OverflowHiddenInSymbolElementTest() {
99-
//TODO: update when DEVSIX-3482, DEVSIX-2257 fixed
93+
//TODO: update when DEVSIX-3482 fixed
10094
SvgNodeRendererIntegrationTestUtil.ConvertAndCompareSinglePage(SOURCE_FOLDER, DESTINATION_FOLDER, "overflowHiddenInSymbol"
10195
);
10296
}
10397

10498
[NUnit.Framework.Test]
105-
[LogMessage(SvgLogMessageConstant.UNMAPPEDTAG)]
106-
[LogMessage(iText.StyledXmlParser.LogMessageConstant.ERROR_RESOLVING_PARENT_STYLES)]
10799
public virtual void OverflowInitialInSymbolElementTest() {
108-
//TODO: update when DEVSIX-3482, DEVSIX-2257 fixed
100+
//TODO: update when DEVSIX-3482 fixed
109101
SvgNodeRendererIntegrationTestUtil.ConvertAndCompareSinglePage(SOURCE_FOLDER, DESTINATION_FOLDER, "overflowInitialInSymbol"
110102
);
111103
}
112104

113105
[NUnit.Framework.Test]
114-
[LogMessage(SvgLogMessageConstant.UNMAPPEDTAG)]
115-
[LogMessage(iText.StyledXmlParser.LogMessageConstant.ERROR_RESOLVING_PARENT_STYLES)]
116106
public virtual void OverflowScrollInSymbolElementTest() {
117-
//TODO: update when DEVSIX-3482, DEVSIX-2257 fixed
107+
//TODO: update when DEVSIX-3482 fixed
118108
SvgNodeRendererIntegrationTestUtil.ConvertAndCompareSinglePage(SOURCE_FOLDER, DESTINATION_FOLDER, "overflowScrollInSymbol"
119109
);
120110
}

itext.tests/itext.svg.tests/itext/svg/renderers/impl/SymbolTest.cs

Lines changed: 21 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ You should have received a copy of the GNU Affero General Public License
2121
along with this program. If not, see <https://www.gnu.org/licenses/>.
2222
*/
2323
using System;
24-
using iText.Svg.Exceptions;
2524
using iText.Svg.Processors;
2625
using iText.Svg.Processors.Impl;
2726
using iText.Svg.Renderers;
@@ -49,208 +48,152 @@ public virtual void Before() {
4948
}
5049

5150
[NUnit.Framework.Test]
52-
// TODO Check cmp after feature implementation. DEVSIX-2257
53-
[LogMessage(SvgLogMessageConstant.UNMAPPEDTAG)]
54-
[LogMessage(iText.StyledXmlParser.LogMessageConstant.ERROR_RESOLVING_PARENT_STYLES)]
5551
public virtual void SimpleSymbolTest() {
5652
ConvertAndCompare(SOURCE_FOLDER, DESTINATION_FOLDER, "simpleSymbolTest");
5753
}
5854

5955
[NUnit.Framework.Test]
60-
// TODO Check cmp after feature implementation. DEVSIX-2257
61-
[LogMessage(SvgLogMessageConstant.UNMAPPEDTAG)]
62-
[LogMessage(iText.StyledXmlParser.LogMessageConstant.ERROR_RESOLVING_PARENT_STYLES)]
6356
public virtual void UseTagFirstSymbolAfterTest() {
6457
ConvertAndCompare(SOURCE_FOLDER, DESTINATION_FOLDER, "useTagFirstSymbolAfterTest");
6558
}
6659

6760
[NUnit.Framework.Test]
68-
[LogMessage(SvgLogMessageConstant.UNMAPPEDTAG)]
69-
[LogMessage(iText.StyledXmlParser.LogMessageConstant.ERROR_RESOLVING_PARENT_STYLES)]
7061
public virtual void HeightPxAttrTest() {
71-
// TODO Check cmp after feature implementation. DEVSIX-2257
7262
ConvertAndCompare(SOURCE_FOLDER, DESTINATION_FOLDER, "heightPxAttrTest");
7363
}
7464

7565
[NUnit.Framework.Test]
76-
[LogMessage(SvgLogMessageConstant.UNMAPPEDTAG)]
77-
[LogMessage(iText.StyledXmlParser.LogMessageConstant.ERROR_RESOLVING_PARENT_STYLES)]
66+
[LogMessage(iText.StyledXmlParser.LogMessageConstant.UNKNOWN_ABSOLUTE_METRIC_LENGTH_PARSED)]
7867
public virtual void HeightPercentsAttrTest() {
79-
// TODO Check cmp after feature implementation. DEVSIX-2257
68+
// TODO DEVSIX-4388 The handling of width and height attributes with percentages is not currently supported
8069
ConvertAndCompare(SOURCE_FOLDER, DESTINATION_FOLDER, "heightPercentsAttrTest");
8170
}
8271

8372
[NUnit.Framework.Test]
84-
[LogMessage(SvgLogMessageConstant.UNMAPPEDTAG)]
85-
[LogMessage(iText.StyledXmlParser.LogMessageConstant.ERROR_RESOLVING_PARENT_STYLES)]
8673
public virtual void WidthPxAttrTest() {
87-
// TODO Check cmp after feature implementation. DEVSIX-2257
8874
ConvertAndCompare(SOURCE_FOLDER, DESTINATION_FOLDER, "widthPxAttrTest");
8975
}
9076

9177
[NUnit.Framework.Test]
92-
[LogMessage(SvgLogMessageConstant.UNMAPPEDTAG)]
93-
[LogMessage(iText.StyledXmlParser.LogMessageConstant.ERROR_RESOLVING_PARENT_STYLES)]
78+
[LogMessage(iText.StyledXmlParser.LogMessageConstant.UNKNOWN_ABSOLUTE_METRIC_LENGTH_PARSED)]
9479
public virtual void WidthPercentsAttrTest() {
95-
// TODO Check cmp after feature implementation. DEVSIX-2257
80+
// TODO DEVSIX-4388 The handling of width and height attributes with percentages is not currently supported
9681
ConvertAndCompare(SOURCE_FOLDER, DESTINATION_FOLDER, "widthPercentsAttrTest");
9782
}
9883

9984
[NUnit.Framework.Test]
100-
[LogMessage(SvgLogMessageConstant.UNMAPPEDTAG)]
101-
[LogMessage(iText.StyledXmlParser.LogMessageConstant.ERROR_RESOLVING_PARENT_STYLES)]
10285
public virtual void WidthHeightAttrPxTest() {
103-
// TODO Check cmp after feature implementation. DEVSIX-2257
10486
ConvertAndCompare(SOURCE_FOLDER, DESTINATION_FOLDER, "widthHeightAttrPxTest");
10587
}
10688

10789
[NUnit.Framework.Test]
108-
// TODO Check cmp after feature implementation. DEVSIX-2257
109-
[LogMessage(iText.StyledXmlParser.LogMessageConstant.UNKNOWN_ABSOLUTE_METRIC_LENGTH_PARSED, Count = 4)]
110-
[LogMessage(SvgLogMessageConstant.UNMAPPEDTAG, Count = 2)]
111-
[LogMessage(iText.StyledXmlParser.LogMessageConstant.ERROR_RESOLVING_PARENT_STYLES, Count = 2)]
90+
[LogMessage(iText.StyledXmlParser.LogMessageConstant.UNKNOWN_ABSOLUTE_METRIC_LENGTH_PARSED, Count = 2)]
11291
public virtual void WidthHeightAttrPercentsPxTest() {
92+
// TODO DEVSIX-4388 The handling of width and height attributes with percentages is not currently supported
11393
ConvertAndCompare(SOURCE_FOLDER, DESTINATION_FOLDER, "widthHeightAttrPercentsPxTest");
11494
}
11595

11696
[NUnit.Framework.Test]
117-
// TODO Check cmp after feature implementation. DEVSIX-2257
118-
[LogMessage(SvgLogMessageConstant.MISSING_HEIGHT)]
119-
[LogMessage(SvgLogMessageConstant.MISSING_WIDTH)]
120-
[LogMessage(SvgLogMessageConstant.UNMAPPEDTAG, Count = 3)]
121-
[LogMessage(iText.StyledXmlParser.LogMessageConstant.ERROR_RESOLVING_PARENT_STYLES, Count = 3)]
12297
public virtual void PreserveAspectRatioViewBoxTest() {
98+
// TODO DEVSIX-3537 Processing of preserveAspectRatio attribute with offsets x and y is not currently supported
12399
ConvertAndCompare(SOURCE_FOLDER, DESTINATION_FOLDER, "preserveAspectRatioViewBoxTest");
124100
}
125101

126102
[NUnit.Framework.Test]
127-
[NUnit.Framework.Ignore("DEVSIX-2257")]
128103
public virtual void XYInUseWithDefsTest() {
129-
// TODO Check cmp after feature implementation. DEVSIX-2257
130104
ConvertAndCompare(SOURCE_FOLDER, DESTINATION_FOLDER, "xYInUseWithDefsTest");
131105
}
132106

133107
[NUnit.Framework.Test]
134-
// TODO Check cmp after feature implementation. DEVSIX-2257
135-
[LogMessage(SvgLogMessageConstant.UNMAPPEDTAG)]
136-
[LogMessage(iText.StyledXmlParser.LogMessageConstant.ERROR_RESOLVING_PARENT_STYLES)]
137108
public virtual void ClassAttributeTestWithCssTest() {
109+
// TODO DEVSIX-4563 Processing of attributes from an external CSS is not currently supported
138110
ConvertAndCompare(SOURCE_FOLDER, DESTINATION_FOLDER, "classAttrTest");
139111
}
140112

141113
[NUnit.Framework.Test]
142-
// TODO Check cmp after feature implementation. DEVSIX-2257
143-
[LogMessage(SvgLogMessageConstant.UNMAPPEDTAG)]
144-
[LogMessage(iText.StyledXmlParser.LogMessageConstant.ERROR_RESOLVING_PARENT_STYLES)]
145114
public virtual void StyleAttributeTest() {
146115
ConvertAndCompare(SOURCE_FOLDER, DESTINATION_FOLDER, "styleAttrTest");
147116
}
148117

149118
[NUnit.Framework.Test]
150-
// TODO Check cmp after feature implementation. DEVSIX-2257
151-
[LogMessage(SvgLogMessageConstant.UNMAPPEDTAG)]
152-
[LogMessage(iText.StyledXmlParser.LogMessageConstant.ERROR_RESOLVING_PARENT_STYLES)]
153119
public virtual void StyleAttrInUseTest() {
154120
ConvertAndCompare(SOURCE_FOLDER, DESTINATION_FOLDER, "styleAttrInUseTest");
155121
}
156122

157123
[NUnit.Framework.Test]
158-
// TODO Check cmp after feature implementation. DEVSIX-2257
159-
[LogMessage(SvgLogMessageConstant.UNMAPPEDTAG)]
160-
[LogMessage(iText.StyledXmlParser.LogMessageConstant.ERROR_RESOLVING_PARENT_STYLES)]
161124
public virtual void BothStyleAttributeTest() {
162125
ConvertAndCompare(SOURCE_FOLDER, DESTINATION_FOLDER, "bothStyleAttrTest");
163126
}
164127

165128
[NUnit.Framework.Test]
166-
// TODO Check cmp after feature implementation. DEVSIX-2257
167-
[LogMessage(SvgLogMessageConstant.UNMAPPEDTAG)]
168-
[LogMessage(iText.StyledXmlParser.LogMessageConstant.ERROR_RESOLVING_PARENT_STYLES)]
169129
public virtual void OpacityAttributeTest() {
130+
// TODO DEVSIX-2258 Processing of stroke attribute is not currently correct supported
170131
ConvertAndCompare(SOURCE_FOLDER, DESTINATION_FOLDER, "opacityAttrTest");
171132
}
172133

173134
[NUnit.Framework.Test]
174-
// TODO Check cmp after feature implementation. DEVSIX-2257
175-
[LogMessage(SvgLogMessageConstant.UNMAPPEDTAG)]
176-
[LogMessage(iText.StyledXmlParser.LogMessageConstant.ERROR_RESOLVING_PARENT_STYLES)]
177135
public virtual void VisibilityAttributeTest() {
136+
// TODO DEVSIX-2254 Processing of visibility attribute is not currently supported
178137
ConvertAndCompare(SOURCE_FOLDER, DESTINATION_FOLDER, "visibilityAttrTest");
179138
}
180139

181140
[NUnit.Framework.Test]
182-
// TODO Check cmp after feature implementation. DEVSIX-2257
183-
[LogMessage(SvgLogMessageConstant.UNMAPPEDTAG)]
184-
[LogMessage(iText.StyledXmlParser.LogMessageConstant.ERROR_RESOLVING_PARENT_STYLES)]
185141
public virtual void DisplayNoneAttributeTest() {
142+
// TODO DEVSIX-4564 Processing of display attribute is not currently supported
186143
ConvertAndCompare(SOURCE_FOLDER, DESTINATION_FOLDER, "displayNoneAttrTest");
187144
}
188145

189146
[NUnit.Framework.Test]
190-
// TODO Check cmp after feature implementation. DEVSIX-2257
191-
[LogMessage(SvgLogMessageConstant.UNMAPPEDTAG)]
192-
[LogMessage(iText.StyledXmlParser.LogMessageConstant.ERROR_RESOLVING_PARENT_STYLES)]
193147
public virtual void DisplayAttributeWithNoUseTagTest() {
148+
// TODO DEVSIX-4564 Processing of display attribute is not currently supported
194149
//Expects that nothing will be displayed on the page as it's done in Chrome browser
195150
ConvertAndCompare(SOURCE_FOLDER, DESTINATION_FOLDER, "displayAttrWithNoUseTagTest");
196151
}
197152

198153
[NUnit.Framework.Test]
199-
// TODO Check cmp after feature implementation. DEVSIX-2257
200-
[LogMessage(SvgLogMessageConstant.UNMAPPEDTAG)]
201-
[LogMessage(iText.StyledXmlParser.LogMessageConstant.ERROR_RESOLVING_PARENT_STYLES)]
202154
public virtual void SimpleImageTest() {
203155
ConvertAndCompareSinglePage(SOURCE_FOLDER, DESTINATION_FOLDER, "simpleImageTest", properties);
204156
}
205157

206158
[NUnit.Framework.Test]
207-
// TODO Check cmp after feature implementation. DEVSIX-2257
208-
[LogMessage(SvgLogMessageConstant.UNMAPPEDTAG)]
209-
[LogMessage(iText.StyledXmlParser.LogMessageConstant.ERROR_RESOLVING_PARENT_STYLES)]
210159
public virtual void LinearGradientSymbolTest() {
211160
ConvertAndCompareSinglePage(SOURCE_FOLDER, DESTINATION_FOLDER, "linearGradientSymbolTest", properties);
212161
}
213162

214163
[NUnit.Framework.Test]
215-
// TODO Check cmp after feature implementation. DEVSIX-2257
216-
[LogMessage(SvgLogMessageConstant.UNMAPPEDTAG)]
217-
[LogMessage(iText.StyledXmlParser.LogMessageConstant.ERROR_RESOLVING_PARENT_STYLES)]
218164
public virtual void UseHeightWidthAllUnitsTest() {
165+
// TODO DEVSIX-4566 Processing of width&height attributes in use tag are not currently supported
219166
ConvertAndCompareSinglePage(SOURCE_FOLDER, DESTINATION_FOLDER, "useHeightWidthAllUnitsTest", properties);
220167
}
221168

222169
[NUnit.Framework.Test]
223-
// TODO Check cmp after feature implementation. DEVSIX-2257
224-
[LogMessage(SvgLogMessageConstant.UNMAPPEDTAG)]
225-
[LogMessage(iText.StyledXmlParser.LogMessageConstant.ERROR_RESOLVING_PARENT_STYLES)]
170+
[LogMessage(iText.StyledXmlParser.LogMessageConstant.UNKNOWN_ABSOLUTE_METRIC_LENGTH_PARSED)]
226171
public virtual void UseSymbolHeightWidthAllUnitsTest() {
172+
// TODO DEVSIX-4388 The handling of width and height attributes with percentages is not currently supported
173+
// TODO DEVSIX-4566 Processing of width&height attributes in use tag are not currently supported
227174
ConvertAndCompareSinglePage(SOURCE_FOLDER, DESTINATION_FOLDER, "useSymbolHeightWidthAllUnitsTest", properties
228175
);
229176
}
230177

231178
[NUnit.Framework.Test]
232-
[LogMessage(SvgLogMessageConstant.UNMAPPEDTAG)]
233-
[LogMessage(iText.StyledXmlParser.LogMessageConstant.ERROR_RESOLVING_PARENT_STYLES)]
179+
[LogMessage(iText.StyledXmlParser.LogMessageConstant.UNKNOWN_ABSOLUTE_METRIC_LENGTH_PARSED, Count = 3)]
234180
public virtual void UseSymbolXYContrudictionAllUnitsTest() {
235-
// TODO Check cmp after feature implementation. DEVSIX-2257
181+
// TODO DEVSIX-4388 The handling of x and y attributes with percentages is not currently supported
236182
ConvertAndCompareSinglePage(SOURCE_FOLDER, DESTINATION_FOLDER, "useSymbolXYContrudictionAllUnitsTest", properties
237183
);
238184
}
239185

240186
[NUnit.Framework.Test]
241-
[LogMessage(SvgLogMessageConstant.UNMAPPEDTAG, Count = 3)]
242-
[LogMessage(iText.StyledXmlParser.LogMessageConstant.ERROR_RESOLVING_PARENT_STYLES, Count = 3)]
187+
[LogMessage(iText.StyledXmlParser.LogMessageConstant.UNKNOWN_ABSOLUTE_METRIC_LENGTH_PARSED, Count = 6)]
243188
public virtual void UseSymbolCoordinatesContrudictionTest() {
244-
// TODO: check cmp after feature implementation DEVSIX-2257
189+
// TODO DEVSIX-2654 Percent values are not correctly processed
245190
ConvertAndCompareSinglePage(SOURCE_FOLDER, DESTINATION_FOLDER, "useSymbolCoordinatesContrudiction", properties
246191
);
247192
}
248193

249194
[NUnit.Framework.Test]
250-
[LogMessage(SvgLogMessageConstant.UNMAPPEDTAG, Count = 5)]
251-
[LogMessage(iText.StyledXmlParser.LogMessageConstant.ERROR_RESOLVING_PARENT_STYLES, Count = 5)]
252195
public virtual void WidthHeightAttrInteractionTest() {
253-
// TODO: check cmp after feature implementation DEVSIX-2257
196+
// TODO DEVSIX-4566 Processing of width&height attributes in use tag are not currently supported
254197
ConvertAndCompareSinglePage(SOURCE_FOLDER, DESTINATION_FOLDER, "widthHeightAttrInteraction", properties);
255198
}
256199
}

0 commit comments

Comments
 (0)