2 * Copyright (c) 2007 Henri Sivonen
3 * Copyright (c) 2008-2010 Mozilla Foundation
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
12 * The above copyright notice and this permission notice shall be included in
13 * all copies or substantial portions of the Software.
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 * DEALINGS IN THE SOFTWARE.
25 * THIS IS A GENERATED FILE. PLEASE DO NOT EDIT.
26 * Please edit MetaScanner.java instead and regenerate.
29 #ifndef nsHtml5MetaScanner_h__
30 #define nsHtml5MetaScanner_h__
34 #include "nsHtml5AtomTable.h"
36 #include "nsINameSpaceManager.h"
37 #include "nsIContent.h"
38 #include "nsIDocument.h"
39 #include "nsTraceRefcnt.h"
41 #include "nsHtml5DocumentMode.h"
42 #include "nsHtml5ArrayCopy.h"
43 #include "nsHtml5NamedCharacters.h"
44 #include "nsHtml5NamedCharactersAccel.h"
45 #include "nsHtml5Atoms.h"
46 #include "nsHtml5ByteReadable.h"
47 #include "nsIUnicodeDecoder.h"
48 #include "nsAHtml5TreeBuilderState.h"
49 #include "nsHtml5Macros.h"
51 class nsHtml5StreamParser
;
53 class nsHtml5Tokenizer
;
54 class nsHtml5TreeBuilder
;
55 class nsHtml5AttributeName
;
56 class nsHtml5ElementName
;
57 class nsHtml5HtmlAttributes
;
58 class nsHtml5UTF16Buffer
;
59 class nsHtml5StateSnapshot
;
60 class nsHtml5Portability
;
63 class nsHtml5MetaScanner
66 static staticJArray
<PRUnichar
,PRInt32
> CHARSET
;
67 static staticJArray
<PRUnichar
,PRInt32
> CONTENT
;
68 static staticJArray
<PRUnichar
,PRInt32
> HTTP_EQUIV
;
69 static staticJArray
<PRUnichar
,PRInt32
> CONTENT_TYPE
;
71 nsHtml5ByteReadable
* readable
;
76 PRInt32 httpEquivIndex
;
77 PRInt32 contentTypeIndex
;
82 autoJArray
<PRUnichar
,PRInt32
> strBuf
;
85 PRInt32 httpEquivState
;
88 ~nsHtml5MetaScanner();
90 void stateLoop(PRInt32 state
);
92 void handleCharInAttributeValue(PRInt32 c
);
93 inline PRInt32
toAsciiLowerCase(PRInt32 c
)
95 if (c
>= 'A' && c
<= 'Z') {
101 void addToBuffer(PRInt32 c
);
102 void handleAttributeValue();
104 PRBool
handleTagInner();
106 PRBool
tryCharset(nsString
* encoding
);
108 static void initializeStatics();
109 static void releaseStatics();
111 #include "nsHtml5MetaScannerHSupplement.h"
114 #define NS_HTML5META_SCANNER_NO 0
115 #define NS_HTML5META_SCANNER_M 1
116 #define NS_HTML5META_SCANNER_E 2
117 #define NS_HTML5META_SCANNER_T 3
118 #define NS_HTML5META_SCANNER_A 4
119 #define NS_HTML5META_SCANNER_DATA 0
120 #define NS_HTML5META_SCANNER_TAG_OPEN 1
121 #define NS_HTML5META_SCANNER_SCAN_UNTIL_GT 2
122 #define NS_HTML5META_SCANNER_TAG_NAME 3
123 #define NS_HTML5META_SCANNER_BEFORE_ATTRIBUTE_NAME 4
124 #define NS_HTML5META_SCANNER_ATTRIBUTE_NAME 5
125 #define NS_HTML5META_SCANNER_AFTER_ATTRIBUTE_NAME 6
126 #define NS_HTML5META_SCANNER_BEFORE_ATTRIBUTE_VALUE 7
127 #define NS_HTML5META_SCANNER_ATTRIBUTE_VALUE_DOUBLE_QUOTED 8
128 #define NS_HTML5META_SCANNER_ATTRIBUTE_VALUE_SINGLE_QUOTED 9
129 #define NS_HTML5META_SCANNER_ATTRIBUTE_VALUE_UNQUOTED 10
130 #define NS_HTML5META_SCANNER_AFTER_ATTRIBUTE_VALUE_QUOTED 11
131 #define NS_HTML5META_SCANNER_MARKUP_DECLARATION_OPEN 13
132 #define NS_HTML5META_SCANNER_MARKUP_DECLARATION_HYPHEN 14
133 #define NS_HTML5META_SCANNER_COMMENT_START 15
134 #define NS_HTML5META_SCANNER_COMMENT_START_DASH 16
135 #define NS_HTML5META_SCANNER_COMMENT 17
136 #define NS_HTML5META_SCANNER_COMMENT_END_DASH 18
137 #define NS_HTML5META_SCANNER_COMMENT_END 19
138 #define NS_HTML5META_SCANNER_SELF_CLOSING_START_TAG 20
139 #define NS_HTML5META_SCANNER_HTTP_EQUIV_NOT_SEEN 0
140 #define NS_HTML5META_SCANNER_HTTP_EQUIV_CONTENT_TYPE 1
141 #define NS_HTML5META_SCANNER_HTTP_EQUIV_OTHER 2