Closed
Bug 334821
Opened 18 years ago
Closed 18 years ago
CDATA handling is wrong
Categories
(Core Graveyard :: XForms, defect)
Core Graveyard
XForms
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: allan, Assigned: allan)
References
()
Details
(Keywords: fixed1.8.0.5, fixed1.8.1)
Attachments
(2 files, 1 obsolete file)
XPath states:
"Each character within a CDATA section is treated as character data. Thus, <![CDATA[<]]> in the source document will treated the same as <. Both will result in a single < character in a text node in the tree. Thus, a CDATA section is treated as if the <![CDATA[ and ]]> were removed and every occurrence of < and & were replaced by < and & respectively."
[http://www.w3.org/TR/xpath#section-Text-Nodes]
That's not how we handle it right now.
Assignee | ||
Comment 1•18 years ago
|
||
Is this as a duplicate of 305242? CDATA markup in html/xhtml creates a dom comment node with leading text (approx) " CDATA ".
Comment 3•18 years ago
|
||
This has nothing to do with bug 305242, since that bug is about tag-soup and this bug isn't really using tag-soup.
So has someone tried tracing the code to see where this goes wrong?
Assignee | ||
Comment 4•18 years ago
|
||
(In reply to comment #3)
> This has nothing to do with bug 305242, since that bug is about tag-soup and
> this bug isn't really using tag-soup.
>
> So has someone tried tracing the code to see where this goes wrong?
This is an XForms bug, we specifically search for text nodes only.
Assignee | ||
Comment 5•18 years ago
|
||
nsXFormsUtils::GetNodeValue() should treat text and cdata nodes equally.
Updated•18 years ago
|
Attachment #220787 -
Flags: review?(aaronr)
Attachment #220787 -
Flags: review?(Olli.Pettay)
Attachment #220787 -
Flags: review+
Comment 6•18 years ago
|
||
Might I recommend one change? Add all known types that don't have a string value defined explicitly in the switch. Make the default case assert about an unknown node type. This way when we add other node types to Gecko you'll be able to catch issues...
Assignee | ||
Comment 7•18 years ago
|
||
(In reply to comment #6)
> Might I recommend one change? Add all known types that don't have a string
> value defined explicitly in the switch. Make the default case assert about an
> unknown node type. This way when we add other node types to Gecko you'll be
> able to catch issues...
Good idea. Thx.
Assignee | ||
Updated•18 years ago
|
Attachment #220787 -
Flags: review?(aaronr)
Assignee | ||
Comment 8•18 years ago
|
||
As bz suggested, explicitly check for node types. While I was at it:
* use EmptyString() instead of Truncate()
* initialize value to the empty string, in case something goes haywire in the GetNodeValue() calls
* do not return inside the switch. Maybe it's just me, but it hurts my eyes
Attachment #220787 -
Attachment is obsolete: true
Attachment #220794 -
Flags: review?(Olli.Pettay)
Updated•18 years ago
|
Attachment #220794 -
Flags: review?(aaronr)
Attachment #220794 -
Flags: review?(Olli.Pettay)
Attachment #220794 -
Flags: review+
Attachment #220794 -
Flags: review?(aaronr) → review+
Assignee | ||
Comment 9•18 years ago
|
||
Fixed on trunk
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Whiteboard: xf-to-branch
Assignee | ||
Updated•18 years ago
|
Keywords: fixed1.8.1
Assignee | ||
Updated•18 years ago
|
Keywords: fixed1.8.0.5
Assignee | ||
Updated•18 years ago
|
Whiteboard: xf-to-branch
Updated•8 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•