Open Bug 474376 Opened 16 years ago Updated 2 years ago

Trying to set .innerHTML to invalid markup in XHTML causes content to be blank

Categories

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

defect

Tracking

()

People

(Reporter: BijuMailList, Unassigned)

Details

(Keywords: html5)

Attachments

(2 files)

+++ This bug was initially created as a clone of Bug #466751 +++ Trying to set .innerHTML to invalid markup in XHTML causes content to be blank Steps:- 1. Ensure javascript is turned on 2. goto attachment 350091 [details] Result:- user see "This is a . In Firefox, expect an exception." Expected:- user see "This is a test. In Firefox, expect an exception." Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2a1pre) Gecko/20090118 Minefield/3.2a1pre
Same as 460437? There should be a test for this that should fail.
Attached file innerHtmlTest.xhtml
test case (In reply to comment #1) > Same as 460437? There should be a test for this that should fail. bug 460437 looks like we are unable to find node if error occurs. Which is fixed, but now only the innerHTML content is blank.
I don't see how this is related to bug 474376. This bug existed before then as far as I can tell, and is caused by us clearing out the childNodes before actually parsing the innerHTML: http://mxr.mozilla.org/mozilla1.9.1/source/content/html/content/src/nsGenericHTMLElement.cpp?mark=721,739#711
No longer depends on: 466751
(In reply to comment #3) > I don't see how this is related to bug 474376. Er, I meant bug 466751 of course.
What does html5 say about this?
Keywords: html5
http://www.whatwg.org/specs/web-apps/current-work/#innerhtml It raises an exception if the XML parser has a well-formedness error.
I understand as follows. Step 1. do the parsing so it will be erroring out at Step 1. And the removal of existing child nodes are at Step 3. which will never executed. Hence we should retain the existing content and attachment 350091 [details] should display "This is a test. In Firefox, expect an exception." And when assigning to Document element on error if the document was in parsing state we should continue parsing the original document.
Attached patch patchSplinter Review
I have to add a test for comment #6
Comment on attachment 425766 [details] [diff] [review] patch jst are you a reviewer? if not pl. change to the right person
Attachment #425766 - Flags: review?(jst)
Comment on attachment 425766 [details] [diff] [review] patch Clearing out old reviews. If this is still relevant, please re-request review for this patch.
Attachment #425766 - Flags: review?(jst)
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

Creator:
Created:
Updated:
Size: