Commit 8fb21a17 authored by ddkilzer@apple.com's avatar ddkilzer@apple.com

WebCore:

        REGRESSION (r26474): WebKit fails jQuery test 64 core module: text(String) subtest 1 Check escaped text (createTextNode)

        <https://bugs.webkit.org/show_bug.cgi?id=18976>
        <rdar://problem/5924793>

        Reviewed by Darin.

        Tests: fast/dom/dom-parse-serialize-expected.txt:
               fast/xsl/xslt-processor-expected.txt:
               fast/xsl/xslt-text-expected.txt:

        Commit r26474 removed escaping of '>' characters to '&gt;' in serialized
        HTML content, which broke one jQuery test.  This change restores that
        serialization behavior to both attributes and content for consistency.

        * editing/markup.cpp:
        (WebCore::appendAttributeValue): Escape '>' as '&gt;'.
        (WebCore::escapeContentText): Ditto.
        (WebCore::appendEscapedContent): Ditto.  This is the bug fix for the jQuery test.

LayoutTests:

        REGRESSION (r26474): WebKit fails jQuery test 64 core module: text(String) subtest 1 Check escaped text (createTextNode)

        <https://bugs.webkit.org/show_bug.cgi?id=18976>
        <rdar://problem/5924793>

        Reviewed by Darin.

        Updated test results now that '>' is escaped to '&gt;' in both
        attributes and content.

        * fast/xsl/xslt-processor-expected.txt:
        * fast/xsl/xslt-text-expected.txt:
        * platform/mac/fast/dom/dom-parse-serialize-expected.txt:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@33451 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 0aff12c2
