From 0cdf2a8023473e03121fc99194182a3fb86dd6aa Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Tue, 5 Nov 2013 20:18:49 +0100 Subject: Revert "Ensure CSS rules are inherited from the parent tags" Since the original change caused a problem with the CSS rules being always inherited where in some cases this should not be happening. This reverts commit 6f6546613774a48fe12f13f796ed7115dfe49a27. Change-Id: I6e9cf163d752b1869b5e967a7ab59963d655ba87 Reviewed-by: Simon Hausmann --- src/gui/text/qtexthtmlparser.cpp | 6 +---- .../gui/text/qtextdocument/tst_qtextdocument.cpp | 31 ---------------------- 2 files changed, 1 insertion(+), 36 deletions(-) diff --git a/src/gui/text/qtexthtmlparser.cpp b/src/gui/text/qtexthtmlparser.cpp index a131503b85..3cb61b9eae 100644 --- a/src/gui/text/qtexthtmlparser.cpp +++ b/src/gui/text/qtexthtmlparser.cpp @@ -1896,11 +1896,7 @@ QVector QTextHtmlParser::declarationsForNode(int node) const if (nodes.at(node).id == Html_a && nodes.at(node).hasHref) extraPseudo = "link"; decls = selector.declarationsForNode(n, extraPseudo); - n = selector.parentNode(n); - while (!selector.isNullNode(n)) { - decls = selector.declarationsForNode(n, extraPseudo) + decls; - n = selector.parentNode(n); - } + return decls; } diff --git a/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp b/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp index b065f537f7..d5ddf8fbec 100644 --- a/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp +++ b/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp @@ -187,8 +187,6 @@ private slots: void htmlExportImportBlockCount(); void QTBUG27354_spaceAndSoftSpace(); - void cssInheritance(); - void QTBUG28998_linkColor(); private: @@ -2949,35 +2947,6 @@ void tst_QTextDocument::QTBUG27354_spaceAndSoftSpace() } } -void tst_QTextDocument::cssInheritance() -{ - { - QTextDocument td; - td.setHtml("" - "

Foo

Bar

Baz

"); - QTextBlock block = td.begin(); - while (block.isValid()) { - QTextBlockFormat fmt = block.blockFormat(); - QVERIFY(fmt.lineHeightType() == QTextBlockFormat::ProportionalHeight); - QVERIFY(fmt.lineHeight() == 200); - block = block.next(); - } - } - { - QTextDocument td; - td.setHtml("" - "

Foo

Bar

Baz

"); - QTextBlock block = td.begin(); - QTextBlockFormat fmt = block.blockFormat(); - QVERIFY(fmt.lineHeightType() == QTextBlockFormat::FixedHeight); - QVERIFY(fmt.lineHeight() == 40); - block = block.next(); - fmt = block.blockFormat(); - QVERIFY(fmt.lineHeightType() == QTextBlockFormat::ProportionalHeight); - QVERIFY(fmt.lineHeight() == 300); - } -} - void tst_QTextDocument::QTBUG28998_linkColor() { QPalette pal; -- cgit v1.2.3