<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>10341</bug_id>
          
          <creation_ts>2006-08-10 19:17:40 -0700</creation_ts>
          <short_desc>SVGs fail to render intermittently (on reload)</short_desc>
          <delta_ts>2011-05-18 10:20:04 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>SVG</component>
          <version>420+</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.4</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc>http://www.w3.org/Graphics/SVG/Test/20030813/htmlframe/full-coords-viewattr-02-b.html</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar, NeedsReduction, SVGHitList</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Eric Seidel (no email)">eric</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ap</cc>
    
    <cc>krit</cc>
    
    <cc>nickshanks</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>52209</commentid>
    <comment_count>0</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2006-08-10 19:17:40 -0700</bug_when>
    <thetext>REGRESSION: All embedded SVGs fail to render intermittently (on reload)They fail out due to a libxml error.  I&apos;ve seen this error before, and I believe it happens when you call switchEncoding when you don&apos;t actuallly have any data to write.

error on line 1 at column 1: switching encoding : no input</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55345</commentid>
    <comment_count>1</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2006-09-12 22:32:02 -0700</bug_when>
    <thetext>Wow, strange enough this is still an issue. :(  I&apos;m testing with r16339.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>34863</commentid>
    <comment_count>2</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2007-01-15 01:33:15 -0800</bug_when>
    <thetext>This is still a (really bad!) problem on TOT.  Although since WebKit has never officially shipped SVG, I&apos;m not sure this can be a P1 regression.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>31535</commentid>
    <comment_count>3</comment_count>
    <who name="Stephanie Lewis">slewis</who>
    <bug_when>2007-01-27 19:53:38 -0800</bug_when>
    <thetext>Radar &lt;rdar://problem/4959694&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>25289</commentid>
    <comment_count>4</comment_count>
    <who name="Maciej Stachowiak">mjs</who>
    <bug_when>2007-02-07 04:51:54 -0800</bug_when>
    <thetext>Removing regression tag and downgrading to P2 per Eric&apos;s comments.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>7771</commentid>
    <comment_count>5</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2007-06-12 11:49:15 -0700</bug_when>
    <thetext>*** Bug 13188 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>99702</commentid>
    <comment_count>6</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2008-11-21 14:33:40 -0800</bug_when>
    <thetext>I&apos;m seeing this on http://www.carto.net/papers/svg/samples/matrix.svg just now as well.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>99703</commentid>
    <comment_count>7</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2008-11-21 14:35:25 -0800</bug_when>
    <thetext>I suspect this is related to the encoding switching we do to work around another libxml bug:

void XMLTokenizer::doWrite(const String&amp; 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&apos;s lack of encoding overide support by manually
        // resetting the encoding to UTF-16 before every chunk.  Otherwise libxml
        // will detect &lt;?xml version=&quot;1.0&quot; encoding=&quot;&lt;encoding name&gt;&quot;?&gt; blocks 
        // and switch encodings, causing the parse to fail.
        const UChar BOM = 0xFEFF;
        const unsigned char BOMHighByte = *reinterpret_cast&lt;const unsigned char*&gt;(&amp;BOM);
        xmlSwitchEncoding(m_context, BOMHighByte == 0xFF ? XML_CHAR_ENCODING_UTF16LE : XML_CHAR_ENCODING_UTF16BE);

        xmlParseChunk(m_context, reinterpret_cast&lt;const char*&gt;(parseString.characters()), sizeof(UChar) * parseString.length(), 0);
    }
    
    if (m_doc-&gt;decoder() &amp;&amp; m_doc-&gt;decoder()-&gt;sawError()) {
        // If the decoder saw an error, report it as fatal (stops parsing)
        handleError(fatal, &quot;Encoding error&quot;, lineNumber(), columnNumber());
    }

    return;
}</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>99704</commentid>
    <comment_count>8</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2008-11-21 14:36:39 -0800</bug_when>
    <thetext>Today I&apos;m using:
Version 4.0 (5528.1)
ProductName:	Mac OS X
ProductVersion:	10.5.5
BuildVersion:	9F33
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>405808</commentid>
    <comment_count>9</comment_count>
    <who name="Dirk Schulze">krit</who>
    <bug_when>2011-05-18 10:20:04 -0700</bug_when>
    <thetext>I don&apos;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&apos;t want to add hacks as workaround for bugs in libxml.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>