some refactor
This commit is contained in:
20 files changed
+1204
-948
No files matched your search
@@ -111,12 +111,19 @@ private slots:
|
||||
QDomElement p = doc.elementsByTagName(QStringLiteral("p")).at(0).toElement();
|
||||
|
||||
auto decls = Css::cascade(sheet, p);
|
||||
QString serialized = Css::serialize(decls);
|
||||
bool hasBold = false;
|
||||
bool hasRed = false;
|
||||
for (const auto &d : decls) {
|
||||
if (d.property == QLatin1String("font-weight") && d.value == QLatin1String("bold"))
|
||||
hasBold = true;
|
||||
if (d.property == QLatin1String("color") && d.value == QLatin1String("red"))
|
||||
hasRed = true;
|
||||
}
|
||||
|
||||
// font-weight: bold should match div > p.highlight
|
||||
QVERIFY(serialized.contains(QStringLiteral("font-weight:bold")));
|
||||
QVERIFY(hasBold);
|
||||
// color: red should win because it is !important in #special, beating inline style="color: green"
|
||||
QVERIFY(serialized.contains(QStringLiteral("color:red")));
|
||||
QVERIFY(hasRed);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user