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

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

Issue 2723793002: De-Element ScriptLoader (Closed)
Patch Set: De-Element ScriptLoader Created 3 years, 9 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
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 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 flushPendingText(FlushAlways); 281 flushPendingText(FlushAlways);
282 ASSERT(m_pendingText.isEmpty()); 282 ASSERT(m_pendingText.isEmpty());
283 m_taskQueue.push_back(task); 283 m_taskQueue.push_back(task);
284 } 284 }
285 285
286 void HTMLConstructionSite::attachLater(ContainerNode* parent, 286 void HTMLConstructionSite::attachLater(ContainerNode* parent,
287 Node* child, 287 Node* child,
288 bool selfClosing) { 288 bool selfClosing) {
289 ASSERT(scriptingContentIsAllowed(m_parserContentPolicy) || 289 ASSERT(scriptingContentIsAllowed(m_parserContentPolicy) ||
290 !child->isElementNode() || 290 !child->isElementNode() ||
291 !toScriptLoaderIfPossible(toElement(child))); 291 !ScriptLoaderClient::fromElementIfPossible(toElement(child)));
hiroshige 2017/03/01 00:58:14 Same as HTMLOptionElement.cpp.
Nate Chapin 2017/03/01 21:34:59 Done.
292 ASSERT(pluginContentIsAllowed(m_parserContentPolicy) || 292 ASSERT(pluginContentIsAllowed(m_parserContentPolicy) ||
293 !isHTMLPlugInElement(child)); 293 !isHTMLPlugInElement(child));
294 294
295 HTMLConstructionSiteTask task(HTMLConstructionSiteTask::Insert); 295 HTMLConstructionSiteTask task(HTMLConstructionSiteTask::Insert);
296 task.parent = parent; 296 task.parent = parent;
297 task.child = child; 297 task.child = child;
298 task.selfClosing = selfClosing; 298 task.selfClosing = selfClosing;
299 299
300 if (shouldFosterParent()) { 300 if (shouldFosterParent()) {
301 fosterParent(task.child); 301 fosterParent(task.child);
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after
751 751
752 void HTMLConstructionSite::insertForeignElement( 752 void HTMLConstructionSite::insertForeignElement(
753 AtomicHTMLToken* token, 753 AtomicHTMLToken* token,
754 const AtomicString& namespaceURI) { 754 const AtomicString& namespaceURI) {
755 ASSERT(token->type() == HTMLToken::StartTag); 755 ASSERT(token->type() == HTMLToken::StartTag);
756 // parseError when xmlns or xmlns:xlink are wrong. 756 // parseError when xmlns or xmlns:xlink are wrong.
757 DVLOG(1) << "Not implemented."; 757 DVLOG(1) << "Not implemented.";
758 758
759 Element* element = createElement(token, namespaceURI); 759 Element* element = createElement(token, namespaceURI);
760 if (scriptingContentIsAllowed(m_parserContentPolicy) || 760 if (scriptingContentIsAllowed(m_parserContentPolicy) ||
761 !toScriptLoaderIfPossible(element)) 761 !ScriptLoaderClient::fromElementIfPossible(element)) {
hiroshige 2017/03/01 00:58:15 ditto.
Nate Chapin 2017/03/01 21:34:59 Done.
762 attachLater(currentNode(), element, token->selfClosing()); 762 attachLater(currentNode(), element, token->selfClosing());
763 }
763 if (!token->selfClosing()) 764 if (!token->selfClosing())
764 m_openElements.push(HTMLStackItem::create(element, token, namespaceURI)); 765 m_openElements.push(HTMLStackItem::create(element, token, namespaceURI));
765 } 766 }
766 767
767 void HTMLConstructionSite::insertTextNode(const StringView& string, 768 void HTMLConstructionSite::insertTextNode(const StringView& string,
768 WhitespaceMode whitespaceMode) { 769 WhitespaceMode whitespaceMode) {
769 HTMLConstructionSiteTask dummyTask(HTMLConstructionSiteTask::Insert); 770 HTMLConstructionSiteTask dummyTask(HTMLConstructionSiteTask::Insert);
770 dummyTask.parent = currentNode(); 771 dummyTask.parent = currentNode();
771 772
772 if (shouldFosterParent()) 773 if (shouldFosterParent())
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
1074 ASSERT(task.parent); 1075 ASSERT(task.parent);
1075 queueTask(task); 1076 queueTask(task);
1076 } 1077 }
1077 1078
1078 DEFINE_TRACE(HTMLConstructionSite::PendingText) { 1079 DEFINE_TRACE(HTMLConstructionSite::PendingText) {
1079 visitor->trace(parent); 1080 visitor->trace(parent);
1080 visitor->trace(nextChild); 1081 visitor->trace(nextChild);
1081 } 1082 }
1082 1083
1083 } // namespace blink 1084 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698