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

Unified Diff: Source/core/html/HTMLScriptElement.cpp

Issue 1292503003: Setting empty script text should remove child node of script element (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updated as per review comments Created 5 years, 4 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/TestExpectations ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLScriptElement.cpp
diff --git a/Source/core/html/HTMLScriptElement.cpp b/Source/core/html/HTMLScriptElement.cpp
index 1b53647d8de808ab82193dec486b9394acb8cd0a..6bf842423a6bfa43d0bb4ef84448b90090364334 100644
--- a/Source/core/html/HTMLScriptElement.cpp
+++ b/Source/core/html/HTMLScriptElement.cpp
@@ -128,15 +128,7 @@ void HTMLScriptElement::didNotifySubtreeInsertionsToDocument()
void HTMLScriptElement::setText(const String &value)
{
- RefPtrWillBeRawPtr<Node> protectFromMutationEvents(this);
-
- if (hasOneTextChild()) {
- toText(firstChild())->setData(value);
- return;
- }
-
- removeChildren();
- appendChild(document().createTextNode(value.impl()), IGNORE_EXCEPTION);
+ setTextContent(value);
}
void HTMLScriptElement::setAsync(bool async)
« no previous file with comments | « LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698