1999-01-09 01:09:02 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2005-06-02 23:36:43 +00:00
|
|
|
/* vim: set sw=2 ts=2 et tw=78: */
|
2012-05-21 11:12:37 +00: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 01:09:02 +00:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
2005-02-18 18:30:48 +00: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 01:09:02 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "nsHTMLTokenizer.h"
|
2013-08-17 11:27:09 +00:00
|
|
|
#include "nsIParser.h"
|
2011-08-01 07:48:24 +00:00
|
|
|
#include "nsParserConstants.h"
|
1999-01-09 01:09:02 +00:00
|
|
|
|
|
|
|
/************************************************************************
|
|
|
|
And now for the main class -- nsHTMLTokenizer...
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
/**
|
2005-11-11 19:11:36 +00:00
|
|
|
* Satisfy the nsISupports interface.
|
1999-01-09 01:09:02 +00:00
|
|
|
*/
|
2014-04-27 07:06:00 +00:00
|
|
|
NS_IMPL_ISUPPORTS(nsHTMLTokenizer, nsITokenizer)
|
1999-01-09 01:09:02 +00:00
|
|
|
|
|
|
|
/**
|
2005-02-18 18:30:48 +00:00
|
|
|
* Default constructor
|
1999-01-09 01:09:02 +00:00
|
|
|
*/
|
2013-08-17 11:27:09 +00:00
|
|
|
nsHTMLTokenizer::nsHTMLTokenizer()
|
1999-10-06 19:04:29 +00:00
|
|
|
{
|
2013-08-12 15:28:41 +00:00
|
|
|
// TODO Assert about:blank-ness.
|
2009-06-23 21:22:16 +00:00
|
|
|
}
|
1999-01-09 01:09:02 +00:00
|
|
|
|
2005-12-02 22:38:19 +00:00
|
|
|
nsresult
|
2013-08-12 15:28:41 +00:00
|
|
|
nsHTMLTokenizer::WillTokenize(bool aIsFinalChunk)
|
2005-06-01 22:11:30 +00:00
|
|
|
{
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
1999-01-09 01:09:02 +00:00
|
|
|
/**
|
2005-02-18 18:30:48 +00: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 01:09:02 +00:00
|
|
|
*
|
2005-02-18 18:30:48 +00: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 01:09:02 +00:00
|
|
|
*/
|
2005-12-02 22:38:19 +00:00
|
|
|
nsresult
|
2011-09-29 06:19:26 +00:00
|
|
|
nsHTMLTokenizer::ConsumeToken(nsScanner& aScanner, bool& aFlushTokens)
|
2005-02-18 18:30:48 +00:00
|
|
|
{
|
2013-08-12 15:28:41 +00:00
|
|
|
return kEOF;
|
1999-01-09 01:09:02 +00:00
|
|
|
}
|