summaryrefslogtreecommitdiffstats
path: root/tests/auto/qcssparser/tst_qcssparser.cpp
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2010-04-12 15:52:14 +0200
committerOlivier Goffart <ogoffart@trolltech.com>2010-04-12 16:31:38 +0200
commitd3c1dea37f95ba2bb75a2a264e4d806c4c0c36f3 (patch)
tree647190e184b37f339edf30f6065dfca62dba523e /tests/auto/qcssparser/tst_qcssparser.cpp
parent059bf03f30c0e27830d311ae9a664eb0376fcd1f (diff)
CSS: fixes border only affecting the first widget.
Rules like "Foo { border: 2px solid; }" does not specify the border color. When the border color is not specified, it is assumed to be black. When reading the brush value from the cache, we should take that into account. Note that this logic cannot be moved into brushFromData() as it is different for the background. (when no color is specified, it is assumed to be transparent) Reviewed-by: jbache Task-number: QTBUG-9674 (part one)
Diffstat (limited to 'tests/auto/qcssparser/tst_qcssparser.cpp')
-rw-r--r--tests/auto/qcssparser/tst_qcssparser.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/auto/qcssparser/tst_qcssparser.cpp b/tests/auto/qcssparser/tst_qcssparser.cpp
index ef102a0659..966563c065 100644
--- a/tests/auto/qcssparser/tst_qcssparser.cpp
+++ b/tests/auto/qcssparser/tst_qcssparser.cpp
@@ -1381,6 +1381,13 @@ void tst_QCssParser::shorthandBackgroundProperty()
QTEST(image, "expectedImage");
QTEST(int(repeat), "expectedRepeatValue");
QTEST(int(alignment), "expectedAlignment");
+
+ //QTBUG-9674 : a second evaluation should give the same results
+ QVERIFY(v.extractBackground(&brush, &image, &repeat, &alignment, &origin, &attachment, &ignoredOrigin));
+ QVERIFY(expectedBrush.color() == brush.color());
+ QTEST(image, "expectedImage");
+ QTEST(int(repeat), "expectedRepeatValue");
+ QTEST(int(alignment), "expectedAlignment");
}
void tst_QCssParser::pseudoElement_data()
@@ -1644,6 +1651,12 @@ void tst_QCssParser::extractBorder()
QVERIFY(widths[QCss::TopEdge] == expectedTopWidth);
QVERIFY(styles[QCss::TopEdge] == expectedTopStyle);
QVERIFY(colors[QCss::TopEdge] == expectedTopColor);
+
+ //QTBUG-9674 : a second evaluation should give the same results
+ QVERIFY(extractor.extractBorder(widths, colors, styles, radii));
+ QVERIFY(widths[QCss::TopEdge] == expectedTopWidth);
+ QVERIFY(styles[QCss::TopEdge] == expectedTopStyle);
+ QVERIFY(colors[QCss::TopEdge] == expectedTopColor);
}
void tst_QCssParser::noTextDecoration()