summaryrefslogtreecommitdiff
path: root/src/styleengine.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/styleengine.cc')
-rw-r--r--src/styleengine.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/styleengine.cc b/src/styleengine.cc
index 7b151469..fa628d84 100644
--- a/src/styleengine.cc
+++ b/src/styleengine.cc
@@ -64,6 +64,7 @@ void StyleEngine::startElement (int element) {
n->klass = NULL;
n->pseudo = NULL;
n->styleAttribute = NULL;
+ n->inheritBackgroundColor = false;
}
void StyleEngine::setId (const char *id) {
@@ -95,6 +96,16 @@ void StyleEngine::setNonCssHints (CssPropertyList *nonCssHints) {
}
/**
+ * \brief Use of the background color of the parent style as default.
+ * This is only used in table code to allow for colors specified for
+ * table rows as table rows are currently no widgets and therefore
+ * don't draw any background.
+ */
+void StyleEngine::inheritBackgroundColor () {
+ stack->getRef (stack->size () - 1)->inheritBackgroundColor = true;
+}
+
+/**
* \brief set the CSS pseudo class (e.g. "link", "visited").
*/
void StyleEngine::setPseudo (const char *pseudo) {
@@ -337,6 +348,10 @@ Style * StyleEngine::style0 (CssPropertyList *nonCssProperties) {
StyleAttrs attrs = *stack->getRef (stack->size () - 2)->style;
// reset values that are not inherited according to CSS
attrs.resetValues ();
+
+ if (stack->getRef (stack->size () - 2)->inheritBackgroundColor)
+ attrs.backgroundColor =
+ stack->getRef (stack->size () - 2)->style->backgroundColor;
cssContext->apply (&props, this, tagStyleProps, nonCssProperties);