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

Unified Diff: third_party/WebKit/Source/core/html/HTMLOptionElement.cpp

Issue 2891723002: Do not create child node for Option constructor with no arguments/undefined text (Closed)
Patch Set: Created 3 years, 7 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 | « third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/the-option-element/option-element-constructor.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/html/HTMLOptionElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLOptionElement.cpp b/third_party/WebKit/Source/core/html/HTMLOptionElement.cpp
index 218ea266c83254a97530a771d2684d4d49b9f96d..7c0eb3c87b142b662cbde98b03eec9f0bacb676c 100644
--- a/third_party/WebKit/Source/core/html/HTMLOptionElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLOptionElement.cpp
@@ -72,8 +72,8 @@ HTMLOptionElement* HTMLOptionElement::CreateForJSConstructor(
ExceptionState& exception_state) {
HTMLOptionElement* element = new HTMLOptionElement(document);
element->EnsureUserAgentShadowRoot();
- element->AppendChild(Text::Create(document, data.IsNull() ? "" : data),
- exception_state);
+ if (!data.IsNull())
foolip 2017/05/17 11:23:12 The spec says "If text is not the empty string, th
Shanmuga Pandi 2017/05/17 11:29:35 I understood. I will wait for the automatic import
+ element->AppendChild(Text::Create(document, data), exception_state);
if (exception_state.HadException())
return nullptr;
« no previous file with comments | « third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/the-option-element/option-element-constructor.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698