[Webkit-unassigned] [Bug 10341] SVGs fail to render intermittently (on reload)

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Nov 21 14:35:25 PST 2008


https://bugs.webkit.org/show_bug.cgi?id=10341





------- Comment #7 from eric at webkit.org  2008-11-21 14:35 PDT -------
I suspect this is related to the encoding switching we do to work around
another libxml bug:

void XMLTokenizer::doWrite(const String& parseString)
{
    if (!m_context)
        initializeParserContext();

    // libXML throws an error if you try to switch the encoding for an empty
string.
    if (parseString.length()) {
        // Hack around libxml2's lack of encoding overide support by manually
        // resetting the encoding to UTF-16 before every chunk.  Otherwise
libxml
        // will detect <?xml version="1.0" encoding="<encoding name>"?> blocks 
        // and switch encodings, causing the parse to fail.
        const UChar BOM = 0xFEFF;
        const unsigned char BOMHighByte = *reinterpret_cast<const unsigned
char*>(&BOM);
        xmlSwitchEncoding(m_context, BOMHighByte == 0xFF ?
XML_CHAR_ENCODING_UTF16LE : XML_CHAR_ENCODING_UTF16BE);

        xmlParseChunk(m_context, reinterpret_cast<const
char*>(parseString.characters()), sizeof(UChar) * parseString.length(), 0);
    }

    if (m_doc->decoder() && m_doc->decoder()->sawError()) {
        // If the decoder saw an error, report it as fatal (stops parsing)
        handleError(fatal, "Encoding error", lineNumber(), columnNumber());
    }

    return;
}


-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list