Platform/XML Rewrite: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 87: Line 87:


The document that is given as input to an XSLT program and the document loaded via XHR are currently built by nsXMLContentSink. In the new world, they'd use the tree op mechanism instead like other things that currently use nsXMLContentSink.
The document that is given as input to an XSLT program and the document loaded via XHR are currently built by nsXMLContentSink. In the new world, they'd use the tree op mechanism instead like other things that currently use nsXMLContentSink.
==Showing a common interface to nsDocument==
nsIParser is pointlessly crufty and COMtaminated. There should be a new non-XPCOM abstract class that shows the commonality of XML and HTML parsing to nsDocument but no cruft. The new interface should look something like this:
class mozilla::parser::AParser {
  virtual void setCharsetAndSource(nsACString aCharset, PRInt32 aSource) = 0;
  virtual nsIStreamListener* GetStreamListener() = 0;
  virtual void UnblockParser() = 0;
  virtual void Start(nsIRequestObserver* aObserver) = 0; // Replaces Parse()
  virtual void Terminate() = 0;
  // possibly document.write and script execution stuff that'd be no-op in the XML case
};
Both mozilla::parser::xml::Parser and nsHtml5Parser (to be renamed mozilla::parser::html::Parser) would inherit from this abstract class.
254

edits

Navigation menu