<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[183589] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/183589">183589</a></dd>
<dt>Author</dt> <dd>joepeck@webkit.org</dd>
<dt>Date</dt> <dd>2015-04-29 16:22:39 -0700 (Wed, 29 Apr 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>NodeList has issues with Symbol and empty string
https://bugs.webkit.org/show_bug.cgi?id=144310

Reviewed by Darin Adler.

Source/JavaScriptCore:

* runtime/PropertyName.h:
(JSC::PropertyName::isSymbol):
Helper to check if the PropertyName is a string or symbol property.

Source/WebCore:

Tests: fast/dom/StyleSheet/stylesheet-symbol-names.html
       fast/dom/dataset-name-getter-symbols.html
       fast/dom/named-items-with-empty-name.html
       fast/dom/named-items-with-symbol-name.html
       storage/domstorage/localstorage/named-items.html

Test different bindings objects with custom named setter
and getter handlers. Ensure that they handle Symbol properties
gracefully. Often times avoiding the string path.

* dom/StaticNodeList.cpp:
(WebCore::StaticNodeList::namedItem):
(WebCore::StaticElementList::namedItem):
Better handle the empty string. It should not match an item.

* bindings/js/JSDOMBinding.h:
(WebCore::propertyNameToString):
In cases where we would use this, we should have handled
Symbol properties.

(WebCore::propertyNameToAtomicString):
For Symbols, use the unique string. This should result
in no matches for a Symbol property.

* bindings/js/JSDOMStringMapCustom.cpp:
(WebCore::JSDOMStringMap::getOwnPropertySlotDelegate):
(WebCore::JSDOMStringMap::deleteProperty):
(WebCore::JSDOMStringMap::putDelegate):
* bindings/js/JSStorageCustom.cpp:
(WebCore::JSStorage::canGetItemsForName):
(WebCore::JSStorage::nameGetter):
(WebCore::JSStorage::deleteProperty):
(WebCore::JSStorage::putDelegate):
* bindings/js/JSStyleSheetListCustom.cpp:
(WebCore::JSStyleSheetList::canGetItemsForName):
Treat Symbol properties as private properties. They just
go directly through to the Object, and avoid the string
getter/setter property path.

LayoutTests:

* fast/dom/StyleSheet/stylesheet-symbol-names-expected.txt: Added.
* fast/dom/StyleSheet/stylesheet-symbol-names.html: Added.
* fast/dom/dataset-name-getter-symbols-expected.txt: Added.
* fast/dom/dataset-name-getter-symbols.html: Added.
* fast/dom/named-items-with-empty-name-expected.txt: Added.
* fast/dom/named-items-with-empty-name.html: Added.
* fast/dom/named-items-with-symbol-name-expected.txt: Added.
* fast/dom/named-items-with-symbol-name.html: Added.
* storage/domstorage/localstorage/named-items-expected.txt: Added.
* storage/domstorage/localstorage/named-items.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimePropertyNameh">trunk/Source/JavaScriptCore/runtime/PropertyName.h</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMBindingh">trunk/Source/WebCore/bindings/js/JSDOMBinding.h</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMStringMapCustomcpp">trunk/Source/WebCore/bindings/js/JSDOMStringMapCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSStorageCustomcpp">trunk/Source/WebCore/bindings/js/JSStorageCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSStyleSheetListCustomcpp">trunk/Source/WebCore/bindings/js/JSStyleSheetListCustom.cpp</a></li>
<li><a href="#trunkSourceWebCoredomStaticNodeListcpp">trunk/Source/WebCore/dom/StaticNodeList.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastdomStyleSheetstylesheetsymbolnamesexpectedtxt">trunk/LayoutTests/fast/dom/StyleSheet/stylesheet-symbol-names-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomStyleSheetstylesheetsymbolnameshtml">trunk/LayoutTests/fast/dom/StyleSheet/stylesheet-symbol-names.html</a></li>
<li><a href="#trunkLayoutTestsfastdomdatasetnamegettersymbolsexpectedtxt">trunk/LayoutTests/fast/dom/dataset-name-getter-symbols-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomdatasetnamegettersymbolshtml">trunk/LayoutTests/fast/dom/dataset-name-getter-symbols.html</a></li>
<li><a href="#trunkLayoutTestsfastdomnameditemswithemptynameexpectedtxt">trunk/LayoutTests/fast/dom/named-items-with-empty-name-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomnameditemswithemptynamehtml">trunk/LayoutTests/fast/dom/named-items-with-empty-name.html</a></li>
<li><a href="#trunkLayoutTestsfastdomnameditemswithsymbolnameexpectedtxt">trunk/LayoutTests/fast/dom/named-items-with-symbol-name-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomnameditemswithsymbolnamehtml">trunk/LayoutTests/fast/dom/named-items-with-symbol-name.html</a></li>
<li><a href="#trunkLayoutTestsstoragedomstoragelocalstoragenameditemsexpectedtxt">trunk/LayoutTests/storage/domstorage/localstorage/named-items-expected.txt</a></li>
<li><a href="#trunkLayoutTestsstoragedomstoragelocalstoragenameditemshtml">trunk/LayoutTests/storage/domstorage/localstorage/named-items.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (183588 => 183589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-04-29 23:19:00 UTC (rev 183588)
+++ trunk/LayoutTests/ChangeLog        2015-04-29 23:22:39 UTC (rev 183589)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2015-04-29  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        NodeList has issues with Symbol and empty string
+        https://bugs.webkit.org/show_bug.cgi?id=144310
+
+        Reviewed by Darin Adler.
+
+        * fast/dom/StyleSheet/stylesheet-symbol-names-expected.txt: Added.
+        * fast/dom/StyleSheet/stylesheet-symbol-names.html: Added.
+        * fast/dom/dataset-name-getter-symbols-expected.txt: Added.
+        * fast/dom/dataset-name-getter-symbols.html: Added.
+        * fast/dom/named-items-with-empty-name-expected.txt: Added.
+        * fast/dom/named-items-with-empty-name.html: Added.
+        * fast/dom/named-items-with-symbol-name-expected.txt: Added.
+        * fast/dom/named-items-with-symbol-name.html: Added.
+        * storage/domstorage/localstorage/named-items-expected.txt: Added.
+        * storage/domstorage/localstorage/named-items.html: Added.
+
</ins><span class="cx"> 2015-04-29  Simon Fraser  &lt;simon.fraser@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Allow testing of plug-ins that handle wheel events.
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomStyleSheetstylesheetsymbolnamesexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/StyleSheet/stylesheet-symbol-names-expected.txt (0 => 183589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/StyleSheet/stylesheet-symbol-names-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/dom/StyleSheet/stylesheet-symbol-names-expected.txt        2015-04-29 23:22:39 UTC (rev 183589)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+This tests document.styelSheets with Symbol property names.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS document.styleSheets.length is 3
+PASS document.styleSheets[''] is undefined
+PASS document.styleSheets['test'] is styleElement2.sheet
+PASS document.styleSheets[Symbol()] is undefined
+PASS delete document.styleSheets['test'] did not throw exception.
+PASS delete document.styleSheets[Symbol()] did not throw exception.
+PASS document.styleSheets.length is 3
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomStyleSheetstylesheetsymbolnameshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/StyleSheet/stylesheet-symbol-names.html (0 => 183589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/StyleSheet/stylesheet-symbol-names.html                                (rev 0)
+++ trunk/LayoutTests/fast/dom/StyleSheet/stylesheet-symbol-names.html        2015-04-29 23:22:39 UTC (rev 183589)
</span><span class="lines">@@ -0,0 +1,29 @@
</span><ins>+&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script&gt;
+description(&quot;This tests document.styelSheets with Symbol property names.&quot;);
+
+styleElement1 = document.createElement(&quot;style&quot;);
+styleElement1.setAttribute(&quot;id&quot;, &quot;&quot;);
+document.head.appendChild(styleElement1);
+
+styleElement2 = document.createElement(&quot;style&quot;);
+styleElement2.setAttribute(&quot;id&quot;, &quot;test&quot;);
+document.head.appendChild(styleElement2);
+
+shouldBe(&quot;document.styleSheets.length&quot;, &quot;3&quot;);
+shouldBe(&quot;document.styleSheets['']&quot;, &quot;undefined&quot;);
+shouldBe(&quot;document.styleSheets['test']&quot;, &quot;styleElement2.sheet&quot;);
+shouldBe(&quot;document.styleSheets[Symbol()]&quot;, &quot;undefined&quot;);
+shouldNotThrow(&quot;delete document.styleSheets['test']&quot;);
+shouldNotThrow(&quot;delete document.styleSheets[Symbol()]&quot;);
+shouldBe(&quot;document.styleSheets.length&quot;, &quot;3&quot;);
+
+&lt;/script&gt;
+&lt;script src=&quot;../../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomdatasetnamegettersymbolsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/dataset-name-getter-symbols-expected.txt (0 => 183589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/dataset-name-getter-symbols-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/dom/dataset-name-getter-symbols-expected.txt        2015-04-29 23:22:39 UTC (rev 183589)
</span><span class="lines">@@ -0,0 +1,22 @@
</span><ins>+Test the name getters on DOMStringMap (dataset).
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS document.body.dataset.webkitRocks === 'yes' is true
+PASS Object.keys(document.body.dataset).length === 1 is true
+PASS document.body.dataset[''] = 'test' did not throw exception.
+PASS document.body.dataset[''] === 'test' is true
+PASS document.body.dataset[Symbol()] === undefined is true
+PASS Object.keys(document.body.dataset).length === 2 is true
+PASS document.body.dataset[knownSymbol] === undefined is true
+PASS Object.keys(document.body.dataset).length === 2 is true
+PASS document.body.dataset[knownSymbol] = 'symbol property' did not throw exception.
+PASS document.body.dataset[knownSymbol] === 'symbol property' is true
+PASS delete document.body.dataset[knownSymbol] is true
+PASS document.body.dataset[knownSymbol] === undefined is true
+PASS Object.keys(document.body.dataset).length === 2 is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomdatasetnamegettersymbolshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/dataset-name-getter-symbols.html (0 => 183589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/dataset-name-getter-symbols.html                                (rev 0)
+++ trunk/LayoutTests/fast/dom/dataset-name-getter-symbols.html        2015-04-29 23:22:39 UTC (rev 183589)
</span><span class="lines">@@ -0,0 +1,30 @@
</span><ins>+&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body data-webkit-rocks=yes&gt;
+&lt;script&gt;
+description('Test the name getters on DOMStringMap (dataset).');
+
+knownSymbol = Symbol();
+
+shouldBeTrue(&quot;document.body.dataset.webkitRocks === 'yes'&quot;);
+shouldBeTrue(&quot;Object.keys(document.body.dataset).length === 1&quot;);
+
+shouldNotThrow(&quot;document.body.dataset[''] = 'test'&quot;);
+shouldBeTrue(&quot;document.body.dataset[''] === 'test'&quot;);
+shouldBeTrue(&quot;document.body.dataset[Symbol()] === undefined&quot;);
+shouldBeTrue(&quot;Object.keys(document.body.dataset).length === 2&quot;);
+
+shouldBeTrue(&quot;document.body.dataset[knownSymbol] === undefined&quot;);
+shouldBeTrue(&quot;Object.keys(document.body.dataset).length === 2&quot;);
+shouldNotThrow(&quot;document.body.dataset[knownSymbol] = 'symbol property'&quot;);
+shouldBeTrue(&quot;document.body.dataset[knownSymbol] === 'symbol property'&quot;);
+shouldBeTrue(&quot;delete document.body.dataset[knownSymbol]&quot;);
+shouldBeTrue(&quot;document.body.dataset[knownSymbol] === undefined&quot;);
+shouldBeTrue(&quot;Object.keys(document.body.dataset).length === 2&quot;);
+&lt;/script&gt;
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomnameditemswithemptynameexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/named-items-with-empty-name-expected.txt (0 => 183589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/named-items-with-empty-name-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/dom/named-items-with-empty-name-expected.txt        2015-04-29 23:22:39 UTC (rev 183589)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+This tests empty strings do not return a value in collections or named items cases.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS document.querySelectorAll('div')[''] === undefined is true
+PASS document.getElementsByTagName('div')[''] === undefined is true
+PASS document.body.children[''] === undefined is true
+PASS document.all[''] === undefined is true
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomnameditemswithemptynamehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/named-items-with-empty-name.html (0 => 183589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/named-items-with-empty-name.html                                (rev 0)
+++ trunk/LayoutTests/fast/dom/named-items-with-empty-name.html        2015-04-29 23:22:39 UTC (rev 183589)
</span><span class="lines">@@ -0,0 +1,20 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;p id=&quot;description&quot;&gt;&lt;/p&gt;
+&lt;div id=&quot;console&quot;&gt;&lt;/div&gt;
+&lt;div id=&quot;&quot;&gt;&lt;/div&gt;
+    
+&lt;script&gt;
+description('This tests empty strings do not return a value in collections or named items cases.');
+
+shouldBeTrue(&quot;document.querySelectorAll('div')[''] === undefined&quot;);
+shouldBeTrue(&quot;document.getElementsByTagName('div')[''] === undefined&quot;);
+shouldBeTrue(&quot;document.body.children[''] === undefined&quot;);
+shouldBeTrue(&quot;document.all[''] === undefined&quot;);
+&lt;/script&gt;
+&lt;script src=&quot;../../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomnameditemswithsymbolnameexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/named-items-with-symbol-name-expected.txt (0 => 183589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/named-items-with-symbol-name-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/dom/named-items-with-symbol-name-expected.txt        2015-04-29 23:22:39 UTC (rev 183589)
</span><span class="lines">@@ -0,0 +1,42 @@
</span><ins>+This tests Symbol property names with a number of named items collections.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+[object NodeList]
+PASS querySelectorAllList.length === 4 is true
+PASS querySelectorAllList[Symbol()] === undefined is true
+PASS querySelectorAllList[Symbol('div')] === undefined is true
+PASS querySelectorAllList['Symbol(div)'] instanceof HTMLDivElement is true
+
+[object NodeList]
+PASS getElementsByTagNameList.length === 4 is true
+PASS getElementsByTagNameList[Symbol()] === undefined is true
+PASS getElementsByTagNameList[Symbol('div')] === undefined is true
+PASS getElementsByTagNameList['Symbol(div)'] instanceof HTMLDivElement is true
+
+[object Window]
+PASS window[Symbol()] === undefined is true
+PASS window[Symbol('div')] === undefined is true
+PASS window['Symbol(div)'] instanceof HTMLDivElement is true
+
+[object HTMLCollection]
+PASS document.images.length === 3 is true
+PASS document.images[Symbol()] === undefined is true
+PASS document.images[Symbol('img')] === undefined is true
+PASS document.images['Symbol(img)'] instanceof HTMLImageElement is true
+
+[object HTMLAllCollection]
+PASS document.all.length &gt; 10 is true
+PASS document.all[Symbol()] === undefined is true
+PASS document.all[Symbol('div')] === undefined is true
+PASS document.all['Symbol(div)'] instanceof HTMLDivElement is true
+
+[object HTMLCollection]
+PASS document.forms[Symbol()] === undefined is true
+
+[object HTMLFormElement]
+PASS document.forms[0][Symbol()] === undefined is true
+PASS document.forms[0][Symbol('input')] === undefined is true
+PASS document.forms[0]['Symbol(input)'] instanceof HTMLInputElement is true
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomnameditemswithsymbolnamehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/named-items-with-symbol-name.html (0 => 183589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/named-items-with-symbol-name.html                                (rev 0)
+++ trunk/LayoutTests/fast/dom/named-items-with-symbol-name.html        2015-04-29 23:22:39 UTC (rev 183589)
</span><span class="lines">@@ -0,0 +1,59 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;p id=&quot;description&quot;&gt;&lt;/p&gt;
+&lt;div id=&quot;console&quot;&gt;&lt;/div&gt;
+
+&lt;div style=&quot;display:none&quot;&gt;
+    &lt;div&gt;text1&lt;/div&gt;&lt;div id='Symbol(div)'&gt;text2&lt;/div&gt;
+    &lt;img&gt;&lt;img id=&quot;img&quot;&gt;&lt;img id=&quot;Symbol(img)&quot;&gt;
+    &lt;form&gt;&lt;input&gt;&lt;input name=&quot;input&quot;&gt;&lt;input name=&quot;Symbol(input)&quot;&gt;&lt;/form&gt;
+&lt;/div&gt;
+    
+&lt;script&gt;
+description('This tests Symbol property names with a number of named items collections.');
+
+var querySelectorAllList = document.querySelectorAll('div');
+debug(String(querySelectorAllList));
+shouldBeTrue(&quot;querySelectorAllList.length === 4&quot;);
+shouldBeTrue(&quot;querySelectorAllList[Symbol()] === undefined&quot;);
+shouldBeTrue(&quot;querySelectorAllList[Symbol('div')] === undefined&quot;);
+shouldBeTrue(&quot;querySelectorAllList['Symbol(div)'] instanceof HTMLDivElement&quot;);
+
+var getElementsByTagNameList = document.getElementsByTagName('div');
+debug(&quot;\n&quot; + String(getElementsByTagNameList));
+shouldBeTrue(&quot;getElementsByTagNameList.length === 4&quot;);
+shouldBeTrue(&quot;getElementsByTagNameList[Symbol()] === undefined&quot;);
+shouldBeTrue(&quot;getElementsByTagNameList[Symbol('div')] === undefined&quot;);
+shouldBeTrue(&quot;getElementsByTagNameList['Symbol(div)'] instanceof HTMLDivElement&quot;);
+
+debug(&quot;\n&quot; + String(window));
+shouldBeTrue(&quot;window[Symbol()] === undefined&quot;);
+shouldBeTrue(&quot;window[Symbol('div')] === undefined&quot;);
+shouldBeTrue(&quot;window['Symbol(div)'] instanceof HTMLDivElement&quot;);
+
+debug(&quot;\n&quot; + String(document.images));
+shouldBeTrue(&quot;document.images.length === 3&quot;);
+shouldBeTrue(&quot;document.images[Symbol()] === undefined&quot;);
+shouldBeTrue(&quot;document.images[Symbol('img')] === undefined&quot;);
+shouldBeTrue(&quot;document.images['Symbol(img)'] instanceof HTMLImageElement&quot;);
+
+debug(&quot;\n&quot; + String(document.all));
+shouldBeTrue(&quot;document.all.length &gt; 10&quot;);
+shouldBeTrue(&quot;document.all[Symbol()] === undefined&quot;);
+shouldBeTrue(&quot;document.all[Symbol('div')] === undefined&quot;);
+shouldBeTrue(&quot;document.all['Symbol(div)'] instanceof HTMLDivElement&quot;);
+
+debug(&quot;\n&quot; + String(document.forms));
+shouldBeTrue(&quot;document.forms[Symbol()] === undefined&quot;);
+
+debug(&quot;\n&quot; + String(document.forms[0]));
+shouldBeTrue(&quot;document.forms[0][Symbol()] === undefined&quot;);
+shouldBeTrue(&quot;document.forms[0][Symbol('input')] === undefined&quot;);
+shouldBeTrue(&quot;document.forms[0]['Symbol(input)'] instanceof HTMLInputElement&quot;);
+&lt;/script&gt;
+&lt;script src=&quot;../../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsstoragedomstoragelocalstoragenameditemsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/storage/domstorage/localstorage/named-items-expected.txt (0 => 183589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/domstorage/localstorage/named-items-expected.txt                                (rev 0)
+++ trunk/LayoutTests/storage/domstorage/localstorage/named-items-expected.txt        2015-04-29 23:22:39 UTC (rev 183589)
</span><span class="lines">@@ -0,0 +1,28 @@
</span><ins>+Tests storage with named item access and Symbol properties.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS localStorage.length === 0 is true
+PASS localStorage[Symbol()] === undefined is true
+PASS localStorage.length === 0 is true
+PASS localStorage[knownSymbol] === 2 is true
+PASS delete localStorage[knownSymbol] did not throw exception.
+PASS localStorage.length === 0 is true
+PASS localStorage[knownSymbol] === undefined is true
+PASS localStorage.length === 1 is true
+PASS localStorage['Symbol()'] === '3' is true
+PASS localStorage.key(0) === 'Symbol()' is true
+PASS localStorage[''] === undefined is true
+PASS localStorage[''] === '4' is true
+PASS localStorage.length === 2 is true
+PASS delete localStorage['Symbol()'] did not throw exception.
+PASS localStorage.length === 1 is true
+PASS localStorage['Symbol()'] === undefined is true
+PASS delete localStorage[''] did not throw exception.
+PASS localStorage.length === 0 is true
+PASS localStorage[''] === undefined is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsstoragedomstoragelocalstoragenameditemshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/storage/domstorage/localstorage/named-items.html (0 => 183589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/domstorage/localstorage/named-items.html                                (rev 0)
+++ trunk/LayoutTests/storage/domstorage/localstorage/named-items.html        2015-04-29 23:22:39 UTC (rev 183589)
</span><span class="lines">@@ -0,0 +1,43 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script&gt;
+description(&quot;Tests storage with named item access and Symbol properties.&quot;);
+
+knownSymbol = Symbol();
+localStorage.clear();
+
+localStorage[Symbol()] = 1;
+shouldBeTrue(&quot;localStorage.length === 0&quot;);
+shouldBeTrue(&quot;localStorage[Symbol()] === undefined&quot;);
+
+localStorage[knownSymbol] = 2;
+shouldBeTrue(&quot;localStorage.length === 0&quot;);
+shouldBeTrue(&quot;localStorage[knownSymbol] === 2&quot;); // number
+shouldNotThrow(&quot;delete localStorage[knownSymbol]&quot;);
+shouldBeTrue(&quot;localStorage.length === 0&quot;);
+shouldBeTrue(&quot;localStorage[knownSymbol] === undefined&quot;);
+
+localStorage[&quot;Symbol()&quot;] = 3;
+shouldBeTrue(&quot;localStorage.length === 1&quot;);
+shouldBeTrue(&quot;localStorage['Symbol()'] === '3'&quot;); // string
+shouldBeTrue(&quot;localStorage.key(0) === 'Symbol()'&quot;);
+
+shouldBeTrue(&quot;localStorage[''] === undefined&quot;);
+localStorage[''] = 4;
+shouldBeTrue(&quot;localStorage[''] === '4'&quot;); // string
+shouldBeTrue(&quot;localStorage.length === 2&quot;);
+
+shouldNotThrow(&quot;delete localStorage['Symbol()']&quot;);
+shouldBeTrue(&quot;localStorage.length === 1&quot;);
+shouldBeTrue(&quot;localStorage['Symbol()'] === undefined&quot;); // string
+
+shouldNotThrow(&quot;delete localStorage['']&quot;);
+shouldBeTrue(&quot;localStorage.length === 0&quot;);
+shouldBeTrue(&quot;localStorage[''] === undefined&quot;); // string
+&lt;/script&gt;
+&lt;script src=&quot;../../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (183588 => 183589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2015-04-29 23:19:00 UTC (rev 183588)
+++ trunk/Source/JavaScriptCore/ChangeLog        2015-04-29 23:22:39 UTC (rev 183589)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2015-04-29  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        NodeList has issues with Symbol and empty string
+        https://bugs.webkit.org/show_bug.cgi?id=144310
+
+        Reviewed by Darin Adler.
+
+        * runtime/PropertyName.h:
+        (JSC::PropertyName::isSymbol):
+        Helper to check if the PropertyName is a string or symbol property.
+
</ins><span class="cx"> 2015-04-29  Alex Christensen  &lt;achristensen@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Fix non-cygwin incremental builds on Windows.
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimePropertyNameh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/PropertyName.h (183588 => 183589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/PropertyName.h        2015-04-29 23:19:00 UTC (rev 183588)
+++ trunk/Source/JavaScriptCore/runtime/PropertyName.h        2015-04-29 23:22:39 UTC (rev 183589)
</span><span class="lines">@@ -52,6 +52,11 @@
</span><span class="cx">         ASSERT(m_impl-&gt;isSymbol());
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    bool isSymbol()
+    {
+        return m_impl &amp;&amp; m_impl-&gt;isSymbol();
+    }
+
</ins><span class="cx">     AtomicStringImpl* uid() const
</span><span class="cx">     {
</span><span class="cx">         return m_impl;
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (183588 => 183589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-04-29 23:19:00 UTC (rev 183588)
+++ trunk/Source/WebCore/ChangeLog        2015-04-29 23:22:39 UTC (rev 183589)
</span><span class="lines">@@ -1,3 +1,49 @@
</span><ins>+2015-04-29  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        NodeList has issues with Symbol and empty string
+        https://bugs.webkit.org/show_bug.cgi?id=144310
+
+        Reviewed by Darin Adler.
+
+        Tests: fast/dom/StyleSheet/stylesheet-symbol-names.html
+               fast/dom/dataset-name-getter-symbols.html
+               fast/dom/named-items-with-empty-name.html
+               fast/dom/named-items-with-symbol-name.html
+               storage/domstorage/localstorage/named-items.html
+
+        Test different bindings objects with custom named setter
+        and getter handlers. Ensure that they handle Symbol properties
+        gracefully. Often times avoiding the string path.
+
+        * dom/StaticNodeList.cpp:
+        (WebCore::StaticNodeList::namedItem):
+        (WebCore::StaticElementList::namedItem):
+        Better handle the empty string. It should not match an item.
+
+        * bindings/js/JSDOMBinding.h:
+        (WebCore::propertyNameToString):
+        In cases where we would use this, we should have handled
+        Symbol properties.
+
+        (WebCore::propertyNameToAtomicString):
+        For Symbols, use the unique string. This should result
+        in no matches for a Symbol property.
+
+        * bindings/js/JSDOMStringMapCustom.cpp:
+        (WebCore::JSDOMStringMap::getOwnPropertySlotDelegate):
+        (WebCore::JSDOMStringMap::deleteProperty):
+        (WebCore::JSDOMStringMap::putDelegate):
+        * bindings/js/JSStorageCustom.cpp:
+        (WebCore::JSStorage::canGetItemsForName):
+        (WebCore::JSStorage::nameGetter):
+        (WebCore::JSStorage::deleteProperty):
+        (WebCore::JSStorage::putDelegate):
+        * bindings/js/JSStyleSheetListCustom.cpp:
+        (WebCore::JSStyleSheetList::canGetItemsForName):
+        Treat Symbol properties as private properties. They just
+        go directly through to the Object, and avoid the string
+        getter/setter property path.
+
</ins><span class="cx"> 2015-04-29  Eric Carlson  &lt;eric.carlson@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Mac] Register with device picker whenever a page has &lt;video&gt;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMBindingh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMBinding.h (183588 => 183589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMBinding.h        2015-04-29 23:19:00 UTC (rev 183588)
+++ trunk/Source/WebCore/bindings/js/JSDOMBinding.h        2015-04-29 23:22:39 UTC (rev 183589)
</span><span class="lines">@@ -567,12 +567,13 @@
</span><span class="cx"> 
</span><span class="cx"> inline String propertyNameToString(JSC::PropertyName propertyName)
</span><span class="cx"> {
</span><del>-    return propertyName.publicName();
</del><ins>+    ASSERT(!propertyName.isSymbol());
+    return propertyName.uid() ? propertyName.uid() : propertyName.publicName();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> inline AtomicString propertyNameToAtomicString(JSC::PropertyName propertyName)
</span><span class="cx"> {
</span><del>-    return AtomicString(propertyName.publicName());
</del><ins>+    return AtomicString(propertyName.uid() ? propertyName.uid() : propertyName.publicName());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> template&lt;typename DOMClass&gt; inline const JSC::HashTableValue* getStaticValueSlotEntryWithoutCaching(JSC::ExecState* exec, JSC::PropertyName propertyName)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMStringMapCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMStringMapCustom.cpp (183588 => 183589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMStringMapCustom.cpp        2015-04-29 23:19:00 UTC (rev 183588)
+++ trunk/Source/WebCore/bindings/js/JSDOMStringMapCustom.cpp        2015-04-29 23:22:39 UTC (rev 183589)
</span><span class="lines">@@ -37,6 +37,8 @@
</span><span class="cx"> 
</span><span class="cx"> bool JSDOMStringMap::getOwnPropertySlotDelegate(ExecState* exec, PropertyName propertyName, PropertySlot&amp; slot)
</span><span class="cx"> {
</span><ins>+    if (propertyName.isSymbol())
+        return false;
</ins><span class="cx">     bool nameIsValid;
</span><span class="cx">     const AtomicString&amp; item = impl().item(propertyNameToString(propertyName), nameIsValid);
</span><span class="cx">     if (nameIsValid) {
</span><span class="lines">@@ -58,9 +60,11 @@
</span><span class="cx">     Base::getOwnPropertyNames(thisObject, exec, propertyNames, mode);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool JSDOMStringMap::deleteProperty(JSCell* cell, ExecState*, PropertyName propertyName)
</del><ins>+bool JSDOMStringMap::deleteProperty(JSCell* cell, ExecState* exec, PropertyName propertyName)
</ins><span class="cx"> {
</span><span class="cx">     JSDOMStringMap* thisObject = jsCast&lt;JSDOMStringMap*&gt;(cell);
</span><ins>+    if (propertyName.isSymbol())
+        return Base::deleteProperty(thisObject, exec, propertyName);
</ins><span class="cx">     return thisObject-&gt;m_impl-&gt;deleteItem(propertyNameToString(propertyName));
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -71,9 +75,13 @@
</span><span class="cx"> 
</span><span class="cx"> bool JSDOMStringMap::putDelegate(ExecState* exec, PropertyName propertyName, JSValue value, PutPropertySlot&amp;)
</span><span class="cx"> {
</span><ins>+    if (propertyName.isSymbol())
+        return false;
+
</ins><span class="cx">     String stringValue = value.toString(exec)-&gt;value(exec);
</span><span class="cx">     if (exec-&gt;hadException())
</span><span class="cx">         return false;
</span><ins>+
</ins><span class="cx">     ExceptionCode ec = 0;
</span><span class="cx">     impl().setItem(propertyNameToString(propertyName), stringValue, ec);
</span><span class="cx">     setDOMException(exec, ec);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSStorageCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSStorageCustom.cpp (183588 => 183589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSStorageCustom.cpp        2015-04-29 23:19:00 UTC (rev 183588)
+++ trunk/Source/WebCore/bindings/js/JSStorageCustom.cpp        2015-04-29 23:22:39 UTC (rev 183589)
</span><span class="lines">@@ -37,6 +37,9 @@
</span><span class="cx"> 
</span><span class="cx"> bool JSStorage::canGetItemsForName(ExecState* exec, Storage* impl, PropertyName propertyName)
</span><span class="cx"> {
</span><ins>+    if (propertyName.isSymbol())
+        return false;
+
</ins><span class="cx">     ExceptionCode ec = 0;
</span><span class="cx">     bool result = impl-&gt;contains(propertyNameToString(propertyName), ec);
</span><span class="cx">     setDOMException(exec, ec);
</span><span class="lines">@@ -51,6 +54,9 @@
</span><span class="cx">     if (prototype.isObject() &amp;&amp; asObject(prototype)-&gt;getPropertySlot(exec, propertyName, slot))
</span><span class="cx">         return JSValue::encode(slot.getValue(exec, propertyName));
</span><span class="cx"> 
</span><ins>+    if (propertyName.isSymbol())
+        return false;
+
</ins><span class="cx">     ExceptionCode ec = 0;
</span><span class="cx">     JSValue result = jsStringOrNull(exec, thisObject-&gt;impl().getItem(propertyNameToString(propertyName), ec));
</span><span class="cx">     setDOMException(exec, ec);
</span><span class="lines">@@ -65,12 +71,15 @@
</span><span class="cx">     // the native property slots manually.
</span><span class="cx">     PropertySlot slot(thisObject);
</span><span class="cx">     if (getStaticValueSlot&lt;JSStorage, Base&gt;(exec, *s_info.staticPropHashTable, thisObject, propertyName, slot))
</span><del>-        return false;
-        
</del><ins>+        return Base::deleteProperty(thisObject, exec, propertyName);
+
</ins><span class="cx">     JSValue prototype = thisObject-&gt;prototype();
</span><span class="cx">     if (prototype.isObject() &amp;&amp; asObject(prototype)-&gt;getPropertySlot(exec, propertyName, slot))
</span><del>-        return false;
</del><ins>+        return Base::deleteProperty(thisObject, exec, propertyName);
</ins><span class="cx"> 
</span><ins>+    if (propertyName.isSymbol())
+        return Base::deleteProperty(thisObject, exec, propertyName);
+
</ins><span class="cx">     ExceptionCode ec = 0;
</span><span class="cx">     thisObject-&gt;m_impl-&gt;removeItem(propertyNameToString(propertyName), ec);
</span><span class="cx">     setDOMException(exec, ec);
</span><span class="lines">@@ -113,10 +122,13 @@
</span><span class="cx">     if (prototype.isObject() &amp;&amp; asObject(prototype)-&gt;getPropertySlot(exec, propertyName, slot))
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><ins>+    if (propertyName.isSymbol())
+        return false;
+
</ins><span class="cx">     String stringValue = value.toString(exec)-&gt;value(exec);
</span><span class="cx">     if (exec-&gt;hadException())
</span><span class="cx">         return true;
</span><del>-    
</del><ins>+
</ins><span class="cx">     ExceptionCode ec = 0;
</span><span class="cx">     impl().setItem(propertyNameToString(propertyName), stringValue, ec);
</span><span class="cx">     setDOMException(exec, ec);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSStyleSheetListCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSStyleSheetListCustom.cpp (183588 => 183589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSStyleSheetListCustom.cpp        2015-04-29 23:19:00 UTC (rev 183588)
+++ trunk/Source/WebCore/bindings/js/JSStyleSheetListCustom.cpp        2015-04-29 23:22:39 UTC (rev 183589)
</span><span class="lines">@@ -37,6 +37,8 @@
</span><span class="cx"> 
</span><span class="cx"> bool JSStyleSheetList::canGetItemsForName(ExecState*, StyleSheetList* styleSheetList, PropertyName propertyName)
</span><span class="cx"> {
</span><ins>+    if (propertyName.isSymbol())
+        return false;
</ins><span class="cx">     return styleSheetList-&gt;getNamedItem(propertyNameToString(propertyName));
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoredomStaticNodeListcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/StaticNodeList.cpp (183588 => 183589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/StaticNodeList.cpp        2015-04-29 23:19:00 UTC (rev 183588)
+++ trunk/Source/WebCore/dom/StaticNodeList.cpp        2015-04-29 23:22:39 UTC (rev 183589)
</span><span class="lines">@@ -45,6 +45,8 @@
</span><span class="cx"> 
</span><span class="cx"> Node* StaticNodeList::namedItem(const AtomicString&amp; elementId) const
</span><span class="cx"> {
</span><ins>+    if (elementId.isEmpty())
+        return nullptr;
</ins><span class="cx">     for (unsigned i = 0, length = m_nodes.size(); i &lt; length; ++i) {
</span><span class="cx">         Node&amp; node = const_cast&lt;Node&amp;&gt;(m_nodes[i].get());
</span><span class="cx">         if (is&lt;Element&gt;(node) &amp;&amp; downcast&lt;Element&gt;(node).getIdAttribute() == elementId)
</span><span class="lines">@@ -67,6 +69,8 @@
</span><span class="cx"> 
</span><span class="cx"> Node* StaticElementList::namedItem(const AtomicString&amp; elementId) const
</span><span class="cx"> {
</span><ins>+    if (elementId.isEmpty())
+        return nullptr;
</ins><span class="cx">     for (unsigned i = 0, length = m_elements.size(); i &lt; length; ++i) {
</span><span class="cx">         Element&amp; element = const_cast&lt;Element&amp;&gt;(m_elements[i].get());
</span><span class="cx">         if (element.getIdAttribute() == elementId)
</span></span></pre>
</div>
</div>

</body>
</html>