Open Bug 580860 Opened 11 years ago Updated 5 years ago

font-face rules are not included in complete page save as


(Firefox :: File Handling, defect)

Not set





(Reporter: kpdecker, Assigned: juca)





(1 file)

User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:2.0b1) Gecko/20100630 Firefox/4.0b1
Build Identifier: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:2.0b1) Gecko/20100630 Firefox/4.0b1

When using the Save Page As feature, Firefox 4.0b1 does not save the associated font files into the local _files directory or update the associated url for the local file path.

Reproducible: Always

Steps to Reproduce:
1. Browse to
2. Save Page As from the file menu
3. Save the page
4. Examine the local file that was saved as a result of this operation.
Actual Results:  
The font file is not saved and the render has to default over to the the default font face.

Expected Results:  
The font is accessible on the local file system and the local file is rendered the same as the remote version.
Probably for the same reason as background-images and the like.
Confirming as I don't find any bug on this.
Blocks: 115634
Component: General → File Handling
Ever confirmed: true
Product: Firefox → Core
QA Contact: general → file-handling
Assignee: nobody → jdaggett
I am working on a patch for it. It already finds every @font-face rule in <style> nodes and downloads the font files. The current patch has an issue with the naming of the files though. It is saving the files with .asc suffix (and _002.asc, _003.asc for files that have repeated basename). Any idea how to handle that? I dont know why it's dropping the file extensions that are declared in the url descriptors.
OS: Mac OS X → Windows 7
Assignee: jdaggett → juca
Attachment #492976 - Flags: feedback?(jdaggett)
OS: Windows 7 → All
Hardware: x86 → All
Version: unspecified → Trunk
I still need some feedback on how to fix the wrong naming of downloaded font files.
Flags: needinfo?(jdaggett)
Would be nice to have this for websites which show bugs only with webfonts, i.e. bug 994923.
clearing this old and ignored needinfo to clear my dashboard
Flags: needinfo?(jdaggett)
Flags: needinfo?(jdaggett)
Comment on attachment 492976 [details] [diff] [review]
initial implementation with wrong naming of downloaded font files

Saving links referenced by the src array of @font-face rules is definitely something necessary to save webfonts but this feature will require a lot more than just that. Webfonts are lazy loaded, so stylesheets can include definitions of webfont resources that are never used on a page. I think the save code would need to look at the fonts used on the page and store those under reworked names.
Flags: needinfo?(jdaggett)
Attachment #492976 - Flags: feedback?(jdaggett)
Product: Core → Firefox
Version: Trunk → unspecified
You need to log in before you can comment on or make changes to this bug.