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

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: 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 | « no previous file | 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..e04e3e798671d5d153fb43748a95728ff34d3fbf 100644
--- a/Source/core/html/HTMLScriptElement.cpp
+++ b/Source/core/html/HTMLScriptElement.cpp
@@ -130,6 +130,11 @@ void HTMLScriptElement::setText(const String &value)
{
RefPtrWillBeRawPtr<Node> protectFromMutationEvents(this);
tkent 2015/08/19 00:11:26 Can we just call setTextContent(value), and add is
ramya.v 2015/08/19 08:08:42 Modified code to call setTextContent. isEmpty() ch
+ if (value.isEmpty()) {
+ removeChildren();
+ return;
+ }
+
if (hasOneTextChild()) {
toText(firstChild())->setData(value);
return;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698