- From: Maciej Stachowiak <mjs@apple.com>
- Date: Wed, 18 Nov 2009 16:36:29 -0800
- To: Boris Zbarsky <bzbarsky@mit.edu>
- Cc: public-html@w3.org, public-xml-core-wg@w3.org
On Nov 18, 2009, at 1:58 PM, Boris Zbarsky wrote: > On 11/18/09 4:46 PM, Leif Halvard Silli wrote: >> One should think that A) browser vendors could have a look at the >> countless non-fatal errors an make sure that they are not treated as >> fatal. And B) that they could be Opera friendly instead of Firefox >> draconian w.r.t. fatal errors. > > Just so we're clear, the Firefox behavior here is basically a > consequence on two things: > > 1) The XML parser used (expat) just gives up (possibly with data > buffered in it) when it hits a well-formedness violation. > 2) Gecko does not have a good way to recover the already-parsed > source text (it may or may not be in the HTTP cache, etc). > > Implementing the Safari behavior of not dropping whatever has been > parsed so far might be doable without too much trouble. > Implementing the Opera behavior requires fundamental rearchitecture > of the networking layer in Gecko, or keeping the source of all XML > documents in memory on the off chance that the document won't be > well-formed. The former is clearly needed anyway, but hasn't > happened yet. > > So the behavior is not exactly a consequence of "we must be > draconian about this", as much as it's a consequence of "it would > take significant architectural changes to handle this edge case, and > it's a low priority". Technical issue, not philosophical. I don't think we'd want to implement the Opera behavior in Safari. For one thing, as with Gecko, it would be somewhat more challenging. For another, we really don't like facing users with an error message, which then has a "click here to make it work" button. This tends to make users wonder why we didn't make it work in the first place. If we had lenient reparsing, we'd just do it automatically without user interaction. But I suspect if we did that, we would get bug reports from XML experts who were upset that we don't do a hard reject on XML errors. Note: showing the partial page up to the first well-formedness error is not primarily for user-friendliness in the face of a broken XML document, it's to provide better context for the Web developer in the course of diagnosing the well-formedness error (and also because keeping around the partial document and appending to it was not any harder than throwing it away). If we did introduce a lax XML parsing mode, we would want to agree on interoperable behavior with other vendors. We don't want to make it a venue for undefined behavior and a reverse-engineering driven race to the bottom. Regards, Maciej
Received on Thursday, 19 November 2009 00:37:02 UTC