1999-01-09 04:09:02 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2005-06-03 03:36:43 +04:00
|
|
|
/* vim: set sw=2 ts=2 et tw=78: */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
1999-01-09 04:09:02 +03:00
|
|
|
|
|
|
|
/**
|
2005-02-18 21:30:48 +03:00
|
|
|
* @file nsHTMLTokenizer.cpp
|
|
|
|
* This is an implementation of the nsITokenizer interface.
|
|
|
|
* This file contains the implementation of a tokenizer to tokenize an HTML
|
|
|
|
* document. It attempts to do so, making tradeoffs between compatibility with
|
|
|
|
* older parsers and the SGML specification. Note that most of the real
|
|
|
|
* "tokenization" takes place in nsHTMLTokens.cpp.
|
1999-01-09 04:09:02 +03:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "nsHTMLTokenizer.h"
|
2013-08-17 15:27:09 +04:00
|
|
|
#include "nsIParser.h"
|
1999-01-09 04:09:02 +03:00
|
|
|
|
|
|
|
/************************************************************************
|
|
|
|
And now for the main class -- nsHTMLTokenizer...
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
/**
|
2005-11-11 22:11:36 +03:00
|
|
|
* Satisfy the nsISupports interface.
|
1999-01-09 04:09:02 +03:00
|
|
|
*/
|
2014-04-27 11:06:00 +04:00
|
|
|
NS_IMPL_ISUPPORTS(nsHTMLTokenizer, nsITokenizer)
|
1999-01-09 04:09:02 +03:00
|
|
|
|
|
|
|
/**
|
2005-02-18 21:30:48 +03:00
|
|
|
* Default constructor
|
1999-01-09 04:09:02 +03:00
|
|
|
*/
|
2013-08-17 15:27:09 +04:00
|
|
|
nsHTMLTokenizer::nsHTMLTokenizer() {
|
2013-08-12 19:28:41 +04:00
|
|
|
// TODO Assert about:blank-ness.
|
2009-06-24 01:22:16 +04:00
|
|
|
}
|
1999-01-09 04:09:02 +03:00
|
|
|
|
2013-08-12 19:28:41 +04:00
|
|
|
nsresult nsHTMLTokenizer::WillTokenize(bool aIsFinalChunk) { return NS_OK; }
|
2005-06-02 02:11:30 +04:00
|
|
|
|
1999-01-09 04:09:02 +03:00
|
|
|
/**
|
2005-02-18 21:30:48 +03:00
|
|
|
* This method is repeatedly called by the tokenizer.
|
|
|
|
* Each time, we determine the kind of token we're about to
|
|
|
|
* read, and then we call the appropriate method to handle
|
|
|
|
* that token type.
|
1999-01-09 04:09:02 +03:00
|
|
|
*
|
2005-02-18 21:30:48 +03:00
|
|
|
* @param aScanner The source of our input.
|
|
|
|
* @param aFlushTokens An OUT parameter to tell the caller whether it should
|
|
|
|
* process our queued tokens up to now (e.g., when we
|
|
|
|
* reach a <script>).
|
|
|
|
* @return Success or error
|
1999-01-09 04:09:02 +03:00
|
|
|
*/
|
2011-09-29 10:19:26 +04:00
|
|
|
nsresult nsHTMLTokenizer::ConsumeToken(nsScanner& aScanner,
|
|
|
|
bool& aFlushTokens) {
|
2016-12-23 05:51:04 +03:00
|
|
|
return NS_ERROR_HTMLPARSER_EOF;
|
1999-01-09 04:09:02 +03:00
|
|
|
}
|