Open Bug 302084 Opened 19 years ago Updated 2 years ago

Setting innerhtml on an XML node that has a prefix undeclared in its current document fails

Categories

(Core :: DOM: Core & HTML, defect, P5)

x86
All
defect

Tracking

()

People

(Reporter: doronr, Unassigned)

References

()

Details

Attachments

(2 files)

The <html:span> in the anonymous content has a prefix not defined in the main
document, and causes:

JavaScript error: , line 0: uncaught exception: [Exception... "An invalid or
illegal string was specified"  code: "12" nsresult: "0x8053000c
(NS_ERROR_DOM_SYNTAX_ERR)"  location:
"http://www.nexgenmedia.net/bugs/xbl-bug/bug.xml Line: 17"]

when trying to set innerHTML.  Filing per bz's request.
Testcase? Why is this a bug?
testcase is url.
Oh, I see. This is in XBL. Would probably be a good idea to mention that. ;-)
Assignee: general → general
Component: DOM: Mozilla Extensions → XBL
Summary: Setting innerhtml on an XML node that has a prefix undeclared in its current document fails → Setting innerhtml on an XML node in XBL that has a prefix undeclared in its current document fails
No, this was in the right component (the one I told doron to file in).  One
could create a testcase with importNode that needs no XBL.

Doron, I'd attach testcases to bugs... ;)
Assignee: general → general
Component: XBL → DOM: Mozilla Extensions
Summary: Setting innerhtml on an XML node in XBL that has a prefix undeclared in its current document fails → Setting innerhtml on an XML node that has a prefix undeclared in its current document fails
Someone needs to teach doron what a testcase is...
Attached file xbl file
xbl testcases need 2 files, always annoying to have to attach em here :)
Attached file html file
Dude. A testcase should never use XBL unless XBL is absolutely critical to
reproducing the bug. Any chance you can reproduce this without XBL?
(In reply to comment #4)
> No, this was in the right component (the one I told doron to file in).  One
> could create a testcase with importNode that needs no XBL.
> 
> Doron, I'd attach testcases to bugs... ;)

I tried using XMLHttpRequest to load an xml file (<?xml version="1.0"
encoding="UTF-8"?><foo:bar
xmlns:foo="http://foo"><foo:foo2></foo:foo2></foo:bar>) and import <foo:foo2/>,
append to document, and set innerHTML, but that does a noop.  So I guess I am
missing a step.
For what it's worth, a testcase would probably involve something like createElementNS("namespace", "prefix:localname")  (where you make sure the prefix is not bound to a URI).

The question is how to deal with this.  The only sane way I can think of is to use a serializer to create the context string instead of just trying to hack things in like we do now...
Assignee: general → nobody
QA Contact: ian → general
Component: DOM: Mozilla Extensions → DOM
https://bugzilla.mozilla.org/show_bug.cgi?id=1472046

Move all DOM bugs that haven’t been updated in more than 3 years and has no one currently assigned to P5.

If you have questions, please contact :mdaly.
Priority: -- → P5
Component: DOM → DOM: Core & HTML
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: