Title: [89229] trunk
- Revision
- 89229
- Author
- [email protected]
- Date
- 2011-06-19 21:47:20 -0700 (Sun, 19 Jun 2011)
Log Message
2011-06-19 Keishi Hattori <[email protected]>
Reviewed by Kent Tamura.
Clicking indeterminate checkbox should flip checkedness state
https://bugs.webkit.org/show_bug.cgi?id=62262
* fast/forms/checkbox-click-indeterminate-expected.txt: Added.
* fast/forms/checkbox-click-indeterminate.html: Added. Tests behavior when clicking indeterminate checkbox.
2011-06-19 Keishi Hattori <[email protected]>
Reviewed by Kent Tamura.
Clicking indeterminate checkbox should flip checkedness state
https://bugs.webkit.org/show_bug.cgi?id=62262
Test: fast/forms/checkbox-click-indeterminate.html
* html/CheckboxInputType.cpp:
(WebCore::CheckboxInputType::willDispatchClick): Changed to flip checked flag when indeterminate.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (89228 => 89229)
--- trunk/LayoutTests/ChangeLog 2011-06-20 03:50:36 UTC (rev 89228)
+++ trunk/LayoutTests/ChangeLog 2011-06-20 04:47:20 UTC (rev 89229)
@@ -1,3 +1,13 @@
+2011-06-19 Keishi Hattori <[email protected]>
+
+ Reviewed by Kent Tamura.
+
+ Clicking indeterminate checkbox should flip checkedness state
+ https://bugs.webkit.org/show_bug.cgi?id=62262
+
+ * fast/forms/checkbox-click-indeterminate-expected.txt: Added.
+ * fast/forms/checkbox-click-indeterminate.html: Added. Tests behavior when clicking indeterminate checkbox.
+
2011-06-19 Oliver Hunt <[email protected]>
Reviewed by Sam Weinig.
Added: trunk/LayoutTests/fast/forms/checkbox-click-indeterminate-expected.txt (0 => 89229)
--- trunk/LayoutTests/fast/forms/checkbox-click-indeterminate-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/forms/checkbox-click-indeterminate-expected.txt 2011-06-20 04:47:20 UTC (rev 89229)
@@ -0,0 +1,20 @@
+This tests that clicking on indeterminate checkbox flips both checked/indeterminate states and calling preventDefault restores them.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Test if clicking on unchecked indeterminate checkbox flips both checked/indeterminate states
+PASS cb.checked is true
+PASS cb.indeterminate is false
+Test if clicking on checked indeterminate checkbox flips both checked/indeterminate states
+PASS cb.checked is false
+PASS cb.indeterminate is false
+Test if preventDefault restores the checked/indeterminate states
+PASS cb.checked is true
+PASS cb.indeterminate is false
+PASS cb.checked is false
+PASS cb.indeterminate is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/fast/forms/checkbox-click-indeterminate.html (0 => 89229)
--- trunk/LayoutTests/fast/forms/checkbox-click-indeterminate.html (rev 0)
+++ trunk/LayoutTests/fast/forms/checkbox-click-indeterminate.html 2011-06-20 04:47:20 UTC (rev 89229)
@@ -0,0 +1,47 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href=""
+<script src=""
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script>
+var cb = document.createElement("input");
+document.body.appendChild(cb);
+cb.type = "checkbox";
+
+description("This tests that clicking on indeterminate checkbox flips both checked/indeterminate states and calling preventDefault restores them.");
+
+debug("Test if clicking on unchecked indeterminate checkbox flips both checked/indeterminate states");
+cb.checked = false;
+cb.indeterminate = true;
+cb.click();
+shouldBeTrue('cb.checked');
+shouldBeFalse('cb.indeterminate');
+
+debug("Test if clicking on checked indeterminate checkbox flips both checked/indeterminate states");
+cb.checked = true;
+cb.indeterminate = true;
+cb.click();
+shouldBeFalse('cb.checked');
+shouldBeFalse('cb.indeterminate');
+
+debug("Test if preventDefault restores the checked/indeterminate states");
+cb.checked = false;
+cb.indeterminate = true;
+cb._onclick_ = function(e) {
+ shouldBeTrue('cb.checked');
+ shouldBeFalse('cb.indeterminate');
+ e.preventDefault();
+};
+cb.click();
+shouldBeFalse('cb.checked');
+shouldBeTrue('cb.indeterminate');
+
+var successfullyParsed = true;
+</script>
+<script src=""
+</body>
+</html>
\ No newline at end of file
Modified: trunk/Source/WebCore/ChangeLog (89228 => 89229)
--- trunk/Source/WebCore/ChangeLog 2011-06-20 03:50:36 UTC (rev 89228)
+++ trunk/Source/WebCore/ChangeLog 2011-06-20 04:47:20 UTC (rev 89229)
@@ -1,3 +1,15 @@
+2011-06-19 Keishi Hattori <[email protected]>
+
+ Reviewed by Kent Tamura.
+
+ Clicking indeterminate checkbox should flip checkedness state
+ https://bugs.webkit.org/show_bug.cgi?id=62262
+
+ Test: fast/forms/checkbox-click-indeterminate.html
+
+ * html/CheckboxInputType.cpp:
+ (WebCore::CheckboxInputType::willDispatchClick): Changed to flip checked flag when indeterminate.
+
2011-06-19 Adam Bergkvist <[email protected]>
Reviewed by Martin Robinson.
Modified: trunk/Source/WebCore/html/CheckboxInputType.cpp (89228 => 89229)
--- trunk/Source/WebCore/html/CheckboxInputType.cpp 2011-06-20 03:50:36 UTC (rev 89228)
+++ trunk/Source/WebCore/html/CheckboxInputType.cpp 2011-06-20 04:47:20 UTC (rev 89229)
@@ -79,9 +79,9 @@
if (state->indeterminate)
element()->setIndeterminate(false);
- else
- element()->setChecked(!state->checked, true);
+ element()->setChecked(!state->checked, true);
+
return state.release();
}
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes