createContextualFragment incorrectly parses <OBJECT> element with nested comment

VERIFIED FIXED in M18

Status

()

Core
DOM
P3
normal
VERIFIED FIXED
18 years ago
17 years ago

People

(Reporter: aw, Assigned: harishd)

Tracking

Trunk
x86
Windows NT
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [nsbeta3+][Fix in hand])

Attachments

(4 attachments)

(Reporter)

Description

18 years ago
createContextualFragment properly parses an <OBJECT> element fragment into an 
HTMLObjectElement object. If the <OBJECT> element contains a nested HTML 
comment, then the entire <OBJECT> element is parsed into a Comment object 
instead.

e.g. this:

<OBJECT CLASSID="foo">
        <!-- Nested comment is here -->
</OBJECT>

parses as a Comment, while this:

<OBJECT CLASSID="foo">
</OBJECT>

parses as an HTMLObjectElement.

Load the attached test case (commentfrag.xul), when it loads it dumps this to 
the console:

element 1 is:
<OBJECT CLASSID="foo">
        <!-- Nested comment is here -->
</OBJECT>
element 1 parses as [object Comment]
element 2 is:
<OBJECT CLASSID="foo">
</OBJECT>
element 2 parses as [object HTMLObjectElement]

Both elements should parse as an HTMLObjectElement.

Mozilla Build ID: 2000062720
(Reporter)

Comment 1

18 years ago
Created attachment 10753 [details]
test case commentfrag.xul
Created attachment 10813 [details]
New simplified testcase in HTML
Created attachment 10814 [details]
New testcase in HTML (text/html this time)
What happens here is that the parser reorders the data and puts the comment in
front of the object tag in stead of inside the object tag, I think this is wrong
since comments are allowed anywhere in HTML, right? Over to the parser people
for futher investigation (load the last testcase in viewer and do a dump
content to see what happened)...
Assignee: jst → harishd
Status: UNCONFIRMED → NEW
Ever confirmed: true
(Assignee)

Comment 5

18 years ago
Created attachment 10857 [details] [diff] [review]
Proposed patch....
(Assignee)

Updated

18 years ago
Status: NEW → ASSIGNED
Whiteboard: Fix in hand
(Assignee)

Comment 6

18 years ago
This might happen quite frequently.  Putting on beta3 radar.
Keywords: nsbeta3
(Assignee)

Updated

18 years ago
Target Milestone: --- → M18

Comment 7

18 years ago
Marking nsbeta3+...
Summary: createContextualFragment incorrectly parses <OBJECT> element with nested comment → createContextualFragment incorrectly parses <OBJECT> element with nested comment
Whiteboard: Fix in hand → [nsbeta3+][Fix in hand]
(Assignee)

Comment 8

18 years ago
Fix is in.
Status: ASSIGNED → RESOLVED
Last Resolved: 18 years ago
Resolution: --- → FIXED

Comment 9

18 years ago
Mass update of qa contact
QA Contact: gerardok → janc

Comment 10

18 years ago
Works for Me
Platform: PC
OS: Windows 98
Mozilla Version: 2000100508

Marking as Verified
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.