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
Product: WebKit
Classification: Unclassified
Component: SVG
: 528+ (Nightly build)
: All All
: P2 Normal
Assigned To: Nobody
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-11-25 17:55 PST by Eli Grey (:sephr)
Modified: 2012-05-22 18:16 PDT (History)
4 users (show)

See Also:


Attachments
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:

data:text/html;base64,PCFET0NUWVBFIGh0bWw%2BDQo8aW1nIHNyYz0iZGF0YTppbWFnZS9zdmcreG1sLDxzdmcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJz48dGV4dCB4PScyMCcgeT0nMjAnIGZvbnQtc2l6ZT0nMjBweCcgZm9udC1mYW1pbHk9J3NhbnMtc2VyaWYnPmhlbGxvPC90ZXh0Pjwvc3ZnPiI%2BDQo%3D
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]
Testcase

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]
Testcase

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