- Revision
- 87896
- Author
- [email protected]
- Date
- 2011-06-02 05:00:55 -0700 (Thu, 02 Jun 2011)
Log Message
2011-06-02 Naiem Shaik <[email protected]>
Reviewed by Kent Tamura.
Fixing invalid value being returned for default checkbox and radio state
https://bugs.webkit.org/show_bug.cgi?id=61674
As per http://www.w3.org/TR/html5/number-state.html#checkbox-state and
http://www.w3.org/TR/html5/number-state.html#radio-button-state:
The value IDL attribute is in mode default/on:
If the element has a value attribute, it must return that attribute's
value; otherwise, it must return the string "on".
Currently default value is empty string;Default value of Radio button
and checkbox should be "on"
This works as per spec in IE9,Firefox and Opera
* fast/forms/checkbox-default-value-expected.txt: Added.
* fast/forms/checkbox-default-value.html: Added.
* fast/forms/radio-default-value-expected.txt: Added.
* fast/forms/radio-default-value.html: Added.
2011-06-02 Naiem Shaik <[email protected]>
Reviewed by Kent Tamura.
Fixing invalid value being returned for default checkbox and radio state
https://bugs.webkit.org/show_bug.cgi?id=61674
As per http://www.w3.org/TR/html5/number-state.html#checkbox-state and
http://www.w3.org/TR/html5/number-state.html#radio-button-state:
The value IDL attribute is in mode default/on:
If the element has a value attribute, it must return that attribute's
value; otherwise, it must return the string "on".
Currently default value is empty string;Default value of Radio button
and checkbox should be "on".Changed fallbackValue function to return the same
This works as per spec in IE9,Firefox and Opera
Tests: fast/forms/checkbox-default-value.html
fast/forms/radio-default-value.html
* html/BaseCheckableInputType.cpp:
(WebCore::BaseCheckableInputType::fallbackValue):
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (87895 => 87896)
--- trunk/LayoutTests/ChangeLog 2011-06-02 11:57:31 UTC (rev 87895)
+++ trunk/LayoutTests/ChangeLog 2011-06-02 12:00:55 UTC (rev 87896)
@@ -1,3 +1,24 @@
+2011-06-02 Naiem Shaik <[email protected]>
+
+ Reviewed by Kent Tamura.
+
+ Fixing invalid value being returned for default checkbox and radio state
+ https://bugs.webkit.org/show_bug.cgi?id=61674
+
+ As per http://www.w3.org/TR/html5/number-state.html#checkbox-state and
+ http://www.w3.org/TR/html5/number-state.html#radio-button-state:
+ The value IDL attribute is in mode default/on:
+ If the element has a value attribute, it must return that attribute's
+ value; otherwise, it must return the string "on".
+ Currently default value is empty string;Default value of Radio button
+ and checkbox should be "on"
+ This works as per spec in IE9,Firefox and Opera
+
+ * fast/forms/checkbox-default-value-expected.txt: Added.
+ * fast/forms/checkbox-default-value.html: Added.
+ * fast/forms/radio-default-value-expected.txt: Added.
+ * fast/forms/radio-default-value.html: Added.
+
2011-06-02 Mario Sanchez Prada <[email protected]>
Unreviewed, skipped test timing out for GTK since r87605.
Added: trunk/LayoutTests/fast/forms/checkbox-default-value-expected.txt (0 => 87896)
--- trunk/LayoutTests/fast/forms/checkbox-default-value-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/forms/checkbox-default-value-expected.txt 2011-06-02 12:00:55 UTC (rev 87896)
@@ -0,0 +1,6 @@
+PASS el.value is "on"
+PASS el.setAttribute("value", "foo"); el.value is "foo"
+PASS el.checked = true; el.value is "foo"
+PASS el.removeAttribute("value"); el.value is "on"
+PASS el.value = "foo"; el.getAttribute("value") is "foo"
+
Added: trunk/LayoutTests/fast/forms/checkbox-default-value.html (0 => 87896)
--- trunk/LayoutTests/fast/forms/checkbox-default-value.html (rev 0)
+++ trunk/LayoutTests/fast/forms/checkbox-default-value.html 2011-06-02 12:00:55 UTC (rev 87896)
@@ -0,0 +1,15 @@
+<head>
+<script src=""
+</head>
+<body>
+<div id="console"></div>
+<script>
+ var el = document.createElement("input");
+ el.setAttribute("type", "checkbox");
+ shouldBe('el.value', '"on"');
+ shouldBe('el.setAttribute("value", "foo"); el.value', '"foo"');
+ shouldBe('el.checked = true; el.value', '"foo"');
+ shouldBe('el.removeAttribute("value"); el.value', '"on"');
+ shouldBe('el.value = "foo"; el.getAttribute("value")', '"foo"');
+</script>
+</body>
Added: trunk/LayoutTests/fast/forms/radio-default-value-expected.txt (0 => 87896)
--- trunk/LayoutTests/fast/forms/radio-default-value-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/forms/radio-default-value-expected.txt 2011-06-02 12:00:55 UTC (rev 87896)
@@ -0,0 +1,6 @@
+PASS el.value is "on"
+PASS el.setAttribute("value", "foo"); el.value is "foo"
+PASS el.checked = true; el.value is "foo"
+PASS el.removeAttribute("value"); el.value is "on"
+PASS el.value = "foo"; el.getAttribute("value") is "foo"
+
Added: trunk/LayoutTests/fast/forms/radio-default-value.html (0 => 87896)
--- trunk/LayoutTests/fast/forms/radio-default-value.html (rev 0)
+++ trunk/LayoutTests/fast/forms/radio-default-value.html 2011-06-02 12:00:55 UTC (rev 87896)
@@ -0,0 +1,15 @@
+<head>
+<script src=""
+</head>
+<body>
+<div id="console"></div>
+<script>
+ var el = document.createElement("input");
+ el.setAttribute("type", "radio");
+ shouldBe('el.value', '"on"');
+ shouldBe('el.setAttribute("value", "foo"); el.value', '"foo"');
+ shouldBe('el.checked = true; el.value', '"foo"');
+ shouldBe('el.removeAttribute("value"); el.value', '"on"');
+ shouldBe('el.value = "foo"; el.getAttribute("value")', '"foo"');
+</script>
+</body>
Modified: trunk/Source/WebCore/ChangeLog (87895 => 87896)
--- trunk/Source/WebCore/ChangeLog 2011-06-02 11:57:31 UTC (rev 87895)
+++ trunk/Source/WebCore/ChangeLog 2011-06-02 12:00:55 UTC (rev 87896)
@@ -1,3 +1,25 @@
+2011-06-02 Naiem Shaik <[email protected]>
+
+ Reviewed by Kent Tamura.
+
+ Fixing invalid value being returned for default checkbox and radio state
+ https://bugs.webkit.org/show_bug.cgi?id=61674
+
+ As per http://www.w3.org/TR/html5/number-state.html#checkbox-state and
+ http://www.w3.org/TR/html5/number-state.html#radio-button-state:
+ The value IDL attribute is in mode default/on:
+ If the element has a value attribute, it must return that attribute's
+ value; otherwise, it must return the string "on".
+ Currently default value is empty string;Default value of Radio button
+ and checkbox should be "on".Changed fallbackValue function to return the same
+ This works as per spec in IE9,Firefox and Opera
+
+ Tests: fast/forms/checkbox-default-value.html
+ fast/forms/radio-default-value.html
+
+ * html/BaseCheckableInputType.cpp:
+ (WebCore::BaseCheckableInputType::fallbackValue):
+
2011-06-02 Kent Tamura <[email protected]>
[Chromium/Mac] Fix a wrong merge for r87881
Modified: trunk/Source/WebCore/html/BaseCheckableInputType.cpp (87895 => 87896)
--- trunk/Source/WebCore/html/BaseCheckableInputType.cpp 2011-06-02 11:57:31 UTC (rev 87895)
+++ trunk/Source/WebCore/html/BaseCheckableInputType.cpp 2011-06-02 12:00:55 UTC (rev 87896)
@@ -94,7 +94,7 @@
String BaseCheckableInputType::fallbackValue()
{
- return element()->checked() ? "on" : "";
+ return "on";
}
bool BaseCheckableInputType::storesValueSeparateFromAttribute()