Bug 35643
| Summary: | [Qt] Use of 'serif' and 'sans-serif' in css overrides higher priority font families if present | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Tor Arne Vestbø <vestbo> |
| Component: | New Bugs | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED WORKSFORME | ||
| Severity: | Normal | CC: | solshark, tonikitoo |
| Priority: | P2 | Keywords: | Qt |
| Version: | 528+ (Nightly build) | ||
| Hardware: | Other | ||
| OS: | OS X 10.5 | ||
Tor Arne Vestbø
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 | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Tor Arne Vestbø
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
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
(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
Sure, no problem. I could build qt trunk and test if needed.