WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
20506
WRONG_DOCUMENT_ERR: DOM Exception 4 with JavaScript's 'document' object and XHTML-inline SVG
https://bugs.webkit.org/show_bug.cgi?id=20506
Summary
WRONG_DOCUMENT_ERR: DOM Exception 4 with JavaScript's 'document' object and X...
elliottcable
Reported
2008-08-25 00:21:58 PDT
Error: WRONG_DOCUMENT_ERR: DOM Exception 4
http://pastie.org/259289
(line 59) I could be wrong (I'm a noob to this stuff), but I believe this has something to do with trying to refer to the 'document' object in JavaScript with embedded SVG within an XHTML document (true XHTML, with proper markup and served as application/xhtml+xml).
Attachments
test case
(2.55 KB, application/xhtml+xml)
2008-08-25 03:26 PDT
,
Alexey Proskuryakov
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
elliottcable
Comment 1
2008-08-25 01:22:39 PDT
After some more debugging, I find that the line causing the error is in fact line 59 of this slightly modified test case:
http://pastie.org/259289
So it has something to do with appendChild, though I'm still not sure exactly what.
Alexey Proskuryakov
Comment 2
2008-08-25 03:26:55 PDT
Created
attachment 22976
[details]
test case Attaching the same test as an attachment. It is not immediately obvious whether this is a bug or just a difference with Firefox. In any case, you can probably work around this by using importNode to ensure that the nodes are in the same document.
elliottcable
Comment 3
2008-08-25 09:53:20 PDT
(In reply to
comment #2
)
> It is not immediately obvious whether this is a bug or just a difference with > Firefox. In any case, you can probably work around this by using importNode to > ensure that the nodes are in the same document.
Not sure about that - trying to debug the same original code in FireFox as well, right now, causes other, even weirder errors there ("[Exception... "Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIDOMHTMLDocument.importNode]" nsresult: "0x80070057 (NS_ERROR_ILLEGAL_VALUE)" location: "JS frame ::
http://geoffrey.elliottcable.name/board/4/game_board_4.xhtml
:: writeSVG :: line 355" data: no]"? What does that even _mean_?)
elliottcable
Comment 4
2008-08-25 09:57:44 PDT
Another thing worth pointing out is that FireFox chokes up on the use of ( new DOMParser() ).parseFromString(svgSource, "text/xml") when the source is SVG - it returns XML objects, not the SVG objects that it actually uses internally for SVG elements. Thus there's problems with XML/SVG documents and using that - perhaps there's a similar problem going on under the hood here?
Lucas Forschler
Comment 5
2019-02-06 09:03:18 PST
Mass moving XML DOM bugs to the "DOM" Component.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug