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 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 if (token->forceQuirks()) | 419 if (token->forceQuirks()) |
420 setCompatibilityMode(Document::QuirksMode); | 420 setCompatibilityMode(Document::QuirksMode); |
421 else { | 421 else { |
422 setCompatibilityModeFromDoctype(token->name(), publicId, systemId); | 422 setCompatibilityModeFromDoctype(token->name(), publicId, systemId); |
423 } | 423 } |
424 } | 424 } |
425 | 425 |
426 void HTMLConstructionSite::insertComment(AtomicHTMLToken* token) | 426 void HTMLConstructionSite::insertComment(AtomicHTMLToken* token) |
427 { | 427 { |
428 ASSERT(token->type() == HTMLToken::Comment); | 428 ASSERT(token->type() == HTMLToken::Comment); |
429 attachLater(currentNode(), Comment::create(&ownerDocumentForCurrentNode(), t
oken->comment())); | 429 attachLater(currentNode(), Comment::create(ownerDocumentForCurrentNode(), to
ken->comment())); |
430 } | 430 } |
431 | 431 |
432 void HTMLConstructionSite::insertCommentOnDocument(AtomicHTMLToken* token) | 432 void HTMLConstructionSite::insertCommentOnDocument(AtomicHTMLToken* token) |
433 { | 433 { |
434 ASSERT(token->type() == HTMLToken::Comment); | 434 ASSERT(token->type() == HTMLToken::Comment); |
435 attachLater(m_attachmentRoot, Comment::create(m_document, token->comment()))
; | 435 ASSERT(m_document); |
| 436 attachLater(m_attachmentRoot, Comment::create(*m_document, token->comment())
); |
436 } | 437 } |
437 | 438 |
438 void HTMLConstructionSite::insertCommentOnHTMLHtmlElement(AtomicHTMLToken* token
) | 439 void HTMLConstructionSite::insertCommentOnHTMLHtmlElement(AtomicHTMLToken* token
) |
439 { | 440 { |
440 ASSERT(token->type() == HTMLToken::Comment); | 441 ASSERT(token->type() == HTMLToken::Comment); |
441 ContainerNode* parent = m_openElements.rootNode(); | 442 ContainerNode* parent = m_openElements.rootNode(); |
442 attachLater(parent, Comment::create(&parent->document(), token->comment())); | 443 attachLater(parent, Comment::create(parent->document(), token->comment())); |
443 } | 444 } |
444 | 445 |
445 void HTMLConstructionSite::insertHTMLHeadElement(AtomicHTMLToken* token) | 446 void HTMLConstructionSite::insertHTMLHeadElement(AtomicHTMLToken* token) |
446 { | 447 { |
447 ASSERT(!shouldFosterParent()); | 448 ASSERT(!shouldFosterParent()); |
448 m_head = HTMLStackItem::create(createHTMLElement(token), token); | 449 m_head = HTMLStackItem::create(createHTMLElement(token), token); |
449 attachLater(currentNode(), m_head->element()); | 450 attachLater(currentNode(), m_head->element()); |
450 m_openElements.pushHTMLHeadElement(m_head); | 451 m_openElements.pushHTMLHeadElement(m_head); |
451 } | 452 } |
452 | 453 |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
745 { | 746 { |
746 HTMLConstructionSiteTask task(HTMLConstructionSiteTask::Insert); | 747 HTMLConstructionSiteTask task(HTMLConstructionSiteTask::Insert); |
747 findFosterSite(task); | 748 findFosterSite(task); |
748 task.child = node; | 749 task.child = node; |
749 ASSERT(task.parent); | 750 ASSERT(task.parent); |
750 | 751 |
751 m_taskQueue.append(task); | 752 m_taskQueue.append(task); |
752 } | 753 } |
753 | 754 |
754 } | 755 } |
OLD | NEW |