Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.12.12, 5.15.10, 6.1.3, 6.2.1
-
None
-
-
2e2f1e2af7 (qt/qtbase/dev) 699e661b2b (qt/qtbase/6.3) 2e2f1e2af7 (qt/tqtc-qtbase/dev) 699e661b2b (qt/tqtc-qtbase/6.3)
Description
When an instance of QTextDocument is used for printing or print preview and the corresponding CSS stylesheet contains media rules, all except "screen" are ignored.
The problem has been reported at
https://bugs.kde.org/show_bug.cgi?id=417104 and https://bugs.kde.org/show_bug.cgi?id=429469 and reported at
https://invent.kde.org/office/kmymoney/-/merge_requests/118#note_340020 for further investigation.
The HTML text underlying the bug reports contains css styles in the following form:
<style type="text/css"> ... @media screen { } @media print { } ... </style>
Based on the call stack of QTextDocument::setHtml(),
the following was found out: The QCssParser checks this tag in QCssParser::testMedia() and considers it in StyleSelector::styleRulesForNode, but in QTextHtmlParser::declarationsForNode the possible medium is hardcoded to `screen`.