Bug 11998 - Incorrect serialization of quotation marks in XML attributes.
Summary: Incorrect serialization of quotation marks in XML attributes.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: XML (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Major
Assignee: Alexey Proskuryakov
URL: http://www.yvon-thoraval.com/Canvas/m...
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-27 08:15 PST by Une Bévue
Modified: 2006-12-30 00:54 PST (History)
1 user (show)

See Also:


Attachments
test case (328 bytes, application/xhtml+xml)
2006-12-27 11:40 PST, Alexey Proskuryakov
no flags Details
proposed fix (5.65 KB, patch)
2006-12-29 11:22 PST, Alexey Proskuryakov
mitz: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Une Bévue 2006-12-27 08:15:10 PST
seems to be due to this XPath syntax :

<a>
  <xsl:attribute name="href">
    <xsl:value-of select="concat('javascript:setPage(&quot;',link,'&quot;);')"/>
  </xsl:attribute>
  <xsl:value-of select="label"/>
</a>

notice exactly same syntax works within Firefox 2 and Opera 9.1
Comment 1 Alexey Proskuryakov 2006-12-27 11:40:25 PST
Created attachment 12068 [details]
test case

The problem is that XSLTProcessor re-parses the stylesheet (evil!), while serializer handles quotation marks incorrectly. Here is a workaround:
<xsl:value-of select="concat('javascript:setPage(%22',link,'%22);')"/>

See also: bug 11947.
Comment 2 Alexey Proskuryakov 2006-12-29 11:22:30 PST
Created attachment 12110 [details]
proposed fix
Comment 3 mitz 2006-12-29 15:32:38 PST
Comment on attachment 12110 [details]
proposed fix

+      document.getElementById("result").textContent += ": " + (new XMLSerializer()).serializeToString(document.getElementsByTagName('div')[1]);

Doesn't work so well with the initial text in result (I guess originally it was just FAIL)

The patch looks very straightforward, so assuming it doesn't affect any existing tests, r=me.
Comment 4 Alexey Proskuryakov 2006-12-30 00:54:10 PST
Committed revision 18484.

(In reply to comment #3)

> Doesn't work so well with the initial text in result (I guess originally it was
> just FAIL)

Oops, indeed. Fixed.