Bug 20382 - Support svg elements inside plain HTML content
Summary: Support svg elements inside plain HTML content
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 528+ (Nightly build)
Hardware: Macintosh Intel OS X 10.5
: P2 Enhancement
Assignee: Nobody
URL: http://livedom.validator.nu/?%3Ch1%3E...
Depends on:
Reported: 2008-08-14 06:42 PDT by Henri Sivonen
Modified: 2011-03-21 11:20 PDT (History)
6 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Henri Sivonen 2008-08-14 06:42:04 PDT
Build: WebKit-SVN-r35752

Steps to reproduce:
 1) Load http://livedom.validator.nu/?%3Ch1%3Efoo%3C%2Fh1%3E%0A%3Csvg%20%20viewBox%3D'0%200%20100%20100'%3E%0A%20%20%20%20%3Ccircle%20fill%3D'green'%20cx%3D'0'%20cy%3D'0'%20r%3D'20'%2F%3E%0A%3C%2Fsvg%3E

Actual results:
Expected to see the lower right quarter of a green circle in the Rendered View after the heading "foo".

Actual results:
The <h1> element renders but <svg> not.

Additional info:
The document object in the iframe is an HTML DOM. The elements (both HTML and SVG) are created with createElementNS. It works in Firefox 3 and Opera 9.5.
Comment 1 Eric Seidel (no email) 2008-10-07 16:38:26 PDT
Really?  This is effectively flattening the svg namespace into HTML.  Opera and FF really do this?
Comment 2 Henri Sivonen 2008-10-08 10:19:28 PDT
It's not supposed to flatten the namespace. It's supposed to insert the SVG stuff in the SVG namespace. Firebug in Firefox shows that the SVG nodes end up in the SVG namespace. Web Inspector in WebKit shows that the SVG nodes implmement SVG-specific interfaces.
Comment 3 Eric Seidel (no email) 2008-10-21 15:40:25 PDT
We just have to decide if we want to do this or not.  This content is not valid SVG, certainly not valid XHTML but obviously FireFox has chosen to add this support (which I don't blame them, it sure makes things easier for authors).
Comment 4 Henri Sivonen 2008-11-03 05:15:45 PST
Note that SVG-in-text/html support will mean that SVG subtrees (nodes in the SVG namespace with a subtree root whose local name is svg) need to be painted when inserted in an HTML-mode DOM.
Comment 5 Joel Parks 2011-03-09 12:53:48 PST
see BR-6699
Comment 6 Henri Sivonen 2011-03-14 01:22:50 PDT
This has been fixed at some point.