summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2009-01-31 10:35:59 +0100
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2009-01-31 10:35:59 +0100
commit3eebf8623ed40099e9dbe40b5d90b002da001a9f (patch)
tree1224c8dac7331085b4745a983229184107b482b8 /src
parent1eb7f63a69af93a0b41e5f05beb5ebc5b1279cc9 (diff)
fix cascading order
CSS data given in style="" attributes can be overruled by AUTHOR_IMPORTANT style data. This fixes http://www.w3.org/Style/CSS/Test/CSS2.1/current/html4/t060402-c31-important-00-b.htm
Diffstat (limited to 'src')
-rw-r--r--src/css.cc21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/css.cc b/src/css.cc
index e9838ce7..01ebdc5b 100644
--- a/src/css.cc
+++ b/src/css.cc
@@ -384,19 +384,26 @@ void CssContext::apply (CssPropertyList *props, Doctree *docTree,
CssPropertyList *tagStyle, CssPropertyList *nonCssHints) {
const DoctreeNode *node = docTree->top ();
- for (int o = CSS_PRIMARY_USER_AGENT; o <= CSS_PRIMARY_USER; o++)
- if (sheet[o])
- sheet[o]->apply (props, docTree, node);
+ if (sheet[CSS_PRIMARY_USER_AGENT])
+ sheet[CSS_PRIMARY_USER_AGENT]->apply (props, docTree, node);
+
+ if (sheet[CSS_PRIMARY_USER])
+ sheet[CSS_PRIMARY_USER]->apply (props, docTree, node);
if (nonCssHints)
nonCssHints->apply (props);
-
- for (int o = CSS_PRIMARY_AUTHOR; o <= CSS_PRIMARY_USER_IMPORTANT; o++)
- if (sheet[o])
- sheet[o]->apply (props, docTree, node);
+
+ if (sheet[CSS_PRIMARY_AUTHOR])
+ sheet[CSS_PRIMARY_AUTHOR]->apply (props, docTree, node);
if (tagStyle)
tagStyle->apply (props);
+
+ if (sheet[CSS_PRIMARY_AUTHOR_IMPORTANT])
+ sheet[CSS_PRIMARY_AUTHOR_IMPORTANT]->apply (props, docTree, node);
+
+ if (sheet[CSS_PRIMARY_USER_IMPORTANT])
+ sheet[CSS_PRIMARY_USER_IMPORTANT]->apply (props, docTree, node);
}
void CssContext::addRule (CssSelector *sel, CssPropertyList *props,