summaryrefslogtreecommitdiff
path: root/svgio/qa
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2022-07-07 12:33:12 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2022-07-07 13:47:51 +0200
commitcded65d05a01ac34af750ddb97f1ffb51f3d638a (patch)
treead3825866c608bb8aefcd6ef3329c2d8048ccb44 /svgio/qa
parent68c6401e5359466fc0b888d1f3a9be75e4c6ec51 (diff)
tdf#149893: Color names are ASCII case-insensitive
See https://www.w3.org/TR/css-color-3/#html4 Change-Id: Ifdf887bad08ab606abef78fa8335bc49507f4a43 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136879 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> Tested-by: Jenkins
Diffstat (limited to 'svgio/qa')
-rw-r--r--svgio/qa/cppunit/SvgImportTest.cxx18
-rw-r--r--svgio/qa/cppunit/data/tdf149893.svg3
2 files changed, 21 insertions, 0 deletions
diff --git a/svgio/qa/cppunit/SvgImportTest.cxx b/svgio/qa/cppunit/SvgImportTest.cxx
index 5c041ac3b386..b97185f36af7 100644
--- a/svgio/qa/cppunit/SvgImportTest.cxx
+++ b/svgio/qa/cppunit/SvgImportTest.cxx
@@ -56,6 +56,7 @@ class Test : public test::BootstrapFixture, public XmlTestTools
void testRGBAColor();
void testNoneColor();
void testTdf97936();
+ void testTdf149893();
void testClipPathAndParentStyle();
void testClipPathAndStyle();
void testi125329();
@@ -94,6 +95,7 @@ public:
CPPUNIT_TEST(testRGBAColor);
CPPUNIT_TEST(testNoneColor);
CPPUNIT_TEST(testTdf97936);
+ CPPUNIT_TEST(testTdf149893);
CPPUNIT_TEST(testClipPathAndParentStyle);
CPPUNIT_TEST(testClipPathAndStyle);
CPPUNIT_TEST(testi125329);
@@ -523,6 +525,22 @@ void Test::testTdf97936()
assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor[2]/polypolygon", "maxy", "100");
}
+void Test::testTdf149893()
+{
+ Primitive2DSequence aSequenceClipPathAndParentStyle = parseSvg(u"/svgio/qa/cppunit/data/tdf149893.svg");
+ CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequenceClipPathAndParentStyle.getLength()));
+
+ drawinglayer::Primitive2dXmlDump dumper;
+ xmlDocUniquePtr pDocument = dumper.dumpAndParse(Primitive2DContainer(aSequenceClipPathAndParentStyle));
+
+ CPPUNIT_ASSERT (pDocument);
+
+ // Without the fix in place, this test would have failed with
+ // - Expected: #008000
+ // - Actual : #000000
+ assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor", "color", "#008000");
+}
+
void Test::testClipPathAndParentStyle()
{
//Check that fill color, stroke color and stroke-width are inherited from use element
diff --git a/svgio/qa/cppunit/data/tdf149893.svg b/svgio/qa/cppunit/data/tdf149893.svg
new file mode 100644
index 000000000000..05c41eac96af
--- /dev/null
+++ b/svgio/qa/cppunit/data/tdf149893.svg
@@ -0,0 +1,3 @@
+<svg width="100%" height="100%" xmlns="http://www.w3.org/2000/svg">
+ <rect x="0" y="0" width="100%" height="100%" fill="GREEN"></rect>
+</svg>