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

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

Issue 2592333002: Push-pop custom elements reaction stack when the parser inserts elements (Closed)
Patch Set: Created 3 years, 12 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
« no previous file with comments | « third_party/WebKit/LayoutTests/custom-elements/spec/parsing.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/custom-elements/spec/parsing.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698