visual fix
This commit is contained in:
20 files changed
+669
-32
No files matched your search
@@ -53,6 +53,44 @@ private slots:
|
||||
QCOMPARE(c5, QColor(Qt::red));
|
||||
}
|
||||
|
||||
void parseBorders()
|
||||
{
|
||||
Css::LengthContext ctx;
|
||||
ctx.em = 16.0;
|
||||
ctx.rem = 16.0;
|
||||
ctx.percentBase = 500.0;
|
||||
ctx.absoluteScale = 1.0;
|
||||
|
||||
auto b1 = Css::parseBorderSide(QStringLiteral("1px solid Black"), ctx);
|
||||
QVERIFY(b1.width.has_value());
|
||||
QCOMPARE(*b1.width, 1.0);
|
||||
QCOMPARE(b1.color, QColor(Qt::black));
|
||||
QVERIFY(!b1.isNone);
|
||||
|
||||
auto b2 = Css::parseBorderSide(QStringLiteral("none"), ctx);
|
||||
QVERIFY(b2.width.has_value());
|
||||
QCOMPARE(*b2.width, 0.0);
|
||||
QVERIFY(b2.isNone);
|
||||
|
||||
auto b3 = Css::parseBorderSide(QStringLiteral("thin dotted #cccccc"), ctx);
|
||||
QVERIFY(b3.width.has_value());
|
||||
QCOMPARE(*b3.width, 1.0);
|
||||
QCOMPARE(b3.color, QColor(0xcc, 0xcc, 0xcc));
|
||||
|
||||
auto b4 = Css::parseBorderSide(QStringLiteral("2px"), ctx);
|
||||
QVERIFY(b4.width.has_value());
|
||||
QCOMPARE(*b4.width, 2.0);
|
||||
|
||||
auto b5 = Css::parseBorderSide(QStringLiteral("solid red"), ctx);
|
||||
QVERIFY(b5.width.has_value());
|
||||
QCOMPARE(*b5.width, 3.0); // Default medium width when style is present
|
||||
QCOMPARE(b5.color, QColor(Qt::red));
|
||||
|
||||
auto b6 = Css::parseBorderSide(QStringLiteral("1px inset"), ctx);
|
||||
QVERIFY(b6.width.has_value());
|
||||
QCOMPARE(*b6.width, 1.0);
|
||||
}
|
||||
|
||||
void stylesheetParsingAndCascade()
|
||||
{
|
||||
const QString css = QStringLiteral(
|
||||
|
||||
Reference in new issue
Block a user