RESOLVED WORKSFORME 35643
[Qt] Use of 'serif' and 'sans-serif' in css overrides higher priority font families if present
https://bugs.webkit.org/show_bug.cgi?id=35643
Summary [Qt] Use of 'serif' and 'sans-serif' in css overrides higher priority font fa...
Tor Arne Vestbø
Reported 2010-03-03 03:29:19 PST
This bug report originated from issue QTBUG-6730 http://bugreports.qt.nokia.com/browse/QTBUG-6730 --- Description --- In css stylesheets, if you include the 'serif' or 'sans-serif' font families in your font hierarchy they will be used, regardless of priority. For example: <p>font-family: "Lucida Grande", "Lucida Sans Unicode", Trebuchet, Tahoma, sans-serif</p> <p>Although the Lucida Grande font is present, Webkit uses the system sans-serif font for text rendering. If you simply remove the sans-serif, the correct font (Lucida Grande) is used:</p> <p>font-family: "Lucida Grande", "Lucida Sans Unicode", Trebuchet, Tahoma</p> <p>Note that is behavior only occurs with the 'serif' and sans-serif (default) fonts. Our workaround is just to not specify serif or sans-serif as backup fonts and just assume that one of the previously listed fonts will be present. A few other comments:</p> <ul class="alternate" type="square"> <li>This bug only appears for Qt 4.6.0. The css stylesheets worked properly on previous versions of Qt.</li> <li>The bug is identical on mac and windows.</li> <li>The bug does NOT appear with the latest version of Safari (4.0.3) which also uses WebKit .</li> </ul> --- Comments --- Am I right that this issue with with Webkit, and not with the QTextDocument or the QWidget stylesheet? In this case, it should be reported on bugs.webkit.org in the QtWebkit Qt component
Attachments
Tor Arne Vestbø
Comment 1 2010-03-15 05:14:08 PDT
Tried this in trunk on Mac OS X, with: data:text/html,<p style="font-family: Futura, serif, sans-serif; font-size: 100pt">ABC</p> And I still got futura "ABC".
Mik B. Shvets
Comment 2 2010-04-30 14:36:12 PDT
I could reproduce this bug with following code: body {font:0.9em "Lucida Grande", "Lucida Sans Unicode", Trebuchet, Helvetica, Arial,verdana, sans-serif; height: 100%;} qt 4.6.2, Linux (tested in rekonq browser)
Antonio Gomes
Comment 3 2010-05-03 09:12:13 PDT
(In reply to comment #2) > I could reproduce this bug with following code: > body {font:0.9em "Lucida Grande", "Lucida Sans Unicode", Trebuchet, Helvetica, > Arial,verdana, sans-serif; height: 100%;} > > qt 4.6.2, Linux (tested in rekonq browser) would it be possible for you to re-test that agaisnt QtWebKit2.0 (or webkit within qt 4.7) once it is released and reopen the bug, if it fails?
Mik B. Shvets
Comment 4 2010-05-03 10:06:24 PDT
Sure, no problem. I could build qt trunk and test if needed.
Note You need to log in before you can comment on or make changes to this bug.