path: root/src/gui/text/qcssparser_p.h
diff options
authorAndy Shaw <>2014-12-04 11:00:30 +0100
committerAndy Shaw <>2015-03-25 11:55:47 +0000
commit2e4a107e7e97a2dc36471cbd795ec94096f1a771 (patch)
tree369fc5b3fc324ff4c8f5dde382078a40286dfc50 /src/gui/text/qcssparser_p.h
parent738c07542a0bbf867661520559fed9feda985935 (diff)
Ensure that CSS rules are inherited from the parent tags
When CSS is set in a head tag then it was not being inherited by the child tags when the CSS specification indicates that the properties are in fact inherited. This ensures that those properties are inherited and the non inheritable ones are unchanged. A test is added to cover the different situations with inheritance and a fix is done for the QTextDocumentFragment test which was passing despite having incorrect defaults. Task-number: QTBUG-28770 Task-number: QTBUG-34153 Change-Id: I55966240845a885852a04ecb82c61926dea9f800 Reviewed-by: Simon Hausmann <>
Diffstat (limited to 'src/gui/text/qcssparser_p.h')
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gui/text/qcssparser_p.h b/src/gui/text/qcssparser_p.h
index ebd9904762..75802ba36a 100644
--- a/src/gui/text/qcssparser_p.h
+++ b/src/gui/text/qcssparser_p.h
@@ -426,12 +426,13 @@ struct Q_GUI_EXPORT Declaration
struct DeclarationData : public QSharedData
- inline DeclarationData() : propertyId(UnknownProperty), important(false) {}
+ inline DeclarationData() : propertyId(UnknownProperty), important(false), inheritable(false) {}
QString property;
Property propertyId;
QVector<Value> values;
QVariant parsed;
- bool important;
+ bool important:1;
+ bool inheritable:1;
QExplicitlySharedDataPointer<DeclarationData> d;
inline Declaration() : d(new DeclarationData()) {}