| 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 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 return String(m_characters->substring(start, m_current - start)); | 258 return String(m_characters->substring(start, m_current - start)); |
| 259 } | 259 } |
| 260 | 260 |
| 261 RefPtr<StringImpl> m_characters; | 261 RefPtr<StringImpl> m_characters; |
| 262 unsigned m_current; | 262 unsigned m_current; |
| 263 unsigned m_end; | 263 unsigned m_end; |
| 264 }; | 264 }; |
| 265 | 265 |
| 266 HTMLTreeBuilder::HTMLTreeBuilder(HTMLDocumentParser* parser, HTMLDocument* docum
ent, ParserContentPolicy parserContentPolicy, bool, const HTMLParserOptions& opt
ions) | 266 HTMLTreeBuilder::HTMLTreeBuilder(HTMLDocumentParser* parser, HTMLDocument* docum
ent, ParserContentPolicy parserContentPolicy, bool, const HTMLParserOptions& opt
ions) |
| 267 : m_framesetOk(true) | 267 : m_framesetOk(true) |
| 268 #ifndef NDEBUG | 268 #if ENABLE(ASSERT) |
| 269 , m_isAttached(true) | 269 , m_isAttached(true) |
| 270 #endif | 270 #endif |
| 271 , m_tree(document, parserContentPolicy) | 271 , m_tree(document, parserContentPolicy) |
| 272 , m_insertionMode(InitialMode) | 272 , m_insertionMode(InitialMode) |
| 273 , m_originalInsertionMode(InitialMode) | 273 , m_originalInsertionMode(InitialMode) |
| 274 , m_shouldSkipLeadingNewline(false) | 274 , m_shouldSkipLeadingNewline(false) |
| 275 , m_parser(parser) | 275 , m_parser(parser) |
| 276 , m_scriptToProcessStartPosition(uninitializedPositionValue1()) | 276 , m_scriptToProcessStartPosition(uninitializedPositionValue1()) |
| 277 , m_options(options) | 277 , m_options(options) |
| 278 { | 278 { |
| 279 } | 279 } |
| 280 | 280 |
| 281 // FIXME: Member variables should be grouped into self-initializing structs to | 281 // FIXME: Member variables should be grouped into self-initializing structs to |
| 282 // minimize code duplication between these constructors. | 282 // minimize code duplication between these constructors. |
| 283 HTMLTreeBuilder::HTMLTreeBuilder(HTMLDocumentParser* parser, DocumentFragment* f
ragment, Element* contextElement, ParserContentPolicy parserContentPolicy, const
HTMLParserOptions& options) | 283 HTMLTreeBuilder::HTMLTreeBuilder(HTMLDocumentParser* parser, DocumentFragment* f
ragment, Element* contextElement, ParserContentPolicy parserContentPolicy, const
HTMLParserOptions& options) |
| 284 : m_framesetOk(true) | 284 : m_framesetOk(true) |
| 285 #ifndef NDEBUG | 285 #if ENABLE(ASSERT) |
| 286 , m_isAttached(true) | 286 , m_isAttached(true) |
| 287 #endif | 287 #endif |
| 288 , m_fragmentContext(fragment, contextElement) | 288 , m_fragmentContext(fragment, contextElement) |
| 289 , m_tree(fragment, parserContentPolicy) | 289 , m_tree(fragment, parserContentPolicy) |
| 290 , m_insertionMode(InitialMode) | 290 , m_insertionMode(InitialMode) |
| 291 , m_originalInsertionMode(InitialMode) | 291 , m_originalInsertionMode(InitialMode) |
| 292 , m_shouldSkipLeadingNewline(false) | 292 , m_shouldSkipLeadingNewline(false) |
| 293 , m_parser(parser) | 293 , m_parser(parser) |
| 294 , m_scriptToProcessStartPosition(uninitializedPositionValue1()) | 294 , m_scriptToProcessStartPosition(uninitializedPositionValue1()) |
| 295 , m_options(options) | 295 , m_options(options) |
| (...skipping 21 matching lines...) Expand all Loading... |
| 317 void HTMLTreeBuilder::trace(Visitor* visitor) | 317 void HTMLTreeBuilder::trace(Visitor* visitor) |
| 318 { | 318 { |
| 319 visitor->trace(m_fragmentContext); | 319 visitor->trace(m_fragmentContext); |
| 320 visitor->trace(m_tree); | 320 visitor->trace(m_tree); |
| 321 visitor->trace(m_parser); | 321 visitor->trace(m_parser); |
| 322 visitor->trace(m_scriptToProcess); | 322 visitor->trace(m_scriptToProcess); |
| 323 } | 323 } |
| 324 | 324 |
| 325 void HTMLTreeBuilder::detach() | 325 void HTMLTreeBuilder::detach() |
| 326 { | 326 { |
| 327 #ifndef NDEBUG | 327 #if ENABLE(ASSERT) |
| 328 // This call makes little sense in fragment mode, but for consistency | 328 // This call makes little sense in fragment mode, but for consistency |
| 329 // DocumentParser expects detach() to always be called before it's destroyed
. | 329 // DocumentParser expects detach() to always be called before it's destroyed
. |
| 330 m_isAttached = false; | 330 m_isAttached = false; |
| 331 #endif | 331 #endif |
| 332 // HTMLConstructionSite might be on the callstack when detach() is called | 332 // HTMLConstructionSite might be on the callstack when detach() is called |
| 333 // otherwise we'd just call m_tree.clear() here instead. | 333 // otherwise we'd just call m_tree.clear() here instead. |
| 334 m_tree.detach(); | 334 m_tree.detach(); |
| 335 } | 335 } |
| 336 | 336 |
| 337 HTMLTreeBuilder::FragmentParsingContext::FragmentParsingContext() | 337 HTMLTreeBuilder::FragmentParsingContext::FragmentParsingContext() |
| (...skipping 2456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2794 ASSERT(m_isAttached); | 2794 ASSERT(m_isAttached); |
| 2795 // Warning, this may detach the parser. Do not do anything else after this. | 2795 // Warning, this may detach the parser. Do not do anything else after this. |
| 2796 m_tree.finishedParsing(); | 2796 m_tree.finishedParsing(); |
| 2797 } | 2797 } |
| 2798 | 2798 |
| 2799 void HTMLTreeBuilder::parseError(AtomicHTMLToken*) | 2799 void HTMLTreeBuilder::parseError(AtomicHTMLToken*) |
| 2800 { | 2800 { |
| 2801 } | 2801 } |
| 2802 | 2802 |
| 2803 } // namespace WebCore | 2803 } // namespace WebCore |
| OLD | NEW |