Commit a02b1947 authored by eric@webkit.org's avatar eric@webkit.org

2009-04-21 Dave Moore <davemoore@google.com> and Eric Seidel <eric@webkit.org>

        Reviewed by Darin Adler.

        Add test for (as of yet not implemented) HTML5 named option access.
        https://bugs.webkit.org/show_bug.cgi?id=25191

        I believe this will require separate implementations
        for V8 and JSC the way our current bindings are designed.

        * fast/dom/HTMLSelectElement/named-options-expected.txt: Added.
        * fast/dom/HTMLSelectElement/named-options.html: Added.
        * fast/dom/HTMLSelectElement/resources/TEMPLATE.html: Copied from LayoutTests/fast/dom/CSSStyleDeclaration/resources/TEMPLATE.html.
        * fast/dom/HTMLSelectElement/resources/named-options.js: Added.

git-svn-id: svn://svn.chromium.org/blink/trunk@42716 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 36411e5a
2009-04-21 Dave Moore <davemoore@google.com> and Eric Seidel <eric@webkit.org>
Reviewed by Darin Adler.
Add test for (as of yet not implemented) HTML5 named option access.
https://bugs.webkit.org/show_bug.cgi?id=25191
I believe this will require separate implementations
for V8 and JSC the way our current bindings are designed.
* fast/dom/HTMLSelectElement/named-options-expected.txt: Added.
* fast/dom/HTMLSelectElement/named-options.html: Added.
* fast/dom/HTMLSelectElement/resources/TEMPLATE.html: Copied from LayoutTests/fast/dom/CSSStyleDeclaration/resources/TEMPLATE.html.
* fast/dom/HTMLSelectElement/resources/named-options.js: Added.
2009-04-21 Chris Fleizach <cfleizach@apple.com>
Reviewed by Darin Adler.
......
This tests that options elements are accessible by name from both a select element and the options collection, per HTML5.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
Confirm that the option named 'test' is accessible from the select element
FAIL select1.test.toString() should be [object HTMLOptionElement]. Threw exception TypeError: Result of expression 'select1.test' [undefined] is not an object.
FAIL select1.test.value should be Value. Threw exception TypeError: Result of expression 'select1.test' [undefined] is not an object.
Confirm that the option named 'test' is accessible from the options collection
PASS select1.options.test.toString() is "[object HTMLOptionElement]"
PASS select1.options.test.value is "Value"
Confirm that both options named 'test' are accessible from the select element
FAIL select2.test.length should be 2. Threw exception TypeError: Result of expression 'select2.test' [undefined] is not an object.
FAIL select2.test.toString() should be [object Collection]. Threw exception TypeError: Result of expression 'select2.test' [undefined] is not an object.
FAIL select2.test[0].value should be Value1. Threw exception TypeError: Result of expression 'select2.test' [undefined] is not an object.
FAIL select2.test[1].value should be Value2. Threw exception TypeError: Result of expression 'select2.test' [undefined] is not an object.
Confirm that both options named 'test' are accessible from the options collection
PASS select2.options.test.length is 2
PASS select2.options.test.toString() is "[object Collection]"
PASS select2.options.test[0].value is "Value1"
PASS select2.options.test[1].value is "Value2"
PASS successfullyParsed is true
TEST COMPLETE
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<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>
<script src="resources/named-options.js"></script>
<script src="../../js/resources/js-test-post.js"></script>
</body>
</html>
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<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>
<script src="YOUR_JS_FILE_HERE"></script>
<script src="../../js/resources/js-test-post.js"></script>
</body>
</html>
description("This tests that options elements are accessible by name from both a select element and the options collection, per HTML5.");
var select1 = document.createElement("select");
document.body.appendChild(select1);
select1.innerHTML = '<option value="Value" name="test">';
var select2 = document.createElement("select");
document.body.appendChild(select2);
select2.innerHTML = '<option value="Value1" name="test"><option value="Value2" name="test">';
debug("Confirm that the option named 'test' is accessible from the select element");
shouldBeEqualToString("select1.test.toString()", "[object HTMLOptionElement]");
shouldBeEqualToString("select1.test.value", "Value");
debug("Confirm that the option named 'test' is accessible from the options collection");
shouldBeEqualToString("select1.options.test.toString()", "[object HTMLOptionElement]");
shouldBeEqualToString("select1.options.test.value", "Value");
debug("Confirm that both options named 'test' are accessible from the select element");
shouldBe("select2.test.length", "2");
shouldBeEqualToString("select2.test.toString()", "[object Collection]");
shouldBeEqualToString("select2.test[0].value", "Value1");
shouldBeEqualToString("select2.test[1].value", "Value2");
debug("Confirm that both options named 'test' are accessible from the options collection");
shouldBe("select2.options.test.length", "2");
shouldBeEqualToString("select2.options.test.toString()", "[object Collection]");
shouldBeEqualToString("select2.options.test[0].value", "Value1");
shouldBeEqualToString("select2.options.test[1].value", "Value2");
// Clean up after ourselves
document.body.removeChild(select1);
document.body.removeChild(select2);
successfullyParsed = true;
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