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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 return !node->hasTagName(scriptTag) | 81 return !node->hasTagName(scriptTag) |
82 && !node->hasTagName(styleTag) | 82 && !node->hasTagName(styleTag) |
83 && !node->hasTagName(SVGNames::scriptTag); | 83 && !node->hasTagName(SVGNames::scriptTag); |
84 } | 84 } |
85 | 85 |
86 static inline bool isAllWhitespace(const String& string) | 86 static inline bool isAllWhitespace(const String& string) |
87 { | 87 { |
88 return string.isAllSpecialCharacters<isHTMLSpace>(); | 88 return string.isAllSpecialCharacters<isHTMLSpace>(); |
89 } | 89 } |
90 | 90 |
91 static inline void insert(HTMLConstructionSiteTask& task, AttachBehavior attachB
ehavior = AttachLazily) | 91 static inline void insert(HTMLConstructionSiteTask& task) |
92 { | 92 { |
93 if (task.parent->hasTagName(templateTag)) | 93 if (task.parent->hasTagName(templateTag)) |
94 task.parent = toHTMLTemplateElement(task.parent.get())->content(); | 94 task.parent = toHTMLTemplateElement(task.parent.get())->content(); |
95 | 95 |
96 if (ContainerNode* parent = task.child->parentNode()) | 96 if (ContainerNode* parent = task.child->parentNode()) |
97 parent->parserRemoveChild(task.child.get()); | 97 parent->parserRemoveChild(task.child.get()); |
98 | 98 |
99 if (task.nextChild) | 99 if (task.nextChild) |
100 task.parent->parserInsertBefore(task.child.get(), task.nextChild.get(),
attachBehavior); | 100 task.parent->parserInsertBefore(task.child.get(), task.nextChild.get()); |
101 else | 101 else |
102 task.parent->parserAppendChild(task.child.get(), attachBehavior); | 102 task.parent->parserAppendChild(task.child.get()); |
103 } | 103 } |
104 | 104 |
105 static inline void executeInsertTask(HTMLConstructionSiteTask& task) | 105 static inline void executeInsertTask(HTMLConstructionSiteTask& task) |
106 { | 106 { |
107 ASSERT(task.operation == HTMLConstructionSiteTask::Insert); | 107 ASSERT(task.operation == HTMLConstructionSiteTask::Insert); |
108 | 108 |
109 insert(task); | 109 insert(task); |
110 | 110 |
111 task.child->beginParsingChildren(); | 111 task.child->beginParsingChildren(); |
112 | 112 |
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
745 { | 745 { |
746 HTMLConstructionSiteTask task(HTMLConstructionSiteTask::Insert); | 746 HTMLConstructionSiteTask task(HTMLConstructionSiteTask::Insert); |
747 findFosterSite(task); | 747 findFosterSite(task); |
748 task.child = node; | 748 task.child = node; |
749 ASSERT(task.parent); | 749 ASSERT(task.parent); |
750 | 750 |
751 m_taskQueue.append(task); | 751 m_taskQueue.append(task); |
752 } | 752 } |
753 | 753 |
754 } | 754 } |
OLD | NEW |