| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google, Inc. All Rights Reserved. | 2 * Copyright (C) 2010 Google, Inc. All Rights Reserved. |
| 3 * Copyright (C) 2011 Apple Inc. All rights reserved. | 3 * Copyright (C) 2011 Apple Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 #include "sky/engine/wtf/text/TextPosition.h" | 39 #include "sky/engine/wtf/text/TextPosition.h" |
| 40 | 40 |
| 41 namespace blink { | 41 namespace blink { |
| 42 | 42 |
| 43 class AtomicHTMLToken; | 43 class AtomicHTMLToken; |
| 44 class Document; | 44 class Document; |
| 45 class DocumentFragment; | 45 class DocumentFragment; |
| 46 class Element; | 46 class Element; |
| 47 class LocalFrame; | 47 class LocalFrame; |
| 48 class HTMLToken; | 48 class HTMLToken; |
| 49 class HTMLDocument; | |
| 50 class Node; | 49 class Node; |
| 51 class HTMLDocumentParser; | 50 class HTMLDocumentParser; |
| 52 | 51 |
| 53 class HTMLTreeBuilder final { | 52 class HTMLTreeBuilder final { |
| 54 WTF_MAKE_NONCOPYABLE(HTMLTreeBuilder); WTF_MAKE_FAST_ALLOCATED; | 53 WTF_MAKE_NONCOPYABLE(HTMLTreeBuilder); WTF_MAKE_FAST_ALLOCATED; |
| 55 public: | 54 public: |
| 56 static PassOwnPtr<HTMLTreeBuilder> create(HTMLDocumentParser* parser, HTMLDo
cument* document, bool reportErrors) | 55 static PassOwnPtr<HTMLTreeBuilder> create(HTMLDocumentParser* parser, Docume
nt* document, bool reportErrors) |
| 57 { | 56 { |
| 58 return adoptPtr(new HTMLTreeBuilder(parser, document, reportErrors)); | 57 return adoptPtr(new HTMLTreeBuilder(parser, document, reportErrors)); |
| 59 } | 58 } |
| 60 ~HTMLTreeBuilder(); | 59 ~HTMLTreeBuilder(); |
| 61 | 60 |
| 62 const HTMLElementStack* openElements() const { return m_tree.openElements();
} | 61 const HTMLElementStack* openElements() const { return m_tree.openElements();
} |
| 63 | 62 |
| 64 bool isParsingFragment() const { return !!m_fragmentContext.fragment(); } | 63 bool isParsingFragment() const { return !!m_fragmentContext.fragment(); } |
| 65 | 64 |
| 66 void detach(); | 65 void detach(); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 79 | 78 |
| 80 private: | 79 private: |
| 81 class CharacterTokenBuffer; | 80 class CharacterTokenBuffer; |
| 82 // Represents HTML5 "insertion mode" | 81 // Represents HTML5 "insertion mode" |
| 83 // http://www.whatwg.org/specs/web-apps/current-work/multipage/parsing.html#
insertion-mode | 82 // http://www.whatwg.org/specs/web-apps/current-work/multipage/parsing.html#
insertion-mode |
| 84 enum InsertionMode { | 83 enum InsertionMode { |
| 85 HTMLMode, | 84 HTMLMode, |
| 86 TextMode, | 85 TextMode, |
| 87 }; | 86 }; |
| 88 | 87 |
| 89 HTMLTreeBuilder(HTMLDocumentParser*, HTMLDocument*, bool reportErrors); | 88 HTMLTreeBuilder(HTMLDocumentParser*, Document*, bool reportErrors); |
| 90 | 89 |
| 91 void processStartTag(AtomicHTMLToken*); | 90 void processStartTag(AtomicHTMLToken*); |
| 92 void processEndTag(AtomicHTMLToken*); | 91 void processEndTag(AtomicHTMLToken*); |
| 93 void processCharacter(AtomicHTMLToken*); | 92 void processCharacter(AtomicHTMLToken*); |
| 94 void processEndOfFile(AtomicHTMLToken*); | 93 void processEndOfFile(AtomicHTMLToken*); |
| 95 | 94 |
| 96 void processGenericRawTextStartTag(AtomicHTMLToken*); | 95 void processGenericRawTextStartTag(AtomicHTMLToken*); |
| 97 void processScriptStartTag(AtomicHTMLToken*); | 96 void processScriptStartTag(AtomicHTMLToken*); |
| 98 | 97 |
| 99 InsertionMode insertionMode() const { return m_insertionMode; } | 98 InsertionMode insertionMode() const { return m_insertionMode; } |
| (...skipping 29 matching lines...) Expand all Loading... |
| 129 // from within parser actions. We also need it to track the current position
. | 128 // from within parser actions. We also need it to track the current position
. |
| 130 RawPtr<HTMLDocumentParser> m_parser; | 129 RawPtr<HTMLDocumentParser> m_parser; |
| 131 | 130 |
| 132 RefPtr<Element> m_scriptToProcess; // <script> tag which needs processing be
fore resuming the parser. | 131 RefPtr<Element> m_scriptToProcess; // <script> tag which needs processing be
fore resuming the parser. |
| 133 TextPosition m_scriptToProcessStartPosition; // Starting line number of the
script tag needing processing. | 132 TextPosition m_scriptToProcessStartPosition; // Starting line number of the
script tag needing processing. |
| 134 }; | 133 }; |
| 135 | 134 |
| 136 } | 135 } |
| 137 | 136 |
| 138 #endif // SKY_ENGINE_CORE_HTML_PARSER_HTMLTREEBUILDER_H_ | 137 #endif // SKY_ENGINE_CORE_HTML_PARSER_HTMLTREEBUILDER_H_ |
| OLD | NEW |