Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(95)

Side by Side Diff: Source/core/html/parser/HTMLConstructionSite.cpp

Issue 31063004: Have Frame::loader() return a reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
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 }
OLDNEW
« no previous file with comments | « Source/core/html/canvas/WebGLRenderingContext.cpp ('k') | Source/core/html/parser/HTMLParserOptions.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698