Commit 19533492 authored by eric@webkit.org's avatar eric@webkit.org

2009-05-04 Kai Brüning <kai@granus.net>

        Reviewed by Eric Seidel.

        https://bugs.webkit.org/show_bug.cgi?id=24883
        24883: Bad success test in parseXMLDocumentFragment in XMLTokenizerLibxml2.cpp

        Fixed test whether all the chunk has been processed to correctly count utf8 bytes.

        Test: fast/innerHTML/innerHTML-nbsp.xhtml

        * dom/XMLTokenizerLibxml2.cpp:
        (WebCore::parseXMLDocumentFragment):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@43195 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent e15bb030
2009-05-04 Kai <set EMAIL_ADDRESS environment variable>
Reviewed by Eric Seidel.
* fast/innerHTML/innerHTML-nbsp-expected.txt: Added.
* fast/innerHTML/innerHTML-nbsp.xhtml: Added.
2009-05-04 Darin Adler <darin@apple.com>
* platform/gtk/Skipped: Disable a test that's timing out.
This test checks to see if setting innerHTML to a single non-breaking space works.
PASSED
<?xml version="1.0" encoding="ISO-8859-1"?>
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
<div id="description">This test checks to see if setting innerHTML to a single non-breaking space works.</div>
<div id="test" style="display:none"></div>
<div id="console"></div>
<script>
if (window.layoutTestController)
layoutTestController.dumpAsText();
function log(message) {
var console = document.getElementById("console");
console.appendChild(document.createTextNode(message));
console.appendChild(document.createElement('br'));
}
var html = "\u00A0";
var testElement = document.getElementById("test");
try {
testElement.innerHTML = html;
} catch(e) {
log("FAIL, exception thrown: " + e);
}
if (html == testElement.innerHTML)
log("PASSED");
else {
log("FAIL, expected: " + html + " actual: " + testElement.innerHTML);
}
</script>
</body>
</html>
2009-05-04 Kai Brüning <kai@granus.net>
Reviewed by Eric Seidel.
https://bugs.webkit.org/show_bug.cgi?id=24883
24883: Bad success test in parseXMLDocumentFragment in XMLTokenizerLibxml2.cpp
Fixed test whether all the chunk has been processed to correctly count utf8 bytes.
Test: fast/innerHTML/innerHTML-nbsp.xhtml
* dom/XMLTokenizerLibxml2.cpp:
(WebCore::parseXMLDocumentFragment):
2009-05-04 Darin Adler <darin@apple.com>
Reviewed by Eric Seidel.
......@@ -1292,7 +1292,8 @@ bool parseXMLDocumentFragment(const String& chunk, DocumentFragment* fragment, E
XMLTokenizer tokenizer(fragment, parent);
tokenizer.initializeParserContext(chunk.utf8().data());
CString chunkAsUtf8 = chunk.utf8();
tokenizer.initializeParserContext(chunkAsUtf8.data());
xmlParseContent(tokenizer.m_context);
......@@ -1300,7 +1301,7 @@ bool parseXMLDocumentFragment(const String& chunk, DocumentFragment* fragment, E
// Check if all the chunk has been processed.
long bytesProcessed = xmlByteConsumed(tokenizer.m_context);
if (bytesProcessed == -1 || ((unsigned long)bytesProcessed) == sizeof(UChar) * chunk.length())
if (bytesProcessed == -1 || ((unsigned long)bytesProcessed) != chunkAsUtf8.length())
return false;
// No error if the chunk is well formed or it is not but we have no error.
......
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