Closed Bug 468218 Opened 12 years ago Closed 11 years ago

implement @font-face { src:local() } on Linux

Categories

(Core :: Graphics, defect, P4)

x86
Linux
defect

Tracking

()

RESOLVED FIXED
mozilla1.9.1b3

People

(Reporter: karlt, Assigned: karlt)

References

Details

(Keywords: fixed1.9.1, platform-parity)

Attachments

(2 files, 3 obsolete files)

No description provided.
I guess this blocks 1.9.1 for platform parity reasons, at least.
Flags: blocking1.9.1?
Flags: blocking1.9.1? → blocking1.9.1+
Priority: -- → P4
Depends on: 469752
Attached patch patch (obsolete) — Splinter Review
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.
(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...
Attached patch reftestSplinter Review
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.
Attached patch patch v1.0.1 (obsolete) — Splinter Review
Corrected a wrong variable name being used by non-OpenType fonts (detected by the reftest).
Attachment #354274 - Attachment is obsolete: true
Attachment #354474 - Flags: review?(roc)
Attached patch patch v1.0.2 (obsolete) — Splinter Review
correction to the wrong variable correction
Attachment #354474 - Attachment is obsolete: true
Attachment #354480 - Flags: review?(roc)
Attachment #354474 - Flags: review?(roc)
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 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.
Attachment #354480 - Flags: review?(roc) → review+
Attached patch patch v1.1Splinter Review
(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().
Attachment #354480 - Attachment is obsolete: true
Fixed on m-c:
http://hg.mozilla.org/mozilla-central/rev/b66168eafccb

In testsuite:
http://hg.mozilla.org/mozilla-central/rev/073903c476f3
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.1b3
Forgot some new files in the reftest on 1.9.1:
http://hg.mozilla.org/releases/mozilla-1.9.1/rev/9152e412a70f
You need to log in before you can comment on or make changes to this bug.