Commit 1862c84e authored by eric@webkit.org's avatar eric@webkit.org
Browse files

2009-11-29 Shu Chang <Chang.Shu@nokia.com>

        Reviewed by Eric Seidel.

        Test using Id as index of node list.
        https://bugs.webkit.org/show_bug.cgi?id=31428

        * fast/dom/Element/id-in-node-list-index01-expected.txt: Added.
        * fast/dom/Element/id-in-node-list-index01.html: Added.
2009-11-29  Shu Chang  <Chang.Shu@nokia.com>

        Reviewed by Eric Seidel.

        Continue to search for matching node in the case where multiple nodes
        have the same id.
        https://bugs.webkit.org/show_bug.cgi?id=31428

        Test: fast/dom/Element/id-in-node-list-index01.html

        * dom/DynamicNodeList.cpp:
        (WebCore::DynamicNodeList::itemWithName):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51471 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent e25945e4
2009-11-29 Shu Chang <Chang.Shu@nokia.com>
Reviewed by Eric Seidel.
Test using Id as index of node list.
https://bugs.webkit.org/show_bug.cgi?id=31428
* fast/dom/Element/id-in-node-list-index01-expected.txt: Added.
* fast/dom/Element/id-in-node-list-index01.html: Added.
2009-11-28 Adam Barth <abarth@webkit.org> 2009-11-28 Adam Barth <abarth@webkit.org>
   
Reviewed by Dimitri Glazkov. Reviewed by Dimitri Glazkov.
Test using id as index of node list
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS elems["id1"].getAttribute("name") is "name1"
PASS elems["id2"].getAttribute("name") is "name2"
PASS successfullyParsed is true
TEST COMPLETE
<html>
<head>
<link rel="stylesheet" href="../../js/resources/js-test-style.css">
<script src="../../js/resources/js-test-pre.js"></script>
</head>
<body>
<p id="description"></p>
<div id="console"></div>
<div name='name1' id='id1'/>
<p name='name3' id='id2'/>
<div name='name2' id='id2'/>
<script>
description("Test using id as index of node list");
var elems = document.getElementsByTagName('div');
shouldBe('elems["id1"].getAttribute("name")', '"name1"');
shouldBe('elems["id2"].getAttribute("name")', '"name2"');
var successfullyParsed = true;
</script>
<script src="../../js/resources/js-test-post.js"></script>
</body>
</html>
2009-11-29 Shu Chang <Chang.Shu@nokia.com>
Reviewed by Eric Seidel.
Continue to search for matching node in the case where multiple nodes
have the same id.
https://bugs.webkit.org/show_bug.cgi?id=31428
Test: fast/dom/Element/id-in-node-list-index01.html
* dom/DynamicNodeList.cpp:
(WebCore::DynamicNodeList::itemWithName):
2009-11-29 Daniel Bates <dbates@webkit.org> 2009-11-29 Daniel Bates <dbates@webkit.org>
   
Reviewed by Eric Seidel. Reviewed by Eric Seidel.
...@@ -129,7 +129,9 @@ Node* DynamicNodeList::itemWithName(const AtomicString& elementId) const ...@@ -129,7 +129,9 @@ Node* DynamicNodeList::itemWithName(const AtomicString& elementId) const
return node; return node;
} }
} }
return 0; if (!node)
return 0;
// In the case of multiple nodes with the same name, just fall through.
} }
unsigned length = this->length(); unsigned length = this->length();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment