Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge r180530 - Default value of HTMLSelectElement size IDL attribute…
… should be 0. https://bugs.webkit.org/show_bug.cgi?id=141795 Reviewed by Andreas Kling. Source/WebCore: Default value of HTMLSelectElement size IDL attribute should be 0. As in spec: http://www.w3.org/html/wg/drafts/html/master/forms.html#the-select-element, also this matches the behavior of Chrome, IE and Gecko. Test: fast/dom/select-size.html * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::parseAttribute): LayoutTests: * fast/dom/select-size-expected.txt: Added. * fast/dom/select-size.html: Added.
- Loading branch information
1 parent
e1fbb97
commit 530e741
Showing
5 changed files
with
114 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
Test HTMLSelectElement::size behavior. | ||
|
||
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". | ||
|
||
|
||
PASS select.size is 0 | ||
PASS select.setAttribute("size", "1"); select.size is 1 | ||
PASS select.setAttribute("size", "2"); select.size is 2 | ||
PASS select.setAttribute("size", "3"); select.size is 3 | ||
PASS select.setAttribute("size", "4"); select.size is 4 | ||
PASS select.setAttribute("size", "0"); select.size is 0 | ||
PASS select.setAttribute("size", "-1"); select.size is 0 | ||
PASS select.setAttribute("size", "abc"); select.size is 0 | ||
PASS select.setAttribute("size", "3.14"); select.size is 3 | ||
PASS select.size is 2 | ||
PASS select.setAttribute("size", "1"); select.size is 1 | ||
PASS select.setAttribute("size", "0"); select.size is 0 | ||
PASS select.setAttribute("size", "-1"); select.size is 0 | ||
PASS select.setAttribute("size", "abc"); select.size is 0 | ||
PASS select.setAttribute("size", "3.14"); select.size is 3 | ||
PASS select.size is 0 | ||
PASS select.setAttribute("size", "1"); select.size is 1 | ||
PASS select.setAttribute("size", "0"); select.size is 0 | ||
PASS select.setAttribute("size", "-1"); select.size is 0 | ||
PASS select.setAttribute("size", "abc"); select.size is 0 | ||
PASS select.setAttribute("size", "3.14"); select.size is 3 | ||
PASS select.size is 1 | ||
PASS select.setAttribute("size", "2"); select.size is 2 | ||
PASS select.setAttribute("size", "0"); select.size is 0 | ||
PASS select.setAttribute("size", "-1"); select.size is 0 | ||
PASS select.setAttribute("size", "abc"); select.size is 0 | ||
PASS select.setAttribute("size", "3.14"); select.size is 3 | ||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<script src="../../resources/js-test.js"></script> | ||
</head> | ||
<body> | ||
<select id="test1"></select> | ||
<select id="test2" size=2></select> | ||
<select id="test3" multiple></select> | ||
<select id="test4" multiple size=1></select> | ||
<script> | ||
description('Test HTMLSelectElement::size behavior.'); | ||
|
||
var select = document.getElementById('test1'); | ||
shouldBe('select.size', '0'); | ||
shouldBe('select.setAttribute("size", "1"); select.size', '1'); | ||
shouldBe('select.setAttribute("size", "2"); select.size', '2'); | ||
shouldBe('select.setAttribute("size", "3"); select.size', '3'); | ||
shouldBe('select.setAttribute("size", "4"); select.size', '4'); | ||
shouldBe('select.setAttribute("size", "0"); select.size', '0'); | ||
shouldBe('select.setAttribute("size", "-1"); select.size', '0'); | ||
shouldBe('select.setAttribute("size", "abc"); select.size', '0'); | ||
shouldBe('select.setAttribute("size", "3.14"); select.size', '3'); | ||
|
||
var select = document.getElementById('test2'); | ||
shouldBe('select.size', '2'); | ||
shouldBe('select.setAttribute("size", "1"); select.size', '1'); | ||
shouldBe('select.setAttribute("size", "0"); select.size', '0'); | ||
shouldBe('select.setAttribute("size", "-1"); select.size', '0'); | ||
shouldBe('select.setAttribute("size", "abc"); select.size', '0'); | ||
shouldBe('select.setAttribute("size", "3.14"); select.size', '3'); | ||
|
||
var select = document.getElementById('test3'); | ||
shouldBe('select.size', '0'); | ||
shouldBe('select.setAttribute("size", "1"); select.size', '1'); | ||
shouldBe('select.setAttribute("size", "0"); select.size', '0'); | ||
shouldBe('select.setAttribute("size", "-1"); select.size', '0'); | ||
shouldBe('select.setAttribute("size", "abc"); select.size', '0'); | ||
shouldBe('select.setAttribute("size", "3.14"); select.size', '3'); | ||
|
||
var select = document.getElementById('test4'); | ||
shouldBe('select.size', '1'); | ||
shouldBe('select.setAttribute("size", "2"); select.size', '2'); | ||
shouldBe('select.setAttribute("size", "0"); select.size', '0'); | ||
shouldBe('select.setAttribute("size", "-1"); select.size', '0'); | ||
shouldBe('select.setAttribute("size", "abc"); select.size', '0'); | ||
shouldBe('select.setAttribute("size", "3.14"); select.size', '3'); | ||
|
||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters