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 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 } | 376 } |
377 | 377 |
378 PassRefPtrWillBeRawPtr<HTMLFormElement> HTMLConstructionSite::takeForm() | 378 PassRefPtrWillBeRawPtr<HTMLFormElement> HTMLConstructionSite::takeForm() |
379 { | 379 { |
380 return m_form.release(); | 380 return m_form.release(); |
381 } | 381 } |
382 | 382 |
383 void HTMLConstructionSite::dispatchDocumentElementAvailableIfNeeded() | 383 void HTMLConstructionSite::dispatchDocumentElementAvailableIfNeeded() |
384 { | 384 { |
385 ASSERT(m_document); | 385 ASSERT(m_document); |
386 if (m_document->frame() && !m_isParsingFragment) | 386 if (m_document->frame() && !m_isParsingFragment) { |
387 m_document->frame()->loader().dispatchDocumentElementAvailable(); | 387 m_document->frame()->loader().dispatchDocumentElementAvailable(); |
| 388 m_document->frame()->loader().runScriptsAtDocumentElementAvailable(); |
| 389 // runScriptsAtDocumentElementAvailable might have invalidated m_documen
t. |
| 390 } |
388 } | 391 } |
389 | 392 |
390 void HTMLConstructionSite::insertHTMLHtmlStartTagBeforeHTML(AtomicHTMLToken* tok
en) | 393 void HTMLConstructionSite::insertHTMLHtmlStartTagBeforeHTML(AtomicHTMLToken* tok
en) |
391 { | 394 { |
392 ASSERT(m_document); | 395 ASSERT(m_document); |
393 RefPtrWillBeRawPtr<HTMLHtmlElement> element = HTMLHtmlElement::create(*m_doc
ument); | 396 RefPtrWillBeRawPtr<HTMLHtmlElement> element = HTMLHtmlElement::create(*m_doc
ument); |
394 setAttributes(element.get(), token, m_parserContentPolicy); | 397 setAttributes(element.get(), token, m_parserContentPolicy); |
395 attachLater(m_attachmentRoot, element); | 398 attachLater(m_attachmentRoot, element); |
396 m_openElements.pushHTMLHtmlElement(HTMLStackItem::create(element, token)); | 399 m_openElements.pushHTMLHtmlElement(HTMLStackItem::create(element, token)); |
397 | 400 |
(...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
871 queueTask(task); | 874 queueTask(task); |
872 } | 875 } |
873 | 876 |
874 DEFINE_TRACE(HTMLConstructionSite::PendingText) | 877 DEFINE_TRACE(HTMLConstructionSite::PendingText) |
875 { | 878 { |
876 visitor->trace(parent); | 879 visitor->trace(parent); |
877 visitor->trace(nextChild); | 880 visitor->trace(nextChild); |
878 } | 881 } |
879 | 882 |
880 } // namespace blink | 883 } // namespace blink |
OLD | NEW |