Bug 125245

Summary: Does not render CDATA in XHTML/XML elements correctly.
Product: [Applications] konqueror Reporter: Matt Sicker <boards>
Component: khtmlAssignee: Konqueror Developers <konq-bugs>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Debian testing   
OS: Linux   
Latest Commit: Version Fixed In:

Description Matt Sicker 2006-04-09 20:57:20 UTC
Version:            (using KDE KDE 3.5.2)
Installed from:    Debian testing/unstable Packages
OS:                Linux

Example XHTML (served using application/xhtml+xml, although the problem most likely exists with any [X]HTML MIME type):

<a href='somelink.xhtml'><![CDATA[Some text that might like to use <text like this> & whatnot]]></a>

Following the rules of XML (and thusly XHTML), a user agent should use the text within the <![CDATA[]]> block as literal text.  A common use for this is inside a <style> and <script> element when writing out internal stylesheets or scripts so that characters like <, >, and & (commonly used in scripts and some CSS) are treated the way they should be.

Another example:

<textarea><![CDATA[]]></textarea>

This should render as an empty textarea, but "<![CDATA[]]>" is shown inside the textarea as literal, escaped text.  A use for this would be after previewing a form, the original content can remain inside the <![CDATA[]]> unaltered (including any preceding whitespace without chopping it off as XML whitespace).

Overall, KHTML is not even really considering what <![CDATA[]]> technically means and how it should be treated.  My guess is that KHTML is not [properly?] using an XML parser on application/xhtml+xml documents (as noticed by bug 52665), but I haven't looked into the actual source code in question.
Comment 1 Maksim Orlovich 2006-04-09 21:03:40 UTC
That would be correct.

*** This bug has been marked as a duplicate of 52665 ***