summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@digia.com>2013-10-09 20:59:45 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-10-11 12:05:59 +0200
commit6f6546613774a48fe12f13f796ed7115dfe49a27 (patch)
tree2f5f764382e181797d48592a02cd0706b51abd90 /src/gui
parentc16dbfbdded43de3536695938e0ccb1c8376a80d (diff)
Ensure CSS rules are inherited from the parent tags
When CSS was set in the head tag then it was not being inherited by the child tags. This ensures that the inhertiance happens and that the deeper the CSS is set then it will ensure that it has precedence over the ones set on the parent. A test is added that shows the standard inheritance from the head tag and the precedence from child tags in effect too. Task-number: QTBUG-28770 Change-Id: I30be3ec141b2cd8d6e0db8a92669aed34da93b33 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/text/qtexthtmlparser.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gui/text/qtexthtmlparser.cpp b/src/gui/text/qtexthtmlparser.cpp
index 952cebcc1b..5292ba20a2 100644
--- a/src/gui/text/qtexthtmlparser.cpp
+++ b/src/gui/text/qtexthtmlparser.cpp
@@ -1896,7 +1896,11 @@ QVector<QCss::Declaration> 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;
}