Bug 61101 - KHTML ignores scripts inside cdata sections when used in xhtml [testcase]
Summary: KHTML ignores scripts inside cdata sections when used in xhtml [testcase]
Status: RESOLVED FIXED
Alias: None
Product: konqueror
Classification: Applications
Component: khtml parsing (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-07-11 20:47 UTC by djoham
Modified: 2004-10-20 11:54 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
attaching test case (484 bytes, text/xml)
2003-11-27 20:05 UTC, Stephan Kulow
Details

Note You need to log in before you can comment on or make changes to this bug.
Description djoham 2003-07-11 20:47:41 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources
OS:          Linux

Hello,

According to http://www.w3.org/TR/xhtml1/#h-4.8, it is appropriate to use the following syntax for javascript in xhtml documents:

<script type="text/javascript">
<![CDATA[
... unescaped script content ...
]]>
</script>

Konqueror's KHTML engine doesn't seem to support this. If you take the following (valid xhtml) code and name it test.xhtml (the.xhtml is important) and run it through Mozilla, you'll get an alert box when you press the button. Konq will render the page, but will not display the alert when the button is pressed. 

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 <head>
<title>
Test</title>
</head>
<body>
    <div>
        <button type="button" onclick="go()">Hello world</button>
    </div>
    <script type="text/javascript">
        <![CDATA[
        function go() {
            alert("hello world");
        }
        ]]>
    </script>

</body>
</html>


Thanks for looking into this!

David
Comment 1 Stephan Kulow 2003-11-27 20:05:06 UTC
Created attachment 3446 [details]
attaching test case
Comment 2 Tommi Tervo 2004-10-20 11:54:14 UTC
Works fine with khtml from CVS-head.