Bug 73153 - Generic font families and font sizes broken in <foreignObject> in SVG-in-img
: Generic font families and font sizes broken in <foreignObject> in SVG-in-img
Status: NEW
: WebKit
: 528+ (Nightly build)
: All All
: P2 Normal
Assigned To:
  Show dependency treegraph
Reported: 2011-11-25 17:55 PST by
Modified: 2012-05-22 18:16 PST (History)

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


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

Description From 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 From 2012-05-22 11:33:00 PST -------
Could you please attach a test case?

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

------- Comment #5 From 2012-05-22 16:59:32 PST -------
(Sigh, that of course broke the layout anyway and made all the comments really wide.  Sorry!)
------- Comment #6 From 2012-05-22 18:13:02 PST -------
Created an attachment (id=143422) [details]

Threw together a quick testcase from dom2canvas code. If you don't see anything, your browser fails the testcase.
------- Comment #7 From 2012-05-22 18:16:20 PST -------
Created an attachment (id=143424) [details]

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