parser/html/nsHtml5MetaScanner.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/parser/html/nsHtml5MetaScanner.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,141 @@
     1.4 +/*
     1.5 + * Copyright (c) 2007 Henri Sivonen
     1.6 + * Copyright (c) 2008-2010 Mozilla Foundation
     1.7 + *
     1.8 + * Permission is hereby granted, free of charge, to any person obtaining a 
     1.9 + * copy of this software and associated documentation files (the "Software"), 
    1.10 + * to deal in the Software without restriction, including without limitation 
    1.11 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, 
    1.12 + * and/or sell copies of the Software, and to permit persons to whom the 
    1.13 + * Software is furnished to do so, subject to the following conditions:
    1.14 + *
    1.15 + * The above copyright notice and this permission notice shall be included in 
    1.16 + * all copies or substantial portions of the Software.
    1.17 + *
    1.18 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
    1.19 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
    1.20 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 
    1.21 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
    1.22 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
    1.23 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
    1.24 + * DEALINGS IN THE SOFTWARE.
    1.25 + */
    1.26 +
    1.27 +/*
    1.28 + * THIS IS A GENERATED FILE. PLEASE DO NOT EDIT.
    1.29 + * Please edit MetaScanner.java instead and regenerate.
    1.30 + */
    1.31 +
    1.32 +#ifndef nsHtml5MetaScanner_h
    1.33 +#define nsHtml5MetaScanner_h
    1.34 +
    1.35 +#include "nsIAtom.h"
    1.36 +#include "nsHtml5AtomTable.h"
    1.37 +#include "nsString.h"
    1.38 +#include "nsNameSpaceManager.h"
    1.39 +#include "nsIContent.h"
    1.40 +#include "nsTraceRefcnt.h"
    1.41 +#include "jArray.h"
    1.42 +#include "nsHtml5ArrayCopy.h"
    1.43 +#include "nsAHtml5TreeBuilderState.h"
    1.44 +#include "nsHtml5Atoms.h"
    1.45 +#include "nsHtml5ByteReadable.h"
    1.46 +#include "nsIUnicodeDecoder.h"
    1.47 +#include "nsHtml5Macros.h"
    1.48 +#include "nsIContentHandle.h"
    1.49 +
    1.50 +class nsHtml5StreamParser;
    1.51 +
    1.52 +class nsHtml5Tokenizer;
    1.53 +class nsHtml5TreeBuilder;
    1.54 +class nsHtml5AttributeName;
    1.55 +class nsHtml5ElementName;
    1.56 +class nsHtml5HtmlAttributes;
    1.57 +class nsHtml5UTF16Buffer;
    1.58 +class nsHtml5StateSnapshot;
    1.59 +class nsHtml5Portability;
    1.60 +
    1.61 +
    1.62 +class nsHtml5MetaScanner
    1.63 +{
    1.64 +  private:
    1.65 +    static staticJArray<char16_t,int32_t> CHARSET;
    1.66 +    static staticJArray<char16_t,int32_t> CONTENT;
    1.67 +    static staticJArray<char16_t,int32_t> HTTP_EQUIV;
    1.68 +    static staticJArray<char16_t,int32_t> CONTENT_TYPE;
    1.69 +  protected:
    1.70 +    nsHtml5ByteReadable* readable;
    1.71 +  private:
    1.72 +    int32_t metaState;
    1.73 +    int32_t contentIndex;
    1.74 +    int32_t charsetIndex;
    1.75 +    int32_t httpEquivIndex;
    1.76 +    int32_t contentTypeIndex;
    1.77 +  protected:
    1.78 +    int32_t stateSave;
    1.79 +  private:
    1.80 +    int32_t strBufLen;
    1.81 +    autoJArray<char16_t,int32_t> strBuf;
    1.82 +    nsString* content;
    1.83 +    nsString* charset;
    1.84 +    int32_t httpEquivState;
    1.85 +  public:
    1.86 +    nsHtml5MetaScanner();
    1.87 +    ~nsHtml5MetaScanner();
    1.88 +  protected:
    1.89 +    void stateLoop(int32_t state);
    1.90 +  private:
    1.91 +    void handleCharInAttributeValue(int32_t c);
    1.92 +    inline int32_t toAsciiLowerCase(int32_t c)
    1.93 +    {
    1.94 +      if (c >= 'A' && c <= 'Z') {
    1.95 +        return c + 0x20;
    1.96 +      }
    1.97 +      return c;
    1.98 +    }
    1.99 +
   1.100 +    void addToBuffer(int32_t c);
   1.101 +    void handleAttributeValue();
   1.102 +    bool handleTag();
   1.103 +    bool handleTagInner();
   1.104 +  protected:
   1.105 +    bool tryCharset(nsString* encoding);
   1.106 +  public:
   1.107 +    static void initializeStatics();
   1.108 +    static void releaseStatics();
   1.109 +
   1.110 +#include "nsHtml5MetaScannerHSupplement.h"
   1.111 +};
   1.112 +
   1.113 +#define NS_HTML5META_SCANNER_NO 0
   1.114 +#define NS_HTML5META_SCANNER_M 1
   1.115 +#define NS_HTML5META_SCANNER_E 2
   1.116 +#define NS_HTML5META_SCANNER_T 3
   1.117 +#define NS_HTML5META_SCANNER_A 4
   1.118 +#define NS_HTML5META_SCANNER_DATA 0
   1.119 +#define NS_HTML5META_SCANNER_TAG_OPEN 1
   1.120 +#define NS_HTML5META_SCANNER_SCAN_UNTIL_GT 2
   1.121 +#define NS_HTML5META_SCANNER_TAG_NAME 3
   1.122 +#define NS_HTML5META_SCANNER_BEFORE_ATTRIBUTE_NAME 4
   1.123 +#define NS_HTML5META_SCANNER_ATTRIBUTE_NAME 5
   1.124 +#define NS_HTML5META_SCANNER_AFTER_ATTRIBUTE_NAME 6
   1.125 +#define NS_HTML5META_SCANNER_BEFORE_ATTRIBUTE_VALUE 7
   1.126 +#define NS_HTML5META_SCANNER_ATTRIBUTE_VALUE_DOUBLE_QUOTED 8
   1.127 +#define NS_HTML5META_SCANNER_ATTRIBUTE_VALUE_SINGLE_QUOTED 9
   1.128 +#define NS_HTML5META_SCANNER_ATTRIBUTE_VALUE_UNQUOTED 10
   1.129 +#define NS_HTML5META_SCANNER_AFTER_ATTRIBUTE_VALUE_QUOTED 11
   1.130 +#define NS_HTML5META_SCANNER_MARKUP_DECLARATION_OPEN 13
   1.131 +#define NS_HTML5META_SCANNER_MARKUP_DECLARATION_HYPHEN 14
   1.132 +#define NS_HTML5META_SCANNER_COMMENT_START 15
   1.133 +#define NS_HTML5META_SCANNER_COMMENT_START_DASH 16
   1.134 +#define NS_HTML5META_SCANNER_COMMENT 17
   1.135 +#define NS_HTML5META_SCANNER_COMMENT_END_DASH 18
   1.136 +#define NS_HTML5META_SCANNER_COMMENT_END 19
   1.137 +#define NS_HTML5META_SCANNER_SELF_CLOSING_START_TAG 20
   1.138 +#define NS_HTML5META_SCANNER_HTTP_EQUIV_NOT_SEEN 0
   1.139 +#define NS_HTML5META_SCANNER_HTTP_EQUIV_CONTENT_TYPE 1
   1.140 +#define NS_HTML5META_SCANNER_HTTP_EQUIV_OTHER 2
   1.141 +
   1.142 +
   1.143 +#endif
   1.144 +

mercurial