SVG namespaced documents should create HTML elements
-
Juan J. Collas
Oops, formatting wrecked the patch.
diff --git a/src/html/document.js b/src/html/document.js index f8947fa..9e47662 100644 --- a/src/html/document.js +++ b/src/html/document.js @@ -89,6 +89,8 @@ __extend__(HTMLDocument.prototype, { return this.createElement(local); }else if ("http://www.w3.org/1999/xhtml" == uri) { return this.createElement(local); + }else if ("http://www.w3.org/2000/svg" == uri) { + return this.createElement(local); } else if ("http://www.w3.org/1998/Math/MathML" == uri) { if (!this.mathplayerinitialized) { var obj = this.createElement("object"); -
Thatcher
- State changed from new to open
- Assigned user set to Thatcher
- Milestone set to 1.2.x
Can you supply a thorough test case? I will also but shouldn't it depend on if the document type is xhtml or html? I'm not sure, but I have found Envjs to be a great bridge for svg development in the past so I'd really like to focus on it as feature.
Thanks for the ticket, I'll dig deep and report back soon.
Thatcher
-
Thatcher
- State changed from open to resolved
ok I explored this and think I'm on the same page. fortunately the patch was applied awhile ago. it may be a couple weeks before we get good coverage in the spec tests for xml embedded in html but for now we have what I hope you'll agree is a lowest common denomitator.
-
Thatcher
ps i removed the mathml stuff too, the other code was actually nonsensical and was a monkey-patch (you can blame me) that came from integration with the html parser.
-
John Firebaugh
I'm not seeing the above patch in master, and SVG elements aren't created as HTML elements. It seems this ticket should be reopened.
-
Steven Parkes
I have a little code for this in my branch but haven't looked at how it compares to 1.2.
What I'm curious about, though, is what people think the expected outcome is here. Maybe I'm missing something important, but I don't think these should be created as HTML elements. They need to be SVG elements. That's what I see Chrome and FireFox doing. My code does createElementNS's and the result is in the svg namespace. Are people expecting something other than that?
-
John Firebaugh
I think the issue is that SVG elements in Chrome and Firefox inherit from (or at least duck-type as) HTMLElements -- they have all of the HTMLElement methods, whereas in env.js they don't at present.
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.