Title: [98075] trunk/LayoutTests
Revision
98075
Author
tk...@chromium.org
Date
2011-10-20 23:52:25 -0700 (Thu, 20 Oct 2011)

Log Message

Add a test to check behavior of tabindex attribute with a large number
https://bugs.webkit.org/show_bug.cgi?id=69056

Reviewed by Daniel Bates.

r96290 changed the behavior of integer parsing so that large
number strings which can not be represented in 32 bit integers
makes an error. Before r96290, we had assumed such large numbers
are equivelent to 0. We assume them invalid values.

* fast/dom/tabindex-defaults-expected.txt: Added.
* fast/dom/tabindex-defaults.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (98074 => 98075)


--- trunk/LayoutTests/ChangeLog	2011-10-21 06:49:08 UTC (rev 98074)
+++ trunk/LayoutTests/ChangeLog	2011-10-21 06:52:25 UTC (rev 98075)
@@ -1,3 +1,18 @@
+2011-10-02  Kent Tamura  <tk...@chromium.org>
+
+        Add a test to check behavior of tabindex attribute with a large number
+        https://bugs.webkit.org/show_bug.cgi?id=69056
+
+        Reviewed by Daniel Bates.
+
+        r96290 changed the behavior of integer parsing so that large
+        number strings which can not be represented in 32 bit integers
+        makes an error. Before r96290, we had assumed such large numbers
+        are equivelent to 0. We assume them invalid values.
+
+        * fast/dom/tabindex-defaults-expected.txt: Added.
+        * fast/dom/tabindex-defaults.html: Added.
+
 2011-10-20  Yuzo Fujishima  <y...@google.com>
 
         [chromium] Update test expectation for inspector/debugger/{linkifier,script-formatter}.html

Added: trunk/LayoutTests/fast/dom/tabindex-defaults-expected.txt (0 => 98075)


--- trunk/LayoutTests/fast/dom/tabindex-defaults-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/dom/tabindex-defaults-expected.txt	2011-10-21 06:52:25 UTC (rev 98075)
@@ -0,0 +1,30 @@
+Default value of tabIndex IDL attribute
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS anchor.tabIndex is 0
+PASS button.tabIndex is 0
+PASS input.tabIndex is 0
+PASS select.tabIndex is 0
+PASS textarea.tabIndex is 0
+PASS editableDiv.tabIndex is 0
+PASS normalDiv.tabIndex is -1
+PASS anchor.setAttribute("tabindex", "invalid"); anchor.tabIndex is 0
+PASS button.setAttribute("tabindex", "invalid"); button.tabIndex is 0
+PASS input.setAttribute("tabindex", "invalid"); input.tabIndex is 0
+PASS select.setAttribute("tabindex", "invalid"); select.tabIndex is 0
+PASS textarea.setAttribute("tabindex", "invalid"); textarea.tabIndex is 0
+PASS editableDiv.setAttribute("tabindex", "invalid"); editableDiv.tabIndex is 0
+PASS normalDiv.setAttribute("tabindex", "invalid"); normalDiv.tabIndex is -1
+PASS anchor.setAttribute("tabindex", "9999999999"); anchor.tabIndex is 0
+PASS button.setAttribute("tabindex", "9999999999"); button.tabIndex is 0
+PASS input.setAttribute("tabindex", "9999999999"); input.tabIndex is 0
+PASS select.setAttribute("tabindex", "9999999999"); select.tabIndex is 0
+PASS textarea.setAttribute("tabindex", "9999999999"); textarea.tabIndex is 0
+PASS editableDiv.setAttribute("tabindex", "9999999999"); editableDiv.tabIndex is 0
+PASS normalDiv.setAttribute("tabindex", "9999999999"); normalDiv.tabIndex is -1
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Property changes on: trunk/LayoutTests/fast/dom/tabindex-defaults-expected.txt
___________________________________________________________________

Added: svn:eol-style

Added: trunk/LayoutTests/fast/dom/tabindex-defaults.html (0 => 98075)


--- trunk/LayoutTests/fast/dom/tabindex-defaults.html	                        (rev 0)
+++ trunk/LayoutTests/fast/dom/tabindex-defaults.html	2011-10-21 06:52:25 UTC (rev 98075)
@@ -0,0 +1,60 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<script src=""
+</head>
+<body>
+<div id="container">
+<!-- Focusable elements -->
+<a id="anchor" href=""
+<button id="button">button</button>
+<input id="input">
+<select id="select"></select>
+<textarea id="textarea"></textarea>
+<div id="editableDiv" contenteditable="true"></div>
+
+<!-- Unfocusable element -->
+<div id="normalDiv"></div>
+</div>
+
+<script>
+description('Default value of tabIndex IDL attribute');
+
+var anchor = document.getElementById('anchor');
+var button = document.getElementById('button');
+var input = document.getElementById('input');
+var select = document.getElementById('select');
+var textarea = document.getElementById('textarea');
+var editableDiv = document.getElementById('editableDiv');
+var normalDiv = document.getElementById('normalDiv');
+
+shouldBe('anchor.tabIndex', '0');
+shouldBe('button.tabIndex', '0');
+shouldBe('input.tabIndex', '0');
+shouldBe('select.tabIndex', '0');
+shouldBe('textarea.tabIndex', '0');
+shouldBe('editableDiv.tabIndex', '0');
+shouldBe('normalDiv.tabIndex', '-1');
+
+shouldBe('anchor.setAttribute("tabindex", "invalid"); anchor.tabIndex', '0');
+shouldBe('button.setAttribute("tabindex", "invalid"); button.tabIndex', '0');
+shouldBe('input.setAttribute("tabindex", "invalid"); input.tabIndex', '0');
+shouldBe('select.setAttribute("tabindex", "invalid"); select.tabIndex', '0');
+shouldBe('textarea.setAttribute("tabindex", "invalid"); textarea.tabIndex', '0');
+shouldBe('editableDiv.setAttribute("tabindex", "invalid"); editableDiv.tabIndex', '0');
+shouldBe('normalDiv.setAttribute("tabindex", "invalid"); normalDiv.tabIndex', '-1');
+
+shouldBe('anchor.setAttribute("tabindex", "9999999999"); anchor.tabIndex', '0');
+shouldBe('button.setAttribute("tabindex", "9999999999"); button.tabIndex', '0');
+shouldBe('input.setAttribute("tabindex", "9999999999"); input.tabIndex', '0');
+shouldBe('select.setAttribute("tabindex", "9999999999"); select.tabIndex', '0');
+shouldBe('textarea.setAttribute("tabindex", "9999999999"); textarea.tabIndex', '0');
+shouldBe('editableDiv.setAttribute("tabindex", "9999999999"); editableDiv.tabIndex', '0');
+shouldBe('normalDiv.setAttribute("tabindex", "9999999999"); normalDiv.tabIndex', '-1');
+
+document.getElementById('container').innerHTML = '';
+var successfullyParsed = true;
+</script>
+<script src=""
+</body>
+</html>
Property changes on: trunk/LayoutTests/fast/dom/tabindex-defaults.html
___________________________________________________________________

Added: svn:eol-style

_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to