| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 public: | 52 public: |
| 53 static PassOwnPtrWillBeRawPtr<HTMLTreeBuilder> create(HTMLDocumentParser* pa
rser, HTMLDocument* document, ParserContentPolicy parserContentPolicy, bool repo
rtErrors, const HTMLParserOptions& options) | 53 static PassOwnPtrWillBeRawPtr<HTMLTreeBuilder> create(HTMLDocumentParser* pa
rser, HTMLDocument* document, ParserContentPolicy parserContentPolicy, bool repo
rtErrors, const HTMLParserOptions& options) |
| 54 { | 54 { |
| 55 return adoptPtrWillBeNoop(new HTMLTreeBuilder(parser, document, parserCo
ntentPolicy, reportErrors, options)); | 55 return adoptPtrWillBeNoop(new HTMLTreeBuilder(parser, document, parserCo
ntentPolicy, reportErrors, options)); |
| 56 } | 56 } |
| 57 static PassOwnPtrWillBeRawPtr<HTMLTreeBuilder> create(HTMLDocumentParser* pa
rser, DocumentFragment* fragment, Element* contextElement, ParserContentPolicy p
arserContentPolicy, const HTMLParserOptions& options) | 57 static PassOwnPtrWillBeRawPtr<HTMLTreeBuilder> create(HTMLDocumentParser* pa
rser, DocumentFragment* fragment, Element* contextElement, ParserContentPolicy p
arserContentPolicy, const HTMLParserOptions& options) |
| 58 { | 58 { |
| 59 return adoptPtrWillBeNoop(new HTMLTreeBuilder(parser, fragment, contextE
lement, parserContentPolicy, options)); | 59 return adoptPtrWillBeNoop(new HTMLTreeBuilder(parser, fragment, contextE
lement, parserContentPolicy, options)); |
| 60 } | 60 } |
| 61 ~HTMLTreeBuilder(); | 61 ~HTMLTreeBuilder(); |
| 62 void trace(Visitor*); | 62 DECLARE_TRACE(); |
| 63 | 63 |
| 64 const HTMLElementStack* openElements() const { return m_tree.openElements();
} | 64 const HTMLElementStack* openElements() const { return m_tree.openElements();
} |
| 65 | 65 |
| 66 bool isParsingFragment() const { return !!m_fragmentContext.fragment(); } | 66 bool isParsingFragment() const { return !!m_fragmentContext.fragment(); } |
| 67 bool isParsingTemplateContents() const { return m_tree.openElements()->hasTe
mplateInHTMLScope(); } | 67 bool isParsingTemplateContents() const { return m_tree.openElements()->hasTe
mplateInHTMLScope(); } |
| 68 bool isParsingFragmentOrTemplateContents() const { return isParsingFragment(
) || isParsingTemplateContents(); } | 68 bool isParsingFragmentOrTemplateContents() const { return isParsingFragment(
) || isParsingTemplateContents(); } |
| 69 | 69 |
| 70 void detach(); | 70 void detach(); |
| 71 | 71 |
| 72 void constructTree(AtomicHTMLToken*); | 72 void constructTree(AtomicHTMLToken*); |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 DISALLOW_ALLOCATION(); | 196 DISALLOW_ALLOCATION(); |
| 197 public: | 197 public: |
| 198 FragmentParsingContext(); | 198 FragmentParsingContext(); |
| 199 FragmentParsingContext(DocumentFragment*, Element* contextElement); | 199 FragmentParsingContext(DocumentFragment*, Element* contextElement); |
| 200 ~FragmentParsingContext(); | 200 ~FragmentParsingContext(); |
| 201 | 201 |
| 202 DocumentFragment* fragment() const { return m_fragment; } | 202 DocumentFragment* fragment() const { return m_fragment; } |
| 203 Element* contextElement() const { ASSERT(m_fragment); return m_contextEl
ementStackItem->element(); } | 203 Element* contextElement() const { ASSERT(m_fragment); return m_contextEl
ementStackItem->element(); } |
| 204 HTMLStackItem* contextElementStackItem() const { ASSERT(m_fragment); ret
urn m_contextElementStackItem.get(); } | 204 HTMLStackItem* contextElementStackItem() const { ASSERT(m_fragment); ret
urn m_contextElementStackItem.get(); } |
| 205 | 205 |
| 206 void trace(Visitor*); | 206 DECLARE_TRACE(); |
| 207 | 207 |
| 208 private: | 208 private: |
| 209 RawPtrWillBeMember<DocumentFragment> m_fragment; | 209 RawPtrWillBeMember<DocumentFragment> m_fragment; |
| 210 RefPtrWillBeMember<HTMLStackItem> m_contextElementStackItem; | 210 RefPtrWillBeMember<HTMLStackItem> m_contextElementStackItem; |
| 211 }; | 211 }; |
| 212 | 212 |
| 213 bool m_framesetOk; | 213 bool m_framesetOk; |
| 214 #if ENABLE(ASSERT) | 214 #if ENABLE(ASSERT) |
| 215 bool m_isAttached; | 215 bool m_isAttached; |
| 216 #endif | 216 #endif |
| (...skipping 19 matching lines...) Expand all Loading... |
| 236 | 236 |
| 237 RefPtrWillBeMember<Element> m_scriptToProcess; // <script> tag which needs p
rocessing before resuming the parser. | 237 RefPtrWillBeMember<Element> m_scriptToProcess; // <script> tag which needs p
rocessing before resuming the parser. |
| 238 TextPosition m_scriptToProcessStartPosition; // Starting line number of the
script tag needing processing. | 238 TextPosition m_scriptToProcessStartPosition; // Starting line number of the
script tag needing processing. |
| 239 | 239 |
| 240 HTMLParserOptions m_options; | 240 HTMLParserOptions m_options; |
| 241 }; | 241 }; |
| 242 | 242 |
| 243 } | 243 } |
| 244 | 244 |
| 245 #endif | 245 #endif |
| OLD | NEW |