2008-05-14 David Kilzer <ddkilzer@apple.com>
REGRESSION (r26474): WebKit fails jQuery test 64 core module: text(String) subtest 1 Check escaped text (createTextNode)
<https://bugs.webkit.org/show_bug.cgi?id=18976>
<rdar://problem/5924793>
Reviewed by Darin.
Updated test results now that '>' is escaped to '&gt;' in both
attributes and content.
* fast/xsl/xslt-processor-expected.txt:
* fast/xsl/xslt-text-expected.txt:
* platform/mac/fast/dom/dom-parse-serialize-expected.txt:
2008-05-14 Justin Garcia <justin.garcia@apple.com>
Reviewed by Darin.
0.1 original xml:
<?xml-stylesheet type="text/xsl" href="xslt-text.xsl"?><TEST>SOURCE XML: &lt;&lt;&lt;&amp;тест&amp;>>></TEST>
<?xml-stylesheet type="text/xsl" href="xslt-text.xsl"?><TEST>SOURCE XML: &lt;&lt;&lt;&amp;тест&amp;&gt;&gt;&gt;</TEST>
0.2 xsl1:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="text" encoding="KOI8-R"/>
<xsl:template match="TEST">CHARACTERS IN XSLT: &lt;&lt;&lt;&amp;тест&amp;>>>
<xsl:template match="TEST">CHARACTERS IN XSLT: &lt;&lt;&lt;&amp;тест&amp;&gt;&gt;&gt;
<xsl:apply-templates/><xsl:text>
</xsl:text></xsl:template>
......@@ -37,13 +37,13 @@
1.1 Import two different stylesheets:
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></head><body>
CHARACTERS IN XSLT: ééééééééééé <br><br>SOURCE XML: &lt;&lt;&lt;&amp;тест&amp;>>></body></html>
CHARACTERS IN XSLT: ééééééééééé <br><br>SOURCE XML: &lt;&lt;&lt;&amp;тест&amp;&gt;&gt;&gt;</body></html>
1.2 Import same stylesheet twice:
<!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">
<head><title></title></head>
<body>
<pre>CHARACTERS IN XSLT: &lt;&lt;&lt;&amp;тест&amp;>>>
SOURCE XML: &lt;&lt;&lt;&amp;тест&amp;>>></pre>
<pre>CHARACTERS IN XSLT: &lt;&lt;&lt;&amp;тест&amp;&gt;&gt;&gt;
SOURCE XML: &lt;&lt;&lt;&amp;тест&amp;&gt;&gt;&gt;</pre>
</body>
</html>
1.3 Import undefined stylesheet:
......
......@@ -2,8 +2,8 @@
<head xmlns="http://www.w3.org/1999/xhtml"><title></title></head>
<body xmlns="http://www.w3.org/1999/xhtml">
<pre>CHARACTERS IN XSLT: &lt;&lt;&lt;&amp;тест&amp;>>>
SOURCE XML: &lt;&lt;&lt;&amp;тест&amp;>>></pre>
<pre>CHARACTERS IN XSLT: &lt;&lt;&lt;&amp;тест&amp;&gt;&gt;&gt;
SOURCE XML: &lt;&lt;&lt;&amp;тест&amp;&gt;&gt;&gt;</pre>
</body>
......
......@@ -57,4 +57,4 @@ layer at (0,0) size 800x600
text run at (536,15) width 0: " "
text run at (0,30) width 184: " <d id=\"id3\">Three</d>"
text run at (184,30) width 0: " "
text run at (0,45) width 472: "<f id=\"&amp;&lt;>\">Four&amp;&lt;></f><empty/><empty/></doc>"
text run at (0,45) width 520: "<f id=\"&amp;&lt;&gt;\">Four&amp;&lt;&gt;</f><empty/><empty/></doc>"
2008-05-14 David Kilzer <ddkilzer@apple.com>
REGRESSION (r26474): WebKit fails jQuery test 64 core module: text(String) subtest 1 Check escaped text (createTextNode)
<https://bugs.webkit.org/show_bug.cgi?id=18976>
<rdar://problem/5924793>
Reviewed by Darin.
Tests: fast/dom/dom-parse-serialize-expected.txt:
fast/xsl/xslt-processor-expected.txt:
fast/xsl/xslt-text-expected.txt:
Commit r26474 removed escaping of '>' characters to '&gt;' in serialized
HTML content, which broke one jQuery test. This change restores that
serialization behavior to both attributes and content for consistency.
* editing/markup.cpp:
(WebCore::appendAttributeValue): Escape '>' as '&gt;'.
(WebCore::escapeContentText): Ditto.
(WebCore::appendEscapedContent): Ditto. This is the bug fix for the jQuery test.
2008-05-14 Adam Roben <aroben@apple.com>
Fix Bug 19051: REGRESSION (r33447): Assertion in
......@@ -95,6 +95,7 @@ static void appendAttributeValue(Vector<UChar>& result, const String& attr)
unsigned lastCopiedFrom = 0;
static const String ampEntity("&amp;");
static const String gtEntity("&gt;");
static const String ltEntity("&lt;");
static const String quotEntity("&quot;");
static const String nbspEntity("&nbsp;");
......@@ -112,6 +113,11 @@ static void appendAttributeValue(Vector<UChar>& result, const String& attr)
append(result, ltEntity);
lastCopiedFrom = i + 1;
break;
case '>':
result.append(uchars + lastCopiedFrom, i - lastCopiedFrom);
append(result, gtEntity);
lastCopiedFrom = i + 1;
break;
case '"':
result.append(uchars + lastCopiedFrom, i - lastCopiedFrom);
append(result, quotEntity);
......@@ -136,6 +142,7 @@ static String escapeContentText(const String& in)
unsigned lastCopiedFrom = 0;
static const String ampEntity("&amp;");
static const String gtEntity("&gt;");
static const String ltEntity("&lt;");
static const String nbspEntity("&nbsp;");
......@@ -156,6 +163,11 @@ static String escapeContentText(const String& in)
append(s, ltEntity);
lastCopiedFrom = i + 1;
break;
case '>':
s.append(characters + lastCopiedFrom, i - lastCopiedFrom);
append(s, gtEntity);
lastCopiedFrom = i + 1;
break;
case noBreakSpace:
s.append(characters + lastCopiedFrom, i - lastCopiedFrom);
append(s, nbspEntity);
......@@ -176,6 +188,7 @@ static void appendEscapedContent(Vector<UChar>& result, pair<const UChar*, size_
unsigned lastCopiedFrom = 0;
static const String ampEntity("&amp;");
static const String gtEntity("&gt;");
static const String ltEntity("&lt;");
static const String nbspEntity("&nbsp;");
......@@ -192,6 +205,11 @@ static void appendEscapedContent(Vector<UChar>& result, pair<const UChar*, size_
append(result, ltEntity);
lastCopiedFrom = i + 1;
break;
case '>':
result.append(uchars + lastCopiedFrom, i - lastCopiedFrom);
append(result, gtEntity);
lastCopiedFrom = i + 1;
break;
case noBreakSpace:
result.append(uchars + lastCopiedFrom, i - lastCopiedFrom);
append(result, nbspEntity);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment