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

Unified Diff: Source/core/html/parser/HTMLConstructionSite.cpp

Issue 1007523003: Supress script during parser adjusting DOM node location (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/fast/dom/parser-adjust-parent-crash-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/parser/HTMLConstructionSite.cpp
diff --git a/Source/core/html/parser/HTMLConstructionSite.cpp b/Source/core/html/parser/HTMLConstructionSite.cpp
index ab3531b54c68b07acc7ed447a6bba22fa4b4532d..62ffde324b2a51f2c5a1382e60d775a240fc67ec 100644
--- a/Source/core/html/parser/HTMLConstructionSite.cpp
+++ b/Source/core/html/parser/HTMLConstructionSite.cpp
@@ -50,6 +50,7 @@
#include "core/loader/FrameLoaderClient.h"
#include "core/svg/SVGScriptElement.h"
#include "platform/NotImplemented.h"
+#include "platform/ScriptForbiddenScope.h"
#include "platform/text/TextBreakIterator.h"
#include <limits>
@@ -102,8 +103,10 @@ static inline void insert(HTMLConstructionSiteTask& task)
if (isHTMLTemplateElement(*task.parent))
task.parent = toHTMLTemplateElement(task.parent.get())->content();
- if (ContainerNode* parent = task.child->parentNode())
+ if (ContainerNode* parent = task.child->parentNode()) {
+ ScriptForbiddenScope forbidScript;
parent->parserRemoveChild(*task.child);
+ }
if (task.nextChild)
task.parent->parserInsertBefore(task.child.get(), *task.nextChild);
@@ -150,8 +153,10 @@ static inline void executeReparentTask(HTMLConstructionSiteTask& task)
{
ASSERT(task.operation == HTMLConstructionSiteTask::Reparent);
- if (ContainerNode* parent = task.child->parentNode())
+ if (ContainerNode* parent = task.child->parentNode()) {
+ ScriptForbiddenScope forbidScript;
parent->parserRemoveChild(*task.child);
+ }
task.parent->parserAppendChild(task.child);
}
« no previous file with comments | « LayoutTests/fast/dom/parser-adjust-parent-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698