| 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 static inline void insert(HTMLConstructionSiteTask& task) | 70 static inline void insert(HTMLConstructionSiteTask& task) |
| 71 { | 71 { |
| 72 if (isHTMLTemplateElement(*task.parent)) | 72 if (isHTMLTemplateElement(*task.parent)) |
| 73 task.parent = toHTMLTemplateElement(task.parent.get())->content(); | 73 task.parent = toHTMLTemplateElement(task.parent.get())->content(); |
| 74 task.parent->parserAppendChild(task.child.get()); | 74 task.parent->parserAppendChild(task.child.get()); |
| 75 } | 75 } |
| 76 | 76 |
| 77 static inline void executeInsertTask(HTMLConstructionSiteTask& task) | 77 static inline void executeInsertTask(HTMLConstructionSiteTask& task) |
| 78 { | 78 { |
| 79 ASSERT(task.operation == HTMLConstructionSiteTask::Insert); | 79 ASSERT(task.operation == HTMLConstructionSiteTask::Insert); |
| 80 | |
| 81 insert(task); | 80 insert(task); |
| 82 | |
| 83 if (task.child->isElementNode()) { | |
| 84 Element& child = toElement(*task.child); | |
| 85 if (task.selfClosing) | |
| 86 child.finishParsingChildren(); | |
| 87 } | |
| 88 } | 81 } |
| 89 | 82 |
| 90 static inline void executeInsertTextTask(HTMLConstructionSiteTask& task) | 83 static inline void executeInsertTextTask(HTMLConstructionSiteTask& task) |
| 91 { | 84 { |
| 92 ASSERT(task.operation == HTMLConstructionSiteTask::InsertText); | 85 ASSERT(task.operation == HTMLConstructionSiteTask::InsertText); |
| 93 ASSERT(task.child->isTextNode()); | 86 ASSERT(task.child->isTextNode()); |
| 94 | 87 |
| 95 // Merge text nodes into previous ones if possible: | 88 // Merge text nodes into previous ones if possible: |
| 96 // http://www.whatwg.org/specs/web-apps/current-work/multipage/tree-construc
tion.html#insert-a-character | 89 // http://www.whatwg.org/specs/web-apps/current-work/multipage/tree-construc
tion.html#insert-a-character |
| 97 Text* newText = toText(task.child.get()); | 90 Text* newText = toText(task.child.get()); |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 | 331 |
| 339 PassRefPtr<HTMLElement> HTMLConstructionSite::createHTMLElement(AtomicHTMLToken*
token) | 332 PassRefPtr<HTMLElement> HTMLConstructionSite::createHTMLElement(AtomicHTMLToken*
token) |
| 340 { | 333 { |
| 341 Document& document = ownerDocumentForCurrentNode(); | 334 Document& document = ownerDocumentForCurrentNode(); |
| 342 RefPtr<HTMLElement> element = HTMLElementFactory::createHTMLElement(token->n
ame(), document, true); | 335 RefPtr<HTMLElement> element = HTMLElementFactory::createHTMLElement(token->n
ame(), document, true); |
| 343 setAttributes(element.get(), token); | 336 setAttributes(element.get(), token); |
| 344 return element.release(); | 337 return element.release(); |
| 345 } | 338 } |
| 346 | 339 |
| 347 } | 340 } |
| OLD | NEW |