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

RESOLVED FIXED in mozilla1.9.1b3

Status

()

Core
Graphics
P4
normal
RESOLVED FIXED
9 years ago
9 years ago

People

(Reporter: karlt, Assigned: karlt)

Tracking

({fixed1.9.1, pp})

Trunk
mozilla1.9.1b3
x86
Linux
fixed1.9.1, pp
Points:
---
Dependency tree / graph
Bug Flags:
blocking1.9.1 +
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments, 3 obsolete attachments)

Comment hidden (empty)
(Assignee)

Comment 1

9 years ago
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
(Assignee)

Updated

9 years ago
Depends on: 469752
(Assignee)

Comment 2

9 years ago
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.
(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...
(Assignee)

Comment 4

9 years ago
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.
(Assignee)

Comment 5

9 years ago
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).
Attachment #354274 - Attachment is obsolete: true
Attachment #354474 - Flags: review?(roc)
(Assignee)

Comment 6

9 years ago
Created attachment 354480 [details] [diff] [review]
patch v1.0.2

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+
(Assignee)

Comment 9

9 years ago
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().
Attachment #354480 - Attachment is obsolete: true
(Assignee)

Comment 10

9 years ago
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
Last Resolved: 9 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.1b3
(Assignee)

Comment 11

9 years ago
Fixed on 1.9.1:
http://hg.mozilla.org/releases/mozilla-1.9.1/rev/3fac3f86737c
http://hg.mozilla.org/releases/mozilla-1.9.1/rev/a9818a7bd1f3
Keywords: fixed1.9.1
(Assignee)

Comment 12

9 years ago
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.