michael@0: /* michael@0: * Copyright (c) 2007 Henri Sivonen michael@0: * Copyright (c) 2008-2010 Mozilla Foundation michael@0: * michael@0: * Permission is hereby granted, free of charge, to any person obtaining a michael@0: * copy of this software and associated documentation files (the "Software"), michael@0: * to deal in the Software without restriction, including without limitation michael@0: * the rights to use, copy, modify, merge, publish, distribute, sublicense, michael@0: * and/or sell copies of the Software, and to permit persons to whom the michael@0: * Software is furnished to do so, subject to the following conditions: michael@0: * michael@0: * The above copyright notice and this permission notice shall be included in michael@0: * all copies or substantial portions of the Software. michael@0: * michael@0: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR michael@0: * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, michael@0: * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL michael@0: * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER michael@0: * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING michael@0: * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER michael@0: * DEALINGS IN THE SOFTWARE. michael@0: */ michael@0: michael@0: /* michael@0: * THIS IS A GENERATED FILE. PLEASE DO NOT EDIT. michael@0: * Please edit MetaScanner.java instead and regenerate. michael@0: */ michael@0: michael@0: #ifndef nsHtml5MetaScanner_h michael@0: #define nsHtml5MetaScanner_h michael@0: michael@0: #include "nsIAtom.h" michael@0: #include "nsHtml5AtomTable.h" michael@0: #include "nsString.h" michael@0: #include "nsNameSpaceManager.h" michael@0: #include "nsIContent.h" michael@0: #include "nsTraceRefcnt.h" michael@0: #include "jArray.h" michael@0: #include "nsHtml5ArrayCopy.h" michael@0: #include "nsAHtml5TreeBuilderState.h" michael@0: #include "nsHtml5Atoms.h" michael@0: #include "nsHtml5ByteReadable.h" michael@0: #include "nsIUnicodeDecoder.h" michael@0: #include "nsHtml5Macros.h" michael@0: #include "nsIContentHandle.h" michael@0: michael@0: class nsHtml5StreamParser; michael@0: michael@0: class nsHtml5Tokenizer; michael@0: class nsHtml5TreeBuilder; michael@0: class nsHtml5AttributeName; michael@0: class nsHtml5ElementName; michael@0: class nsHtml5HtmlAttributes; michael@0: class nsHtml5UTF16Buffer; michael@0: class nsHtml5StateSnapshot; michael@0: class nsHtml5Portability; michael@0: michael@0: michael@0: class nsHtml5MetaScanner michael@0: { michael@0: private: michael@0: static staticJArray CHARSET; michael@0: static staticJArray CONTENT; michael@0: static staticJArray HTTP_EQUIV; michael@0: static staticJArray CONTENT_TYPE; michael@0: protected: michael@0: nsHtml5ByteReadable* readable; michael@0: private: michael@0: int32_t metaState; michael@0: int32_t contentIndex; michael@0: int32_t charsetIndex; michael@0: int32_t httpEquivIndex; michael@0: int32_t contentTypeIndex; michael@0: protected: michael@0: int32_t stateSave; michael@0: private: michael@0: int32_t strBufLen; michael@0: autoJArray strBuf; michael@0: nsString* content; michael@0: nsString* charset; michael@0: int32_t httpEquivState; michael@0: public: michael@0: nsHtml5MetaScanner(); michael@0: ~nsHtml5MetaScanner(); michael@0: protected: michael@0: void stateLoop(int32_t state); michael@0: private: michael@0: void handleCharInAttributeValue(int32_t c); michael@0: inline int32_t toAsciiLowerCase(int32_t c) michael@0: { michael@0: if (c >= 'A' && c <= 'Z') { michael@0: return c + 0x20; michael@0: } michael@0: return c; michael@0: } michael@0: michael@0: void addToBuffer(int32_t c); michael@0: void handleAttributeValue(); michael@0: bool handleTag(); michael@0: bool handleTagInner(); michael@0: protected: michael@0: bool tryCharset(nsString* encoding); michael@0: public: michael@0: static void initializeStatics(); michael@0: static void releaseStatics(); michael@0: michael@0: #include "nsHtml5MetaScannerHSupplement.h" michael@0: }; michael@0: michael@0: #define NS_HTML5META_SCANNER_NO 0 michael@0: #define NS_HTML5META_SCANNER_M 1 michael@0: #define NS_HTML5META_SCANNER_E 2 michael@0: #define NS_HTML5META_SCANNER_T 3 michael@0: #define NS_HTML5META_SCANNER_A 4 michael@0: #define NS_HTML5META_SCANNER_DATA 0 michael@0: #define NS_HTML5META_SCANNER_TAG_OPEN 1 michael@0: #define NS_HTML5META_SCANNER_SCAN_UNTIL_GT 2 michael@0: #define NS_HTML5META_SCANNER_TAG_NAME 3 michael@0: #define NS_HTML5META_SCANNER_BEFORE_ATTRIBUTE_NAME 4 michael@0: #define NS_HTML5META_SCANNER_ATTRIBUTE_NAME 5 michael@0: #define NS_HTML5META_SCANNER_AFTER_ATTRIBUTE_NAME 6 michael@0: #define NS_HTML5META_SCANNER_BEFORE_ATTRIBUTE_VALUE 7 michael@0: #define NS_HTML5META_SCANNER_ATTRIBUTE_VALUE_DOUBLE_QUOTED 8 michael@0: #define NS_HTML5META_SCANNER_ATTRIBUTE_VALUE_SINGLE_QUOTED 9 michael@0: #define NS_HTML5META_SCANNER_ATTRIBUTE_VALUE_UNQUOTED 10 michael@0: #define NS_HTML5META_SCANNER_AFTER_ATTRIBUTE_VALUE_QUOTED 11 michael@0: #define NS_HTML5META_SCANNER_MARKUP_DECLARATION_OPEN 13 michael@0: #define NS_HTML5META_SCANNER_MARKUP_DECLARATION_HYPHEN 14 michael@0: #define NS_HTML5META_SCANNER_COMMENT_START 15 michael@0: #define NS_HTML5META_SCANNER_COMMENT_START_DASH 16 michael@0: #define NS_HTML5META_SCANNER_COMMENT 17 michael@0: #define NS_HTML5META_SCANNER_COMMENT_END_DASH 18 michael@0: #define NS_HTML5META_SCANNER_COMMENT_END 19 michael@0: #define NS_HTML5META_SCANNER_SELF_CLOSING_START_TAG 20 michael@0: #define NS_HTML5META_SCANNER_HTTP_EQUIV_NOT_SEEN 0 michael@0: #define NS_HTML5META_SCANNER_HTTP_EQUIV_CONTENT_TYPE 1 michael@0: #define NS_HTML5META_SCANNER_HTTP_EQUIV_OTHER 2 michael@0: michael@0: michael@0: #endif michael@0: