diff options
author | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2018-10-03 09:59:06 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2018-10-12 22:01:14 +0000 |
commit | bbe08d6b686456297ad4ab8c0923c3126e02e2b3 (patch) | |
tree | 3234407237c06cac2af592bdea362727ca13e4e4 /tests/auto | |
parent | 473d9a5fc763d114fbfa1c0d2b5f8d03cab6e972 (diff) |
QCss: properly parse functions which contains additional spaces
When there were additional spaces between the function definition and
the first parameter, the parser failed to parse it when it contained
another function (e.g. 'qlineargradient(... rgb() ...)').
The reason for this was that ::until() needs the function at index-1 so
it can correctly count the opening parenthesis.
Fixes: QTBUG-61795
Change-Id: I992f556e7f8cd45550f83bc90aa8de2b4e905574
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/gui/text/qcssparser/tst_qcssparser.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp b/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp index 2a53f5d633..cfd24a8701 100644 --- a/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp +++ b/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp @@ -1509,6 +1509,12 @@ void tst_QCssParser::gradient_data() "spread: repeat, stop:0.2 rgb(1, 2, 3), stop:0.5 rgba(1, 2, 3, 4))" << "conical" << QPointF(4, 2) << QPointF() << 2 << qreal(0.2) << QColor(1, 2, 3) << qreal(0.5) << QColor(1, 2, 3, 4); + // spaces before first function parameter lead to parser errors + QTest::newRow("QTBUG-61795") << + "selection-background-color: qconicalgradient( cx: 4, cy : 2, angle: 23, " + "spread: repeat, stop:0.2 rgb( 1, 2, 3), stop:0.5 rgba( 1, 2, 3, 4))" << "conical" << QPointF(4, 2) << QPointF() + << 2 << qreal(0.2) << QColor(1, 2, 3) << qreal(0.5) << QColor(1, 2, 3, 4); + /* won't pass: stop values are expected to be sorted QTest::newRow("unsorted-stop") << "selection-background: lineargradient(x1:0, y1:0, x2:0, y2:1, " |