Bug 1690340 - Part 1: Hide all the panel tools in the developer tools menu. r=jdescottes
[gecko.git] / parser / html / nsHtml5TokenizerLoopPolicies.h
blobf1e547ca25ce49286c36ee9ea4e44f0cb4907c7d
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #ifndef nsHtml5TokenizerLoopPolicies_h
6 #define nsHtml5TokenizerLoopPolicies_h
8 /**
9 * This policy does not report tokenizer transitions anywhere. To be used
10 * when _not_ viewing source.
12 struct nsHtml5SilentPolicy {
13 static const bool reportErrors = false;
14 static int32_t transition(nsHtml5Highlighter* aHighlighter, int32_t aState,
15 bool aReconsume, int32_t aPos) {
16 return aState;
18 static void completedNamedCharacterReference(
19 nsHtml5Highlighter* aHighlighter) {}
22 /**
23 * This policy reports the tokenizer transitions to a highlighter. To be used
24 * when viewing source.
26 struct nsHtml5ViewSourcePolicy {
27 static const bool reportErrors = true;
28 static int32_t transition(nsHtml5Highlighter* aHighlighter, int32_t aState,
29 bool aReconsume, int32_t aPos) {
30 return aHighlighter->Transition(aState, aReconsume, aPos);
32 static void completedNamedCharacterReference(
33 nsHtml5Highlighter* aHighlighter) {
34 aHighlighter->CompletedNamedCharacterReference();
38 #endif // nsHtml5TokenizerLoopPolicies_h