| 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 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 | 291 |
| 292 PassRefPtr<HTMLFormElement> HTMLConstructionSite::takeForm() | 292 PassRefPtr<HTMLFormElement> HTMLConstructionSite::takeForm() |
| 293 { | 293 { |
| 294 return m_form.release(); | 294 return m_form.release(); |
| 295 } | 295 } |
| 296 | 296 |
| 297 void HTMLConstructionSite::dispatchDocumentElementAvailableIfNeeded() | 297 void HTMLConstructionSite::dispatchDocumentElementAvailableIfNeeded() |
| 298 { | 298 { |
| 299 ASSERT(m_document); | 299 ASSERT(m_document); |
| 300 if (m_document->frame() && !m_isParsingFragment) | 300 if (m_document->frame() && !m_isParsingFragment) |
| 301 m_document->frame()->loader()->dispatchDocumentElementAvailable(); | 301 m_document->frame()->loader().dispatchDocumentElementAvailable(); |
| 302 } | 302 } |
| 303 | 303 |
| 304 void HTMLConstructionSite::insertHTMLHtmlStartTagBeforeHTML(AtomicHTMLToken* tok
en) | 304 void HTMLConstructionSite::insertHTMLHtmlStartTagBeforeHTML(AtomicHTMLToken* tok
en) |
| 305 { | 305 { |
| 306 ASSERT(m_document); | 306 ASSERT(m_document); |
| 307 RefPtr<HTMLHtmlElement> element = HTMLHtmlElement::create(*m_document); | 307 RefPtr<HTMLHtmlElement> element = HTMLHtmlElement::create(*m_document); |
| 308 setAttributes(element.get(), token, m_parserContentPolicy); | 308 setAttributes(element.get(), token, m_parserContentPolicy); |
| 309 attachLater(m_attachmentRoot, element); | 309 attachLater(m_attachmentRoot, element); |
| 310 m_openElements.pushHTMLHtmlElement(HTMLStackItem::create(element, token)); | 310 m_openElements.pushHTMLHtmlElement(HTMLStackItem::create(element, token)); |
| 311 | 311 |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 m_openElements.pushHTMLHeadElement(m_head); | 509 m_openElements.pushHTMLHeadElement(m_head); |
| 510 } | 510 } |
| 511 | 511 |
| 512 void HTMLConstructionSite::insertHTMLBodyElement(AtomicHTMLToken* token) | 512 void HTMLConstructionSite::insertHTMLBodyElement(AtomicHTMLToken* token) |
| 513 { | 513 { |
| 514 ASSERT(!shouldFosterParent()); | 514 ASSERT(!shouldFosterParent()); |
| 515 RefPtr<Element> body = createHTMLElement(token); | 515 RefPtr<Element> body = createHTMLElement(token); |
| 516 attachLater(currentNode(), body); | 516 attachLater(currentNode(), body); |
| 517 m_openElements.pushHTMLBodyElement(HTMLStackItem::create(body.release(), tok
en)); | 517 m_openElements.pushHTMLBodyElement(HTMLStackItem::create(body.release(), tok
en)); |
| 518 if (Frame* frame = m_document->frame()) | 518 if (Frame* frame = m_document->frame()) |
| 519 frame->loader()->client()->dispatchWillInsertBody(); | 519 frame->loader().client()->dispatchWillInsertBody(); |
| 520 } | 520 } |
| 521 | 521 |
| 522 void HTMLConstructionSite::insertHTMLFormElement(AtomicHTMLToken* token, bool is
Demoted) | 522 void HTMLConstructionSite::insertHTMLFormElement(AtomicHTMLToken* token, bool is
Demoted) |
| 523 { | 523 { |
| 524 RefPtr<Element> element = createHTMLElement(token); | 524 RefPtr<Element> element = createHTMLElement(token); |
| 525 ASSERT(element->hasTagName(formTag)); | 525 ASSERT(element->hasTagName(formTag)); |
| 526 m_form = static_pointer_cast<HTMLFormElement>(element.release()); | 526 m_form = static_pointer_cast<HTMLFormElement>(element.release()); |
| 527 m_form->setDemoted(isDemoted); | 527 m_form->setDemoted(isDemoted); |
| 528 attachLater(currentNode(), m_form); | 528 attachLater(currentNode(), m_form); |
| 529 m_openElements.push(HTMLStackItem::create(m_form, token)); | 529 m_openElements.push(HTMLStackItem::create(m_form, token)); |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 818 void HTMLConstructionSite::fosterParent(PassRefPtr<Node> node) | 818 void HTMLConstructionSite::fosterParent(PassRefPtr<Node> node) |
| 819 { | 819 { |
| 820 HTMLConstructionSiteTask task(HTMLConstructionSiteTask::Insert); | 820 HTMLConstructionSiteTask task(HTMLConstructionSiteTask::Insert); |
| 821 findFosterSite(task); | 821 findFosterSite(task); |
| 822 task.child = node; | 822 task.child = node; |
| 823 ASSERT(task.parent); | 823 ASSERT(task.parent); |
| 824 queueTask(task); | 824 queueTask(task); |
| 825 } | 825 } |
| 826 | 826 |
| 827 } | 827 } |
| OLD | NEW |