aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2012-11-04 12:45:49 +0100
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2012-11-04 12:45:49 +0100
commit1356e3bacfb69f3902ccffebb15dee97906df60e (patch)
treef90648d63e95cd68cfd134654055576f4bcd913e
parent1b2ef5f668d13761c5c7564743a8f08a78065a66 (diff)
own nonCssProperties have precedence over inherited ones
-rw-r--r--src/styleengine.cc14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/styleengine.cc b/src/styleengine.cc
index a482f088..f5994b7d 100644
--- a/src/styleengine.cc
+++ b/src/styleengine.cc
@@ -165,13 +165,17 @@ void StyleEngine::setStyle (const char *styleAttr) {
*/
void StyleEngine::inheritNonCssHints () {
Node *pn = stack->getRef (stack->size () - 2);
- Node *n = stack->getRef (stack->size () - 1);
if (pn->nonCssProperties) {
- if (n->nonCssProperties)
- pn->nonCssProperties->apply (n->nonCssProperties);
- else
- n->nonCssProperties = new CssPropertyList(*pn->nonCssProperties, true);
+ Node *n = stack->getRef (stack->size () - 1);
+ CssPropertyList *origNonCssProperties = n->nonCssProperties;
+
+ n->nonCssProperties = new CssPropertyList(*pn->nonCssProperties, true);
+
+ if (origNonCssProperties) // original nonCssProperties have precedence
+ origNonCssProperties->apply (n->nonCssProperties);
+
+ delete origNonCssProperties;
}
}