Bug 482921 part 1 - Implement HTML syntax highlighting using the new parser. r=Olli.Pettay.

This commit is contained in:
Henri Sivonen
2010-07-30 13:15:38 +03:00
parent 6d5bbec2af
commit a42c6e14db
37 changed files with 4254 additions and 107 deletions

View File

@@ -60,6 +60,28 @@ class nsHtml5Parser;
#define NS_HTML5_STREAM_PARSER_READ_BUFFER_SIZE 1024
#define NS_HTML5_STREAM_PARSER_SNIFFING_BUFFER_SIZE 1024
enum eParserMode {
/**
* Parse a document normally as HTML.
*/
NORMAL,
/**
* View document as HTML source.
*/
VIEW_SOURCE_HTML,
/**
* View document as XML source
*/
VIEW_SOURCE_XML,
/**
* View document as plain text
*/
PLAIN_TEXT
};
enum eBomState {
/**
* BOM sniffing hasn't started.
@@ -118,7 +140,8 @@ class nsHtml5StreamParser : public nsIStreamListener,
static void InitializeStatics();
nsHtml5StreamParser(nsHtml5TreeOpExecutor* aExecutor,
nsHtml5Parser* aOwner);
nsHtml5Parser* aOwner,
eParserMode aMode);
virtual ~nsHtml5StreamParser();
@@ -495,6 +518,11 @@ class nsHtml5StreamParser : public nsIStreamListener,
*/
bool mFlushTimerEverFired;
/**
* Whether the parser is doing a normal parse, view source or plain text.
*/
eParserMode mMode;
/**
* The pref html5.flushtimer.initialdelay: Time in milliseconds between
* the time a network buffer is seen and the timer firing when the