| 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 } | 96 } |
| 97 | 97 |
| 98 static inline bool isAllWhitespace(const String& string) { | 98 static inline bool isAllWhitespace(const String& string) { |
| 99 return string.isAllSpecialCharacters<isHTMLSpace<UChar>>(); | 99 return string.isAllSpecialCharacters<isHTMLSpace<UChar>>(); |
| 100 } | 100 } |
| 101 | 101 |
| 102 static inline void insert(HTMLConstructionSiteTask& task) { | 102 static inline void insert(HTMLConstructionSiteTask& task) { |
| 103 if (isHTMLTemplateElement(*task.parent)) | 103 if (isHTMLTemplateElement(*task.parent)) |
| 104 task.parent = toHTMLTemplateElement(task.parent.get())->content(); | 104 task.parent = toHTMLTemplateElement(task.parent.get())->content(); |
| 105 | 105 |
| 106 // https://html.spec.whatwg.org/#insert-a-foreign-element |
| 107 // 3.1, (3) Push (pop) an element queue |
| 108 CEReactionsScope reactions; |
| 106 if (task.nextChild) | 109 if (task.nextChild) |
| 107 task.parent->parserInsertBefore(task.child.get(), *task.nextChild); | 110 task.parent->parserInsertBefore(task.child.get(), *task.nextChild); |
| 108 else | 111 else |
| 109 task.parent->parserAppendChild(task.child.get()); | 112 task.parent->parserAppendChild(task.child.get()); |
| 110 } | 113 } |
| 111 | 114 |
| 112 static inline void executeInsertTask(HTMLConstructionSiteTask& task) { | 115 static inline void executeInsertTask(HTMLConstructionSiteTask& task) { |
| 113 ASSERT(task.operation == HTMLConstructionSiteTask::Insert); | 116 ASSERT(task.operation == HTMLConstructionSiteTask::Insert); |
| 114 | 117 |
| 115 insert(task); | 118 insert(task); |
| (...skipping 955 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1071 ASSERT(task.parent); | 1074 ASSERT(task.parent); |
| 1072 queueTask(task); | 1075 queueTask(task); |
| 1073 } | 1076 } |
| 1074 | 1077 |
| 1075 DEFINE_TRACE(HTMLConstructionSite::PendingText) { | 1078 DEFINE_TRACE(HTMLConstructionSite::PendingText) { |
| 1076 visitor->trace(parent); | 1079 visitor->trace(parent); |
| 1077 visitor->trace(nextChild); | 1080 visitor->trace(nextChild); |
| 1078 } | 1081 } |
| 1079 | 1082 |
| 1080 } // namespace blink | 1083 } // namespace blink |
| OLD | NEW |