Bug 10341
Summary: | SVGs fail to render intermittently (on reload) | ||
---|---|---|---|
Product: | WebKit | Reporter: | Eric Seidel (no email) <eric> |
Component: | SVG | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED WONTFIX | ||
Severity: | Normal | CC: | ap, krit, nickshanks |
Priority: | P2 | Keywords: | InRadar, NeedsReduction, SVGHitList |
Version: | 420+ | ||
Hardware: | Mac | ||
OS: | OS X 10.4 | ||
URL: | http://www.w3.org/Graphics/SVG/Test/20030813/htmlframe/full-coords-viewattr-02-b.html |
Eric Seidel (no email)
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
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Eric Seidel (no email)
Wow, strange enough this is still an issue. :( I'm testing with r16339.
Eric Seidel (no email)
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.
Stephanie Lewis
Radar <rdar://problem/4959694>
Maciej Stachowiak
Removing regression tag and downgrading to P2 per Eric's comments.
Eric Seidel (no email)
*** Bug 13188 has been marked as a duplicate of this bug. ***
Eric Seidel (no email)
I'm seeing this on http://www.carto.net/papers/svg/samples/matrix.svg just now as well.
Eric Seidel (no email)
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;
}
Eric Seidel (no email)
Today I'm using:
Version 4.0 (5528.1)
ProductName: Mac OS X
ProductVersion: 10.5.5
BuildVersion: 9F33
Dirk Schulze
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.