summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2021-05-03 12:21:23 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-05-08 13:02:26 +0000
commitb275c5b1baa7df8704d1842ae0f1ff4ba99fb580 (patch)
treed63fc7d098321f195278724dda9d8562d1146d22 /src
parent70c1f674cae33d59c0e5b3c1ca5c4d523ddeff40 (diff)
Allow background inheritance between non-body block elements
Most nested block elements are merged together, so while we shouldn't do real inheritance we need to do it when block elements are combined. Fixes: QTBUG-91236 Change-Id: I9e37b15f705db92c79a620d0d772f25d0ee72b8d Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit f94b0e1dd999a6bb8dfa4471fd63c395fc8e2302) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r--src/gui/text/qtexthtmlparser.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gui/text/qtexthtmlparser.cpp b/src/gui/text/qtexthtmlparser.cpp
index a242d5e645..2a812ad999 100644
--- a/src/gui/text/qtexthtmlparser.cpp
+++ b/src/gui/text/qtexthtmlparser.cpp
@@ -1032,8 +1032,11 @@ void QTextHtmlParserNode::initializeProperties(const QTextHtmlParserNode *parent
// we don't paint per-row background colors, yet. so as an
// exception inherit the background color here
// we also inherit the background between inline elements
+ // we also inherit from non-body block elements since we merge them together
if ((parent->id != Html_tr || !isTableCell())
- && (displayMode != QTextHtmlElement::DisplayInline || parent->displayMode != QTextHtmlElement::DisplayInline)) {
+ && (displayMode != QTextHtmlElement::DisplayInline || parent->displayMode != QTextHtmlElement::DisplayInline)
+ && (parent->id == Html_body || displayMode != QTextHtmlElement::DisplayBlock || parent->displayMode != QTextHtmlElement::DisplayBlock)
+ ) {
charFormat.clearProperty(QTextFormat::BackgroundBrush);
}