As a security precaution, we have turned on the setting "Require API key authentication for API requests" for everyone. If this has broken something, please contact bugzilla-admin@mozilla.org
Last Comment Bug 468218 - implement @font-face { src:local() } on Linux
: implement @font-face { src:local() } on Linux
Status: RESOLVED FIXED
: fixed1.9.1, pp
Product: Core
Classification: Components
Component: Graphics (show other bugs)
: Trunk
: x86 Linux
: P4 normal (vote)
: mozilla1.9.1b3
Assigned To: Karl Tomlinson (back Feb 1 :karlt)
:
: Milan Sreckovic [:milan]
Mentors:
Depends on: 469752
Blocks: 70132
  Show dependency treegraph
 
Reported: 2008-12-05 22:57 PST by Karl Tomlinson (back Feb 1 :karlt)
Modified: 2009-01-06 19:09 PST (History)
12 users (show)
vladimir: blocking1.9.1+
karlt: in‑testsuite+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
patch (44.15 KB, patch)
2008-12-22 21:23 PST, Karl Tomlinson (back Feb 1 :karlt)
no flags Details | Diff | Splinter Review
reftest (4.69 KB, patch)
2008-12-25 20:23 PST, Karl Tomlinson (back Feb 1 :karlt)
no flags Details | Diff | Splinter Review
patch v1.0.1 (44.14 KB, patch)
2008-12-25 20:24 PST, Karl Tomlinson (back Feb 1 :karlt)
no flags Details | Diff | Splinter Review
patch v1.0.2 (44.17 KB, patch)
2008-12-26 00:42 PST, Karl Tomlinson (back Feb 1 :karlt)
roc: review+
Details | Diff | Splinter Review
patch v1.1 (44.33 KB, patch)
2009-01-02 19:20 PST, Karl Tomlinson (back Feb 1 :karlt)
no flags Details | Diff | Splinter Review

Description User image Karl Tomlinson (back Feb 1 :karlt) 2008-12-05 22:57:20 PST

    
Comment 1 User image Karl Tomlinson (back Feb 1 :karlt) 2008-12-05 22:59:28 PST
I guess this blocks 1.9.1 for platform parity reasons, at least.
Comment 2 User image Karl Tomlinson (back Feb 1 :karlt) 2008-12-22 21:23:30 PST
Created attachment 354274 [details] [diff] [review]
patch

I'll do a little more testing and see if I can put together some reftests.

This patch also changes the creation of patterns for gfxDownloadedFcFontEntry from lazy to immediate.  Fonts are only downloaded when they are expected to be used, so lazy creation of patterns was an unnecessary complication.
Comment 3 User image David Baron :dbaron: ⌚️UTC-8 2008-12-22 21:30:56 PST
(In reply to comment #2)
> I'll do a little more testing and see if I can put together some reftests.

That sounds a little challenging, but I can imagine you might be able to put something together using nsIFontEnumerator:
http://mxr.mozilla.org/mozilla-central/source/gfx/idl/nsIFontEnumerator.idl
You might actually want to combine that with the reftest-inside-mochitest stuff that bz put together:
http://mxr.mozilla.org/mozilla-central/search?string=WindowSnapshot
(That would let you find a 'font-family: foo' that causes the text to appear different from 'font-family: bar', and then check that you get the expected results with src:local(foo) and src:local(bar) in various combinations, including, perhaps, fun with other descriptors.)

But if you had other ideas for how to test, don't let this one stop you...
Comment 4 User image Karl Tomlinson (back Feb 1 :karlt) 2008-12-25 20:23:06 PST
Created attachment 354472 [details] [diff] [review]
reftest

Thanks for your suggestions, David.  My plans weren't quite that fancy.

This just tries a set of fonts, at least one of which is expected to be present on almost every system.
Comment 5 User image Karl Tomlinson (back Feb 1 :karlt) 2008-12-25 20:24:55 PST
Created attachment 354474 [details] [diff] [review]
patch v1.0.1

Corrected a wrong variable name being used by non-OpenType fonts (detected by the reftest).
Comment 6 User image Karl Tomlinson (back Feb 1 :karlt) 2008-12-26 00:42:09 PST
Created attachment 354480 [details] [diff] [review]
patch v1.0.2

correction to the wrong variable correction
Comment 7 User image David Baron :dbaron: ⌚️UTC-8 2008-12-26 06:46:39 PST
For what it's worth, there's an existing test that does the font-enumerator half of comment 3, in layout/base/tests/test_bug394057.html .
Comment 8 User image Robert O'Callahan (:roc) (email my personal email if necessary) 2008-12-31 01:00:59 PST
Comment on attachment 354480 [details] [diff] [review]
patch v1.0.2

+    if (mPatterns.Length() != 0) {
         // Remove back reference to this font entry and the face in case
         // anyone holds a reference to the pattern.

Shouldn't we assert here that mPatterns.Length() == 1? It seems to me that a gfxDownloadedFcFontEntry never has more than one pattern, is that true? If so, should be documented.

Otherwise the patch looks good.
Comment 9 User image Karl Tomlinson (back Feb 1 :karlt) 2009-01-02 19:20:02 PST
Created attachment 355194 [details] [diff] [review]
patch v1.1

(In reply to comment #8)
> Shouldn't we assert here that mPatterns.Length() == 1? It seems to me that a
> gfxDownloadedFcFontEntry never has more than one pattern, is that true? If so,
> should be documented.

Yes, that's right.  Added assertion, as well as a comment in InitPattern().
Comment 10 User image Karl Tomlinson (back Feb 1 :karlt) 2009-01-02 19:48:33 PST
Fixed on m-c:
http://hg.mozilla.org/mozilla-central/rev/b66168eafccb

In testsuite:
http://hg.mozilla.org/mozilla-central/rev/073903c476f3
Comment 12 User image Karl Tomlinson (back Feb 1 :karlt) 2009-01-06 19:09:04 PST
Forgot some new files in the reftest on 1.9.1:
http://hg.mozilla.org/releases/mozilla-1.9.1/rev/9152e412a70f

Note You need to log in before you can comment on or make changes to this bug.