summaryrefslogtreecommitdiffstats
path: root/tests/auto/qtextdocumentfragment
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-11-02 14:49:33 +0100
committerOlivier Goffart <ogoffart@trolltech.com>2009-11-02 15:08:28 +0100
commit8d01f436451071a917c147a96a979ccdaee106f9 (patch)
tree43972bf16252189e05969ff5c6c6b97edf9f2b54 /tests/auto/qtextdocumentfragment
parente6da35f6055d3ae7acf38d89456d3047f055a9cd (diff)
QCSSParser: Fixes the way spaces are handled in font family.
We cannot simplify spaces because a font may have several spaces in its name. If we only add spaces when needed when merging tokens, we don't need to simplyfy the string later The CSS tokenizer will already make sure that spaces are removed if there is no quotes (btw, the CSS specification says that there must be quotes if there is spaces, but we tollerate if there is no quotes) Reviewed-by: Jocelyn Turcotte Task-number: QTBUG-4344 Task-number: 258586
Diffstat (limited to 'tests/auto/qtextdocumentfragment')
-rw-r--r--tests/auto/qtextdocumentfragment/tst_qtextdocumentfragment.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/auto/qtextdocumentfragment/tst_qtextdocumentfragment.cpp b/tests/auto/qtextdocumentfragment/tst_qtextdocumentfragment.cpp
index 8c4d8fdabd..4dc732cd60 100644
--- a/tests/auto/qtextdocumentfragment/tst_qtextdocumentfragment.cpp
+++ b/tests/auto/qtextdocumentfragment/tst_qtextdocumentfragment.cpp
@@ -2197,6 +2197,16 @@ void tst_QTextDocumentFragment::html_quotedFontFamily()
setHtml("<div style='font-family: \"Foo Bar\";'>Test</div>");
QCOMPARE(doc->begin().begin().fragment().charFormat().fontFamily(), QString("Foo Bar"));
+
+ setHtml("<div style='font-family: \"Foo Bar\";'>Test</div>");
+ QCOMPARE(doc->begin().begin().fragment().charFormat().fontFamily(), QString("Foo Bar"));
+
+ setHtml("<div style='font-family: Foo\n Bar;'>Test</div>");
+ QCOMPARE(doc->begin().begin().fragment().charFormat().fontFamily(), QString("Foo Bar"));
+
+ setHtml("<div style='font-family: Foo\n Bar, serif, \"bar foo\";'>Test</div>");
+ QCOMPARE(doc->begin().begin().fragment().charFormat().fontFamily(), QString("Foo Bar,serif,bar foo"));
+
}
void tst_QTextDocumentFragment::defaultFont()