Bug 1700051: part 33) Move `AdjustSoftBeginAndBuildSoftText` to `SoftText`. r=smaug
[gecko.git] / parser / htmlparser / nsHTMLTokenizer.cpp
blobca4a5c7f4ff2a4ca7e4ab637fa1c7cc7532cdcd4
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set sw=2 ts=2 et tw=78: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 /**
8 * @file nsHTMLTokenizer.cpp
9 * This is an implementation of the nsITokenizer interface.
10 * This file contains the implementation of a tokenizer to tokenize an HTML
11 * document. It attempts to do so, making tradeoffs between compatibility with
12 * older parsers and the SGML specification. Note that most of the real
13 * "tokenization" takes place in nsHTMLTokens.cpp.
16 #include "nsHTMLTokenizer.h"
17 #include "nsIParser.h"
19 /************************************************************************
20 And now for the main class -- nsHTMLTokenizer...
21 ************************************************************************/
23 /**
24 * Satisfy the nsISupports interface.
26 NS_IMPL_ISUPPORTS(nsHTMLTokenizer, nsITokenizer)
28 /**
29 * Default constructor
31 nsHTMLTokenizer::nsHTMLTokenizer() {
32 // TODO Assert about:blank-ness.
35 nsresult nsHTMLTokenizer::WillTokenize(bool aIsFinalChunk) { return NS_OK; }
37 /**
38 * This method is repeatedly called by the tokenizer.
39 * Each time, we determine the kind of token we're about to
40 * read, and then we call the appropriate method to handle
41 * that token type.
43 * @param aScanner The source of our input.
44 * @param aFlushTokens An OUT parameter to tell the caller whether it should
45 * process our queued tokens up to now (e.g., when we
46 * reach a <script>).
47 * @return Success or error
49 nsresult nsHTMLTokenizer::ConsumeToken(nsScanner& aScanner,
50 bool& aFlushTokens) {
51 return NS_ERROR_HTMLPARSER_EOF;