Bug 73153 - Generic font families and font sizes broken in <foreignObject> in SVG-in-img
Summary: Generic font families and font sizes broken in <foreignObject> in SVG-in-img
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
: 87069 (view as bug list)
Depends on:
Reported: 2011-11-25 17:55 PST by Eli Grey (:sephr)
Modified: 2012-05-22 18:16 PDT (History)
4 users (show)

See Also:

Testcase (662 bytes, application/xhtml+xml)
2012-05-22 18:13 PDT, Eli Grey (:sephr)
no flags Details
Testcase (677 bytes, application/xhtml+xml)
2012-05-22 18:16 PDT, Eli Grey (:sephr)
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eli Grey (:sephr) 2011-11-25 17:55:33 PST
The generic font family, "serif", is not the default font (defaulting to monospace) for HTML in a <foreignObject>, and is also not able to be used manually with font-family: serif;

The font size keyword, medium, is also not the default font size (defaulting to 1px), also has no effect when used manually. None of the other font size keywords (xx-/x-/small, medium, xx-/x-/large) work when used manually either.

This behavior breaks my DOM screenshot library, which puts DOM nodes into an SVG and then loads the SVG in an image and draws it to canvas.
Comment 1 Alexey Proskuryakov 2012-05-22 11:33:00 PDT
Could you please attach a test case?

See also: bug 68090, bug 87069.
Comment 2 Cameron McCormack 2012-05-22 16:54:08 PDT
*** Bug 87069 has been marked as a duplicate of this bug. ***
Comment 3 Cameron McCormack 2012-05-22 16:58:04 PDT
Here's a small test that should show sans-serif text.
Comment 4 Cameron McCormack 2012-05-22 16:58:44 PDT
I'll put it here, so it doesn't break the layout of Bugzilla:

Comment 5 Cameron McCormack 2012-05-22 16:59:32 PDT
(Sigh, that of course broke the layout anyway and made all the comments really wide.  Sorry!)
Comment 6 Eli Grey (:sephr) 2012-05-22 18:13:02 PDT
Created attachment 143422 [details]

Threw together a quick testcase from dom2canvas code. If you don't see anything, your browser fails the testcase.
Comment 7 Eli Grey (:sephr) 2012-05-22 18:16:20 PDT
Created attachment 143424 [details]

Firefox had an issue with <script>-in-<img>