REGRESSION: All embedded SVGs fail to render intermittently (on reload)They fail out due to a libxml error. I've seen this error before, and I believe it happens when you call switchEncoding when you don't actuallly have any data to write. error on line 1 at column 1: switching encoding : no input
Wow, strange enough this is still an issue. :( I'm testing with r16339.
This is still a (really bad!) problem on TOT. Although since WebKit has never officially shipped SVG, I'm not sure this can be a P1 regression.
Radar <rdar://problem/4959694>
Removing regression tag and downgrading to P2 per Eric's comments.
*** Bug 13188 has been marked as a duplicate of this bug. ***
I'm seeing this on http://www.carto.net/papers/svg/samples/matrix.svg just now as well.
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; }
Today I'm using: Version 4.0 (5528.1) ProductName: Mac OS X ProductVersion: 10.5.5 BuildVersion: 9F33
I don't see problems on reload. But indeed it does not look correct. Like eric wrote, this is a bug with libxml and just occurs on MacOS right now. This should work, once Mac OS X has a newer version of libxml. I mark this as WONTFIX, since this is not a problem of WebKit. At least we don't want to add hacks as workaround for bugs in libxml.