[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

tkent at chromium.org tkent at chromium.org
Thu Apr 8 02:13:13 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit cadbc9b3ebd1ed352da6d862c0ae5892ef818e19
Author: tkent at chromium.org <tkent at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Mar 8 01:53:33 2010 +0000

    2010-03-07  Kent Tamura  <tkent at chromium.org>
    
            Reviewed by Eric Seidel.
    
            Fix a bug that validity.valueMissing for a radio button with required
            in a form element always returns true.
            https://bugs.webkit.org/show_bug.cgi?id=35472
    
            Add tests for radio buttons in a form element, and merge an existing
            radio button test to ValidityState-valueMissing-radio.html.
    
            * fast/forms/ValidityState-valueMissing-007-expected.txt: Removed.
            * fast/forms/ValidityState-valueMissing-007.html: Removed.
            * fast/forms/ValidityState-valueMissing-radio-expected.txt: Added.
            * fast/forms/ValidityState-valueMissing-radio.html: Added.
            * fast/forms/script-tests/ValidityState-valueMissing-radio.js: Added.
    
    2010-03-07  Kent Tamura  <tkent at chromium.org>
    
            Reviewed by Eric Seidel.
    
            Fix a bug that validity.valueMissing for a radio button with required
            in a form element always returns true.
            https://bugs.webkit.org/show_bug.cgi?id=35472
    
            Test: fast/forms/ValidityState-valueMissing-radio.html
    
            * html/HTMLInputElement.cpp:
            (WebCore::checkedRadioButtons): Move the location to be used by valueMissing().
            (WebCore::HTMLInputElement::valueMissing):
              Use checkedRadioButtons() instead of document()->checkedRadioButtons().
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55640 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 84f6260..938d3b9 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,20 @@
+2010-03-07  Kent Tamura  <tkent at chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        Fix a bug that validity.valueMissing for a radio button with required
+        in a form element always returns true.
+        https://bugs.webkit.org/show_bug.cgi?id=35472
+
+        Add tests for radio buttons in a form element, and merge an existing
+        radio button test to ValidityState-valueMissing-radio.html.
+
+        * fast/forms/ValidityState-valueMissing-007-expected.txt: Removed.
+        * fast/forms/ValidityState-valueMissing-007.html: Removed.
+        * fast/forms/ValidityState-valueMissing-radio-expected.txt: Added.
+        * fast/forms/ValidityState-valueMissing-radio.html: Added.
+        * fast/forms/script-tests/ValidityState-valueMissing-radio.js: Added.
+
 2010-03-07  Sam Weinig  <sam at webkit.org>
 
         Reviewed by Dan Bernstein.
diff --git a/LayoutTests/fast/forms/ValidityState-valueMissing-007-expected.txt b/LayoutTests/fast/forms/ValidityState-valueMissing-007-expected.txt
deleted file mode 100644
index d986c5c..0000000
--- a/LayoutTests/fast/forms/ValidityState-valueMissing-007-expected.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-There are two radio buttons below with the same name, only one is required (which means the whole group is required), the other one is checked and leads the required attribute to be satisfied: no missing value.
-
- 
-SUCCESS
diff --git a/LayoutTests/fast/forms/ValidityState-valueMissing-007.html b/LayoutTests/fast/forms/ValidityState-valueMissing-007.html
deleted file mode 100644
index 0bd44fc..0000000
--- a/LayoutTests/fast/forms/ValidityState-valueMissing-007.html
+++ /dev/null
@@ -1,26 +0,0 @@
-<html>
-<head>
-<title>required and valueMissing on radio</title>
-<script language="JavaScript" type="text/javascript">
-    function log(message) {
-        document.getElementById("console").innerHTML += "<li>"+message+"</li>";
-    }
-
-    function test() {
-        if (window.layoutTestController)
-            layoutTestController.dumpAsText();
-
-        v = document.getElementsByName("victim");
-
-        log(!v[0].validity.valueMissing ? "SUCCESS" : "FAILURE");
-    }
-</script>
-</head>
-<body onload="test()">
-<p>There are two radio buttons below with the same name, only one is required (which means the whole group is required), the other one is checked and leads the required attribute to be satisfied: no missing value.</p>
-<input name="victim" type="radio" required/>
-<input name="victim" type="radio" checked/>
-<hr>
-<ol id="console"></ol>
-</body>
-</html>
diff --git a/LayoutTests/fast/forms/ValidityState-valueMissing-radio-expected.txt b/LayoutTests/fast/forms/ValidityState-valueMissing-radio-expected.txt
new file mode 100644
index 0000000..9498e81
--- /dev/null
+++ b/LayoutTests/fast/forms/ValidityState-valueMissing-radio-expected.txt
@@ -0,0 +1,29 @@
+valueMissing tests for radio buttons
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Without form element
+No checked button:
+PASS inputs[0].validity.valueMissing is true
+PASS inputs[1].validity.valueMissing is false
+The first button has been checked:
+PASS inputs[0].validity.valueMissing is false
+PASS inputs[1].validity.valueMissing is false
+The second button has been checked:
+PASS inputs[0].validity.valueMissing is false
+PASS inputs[1].validity.valueMissing is false
+With form element
+No checked button:
+PASS inputs[0].validity.valueMissing is true
+PASS inputs[1].validity.valueMissing is false
+The first button has been checked:
+PASS inputs[0].validity.valueMissing is false
+PASS inputs[1].validity.valueMissing is false
+The second button has been checked:
+PASS inputs[0].validity.valueMissing is false
+PASS inputs[1].validity.valueMissing is false
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/forms/ValidityState-valueMissing-radio.html b/LayoutTests/fast/forms/ValidityState-valueMissing-radio.html
new file mode 100644
index 0000000..75d1396
--- /dev/null
+++ b/LayoutTests/fast/forms/ValidityState-valueMissing-radio.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/ValidityState-valueMissing-radio.js"></script>
+<script src="../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/forms/script-tests/ValidityState-valueMissing-radio.js b/LayoutTests/fast/forms/script-tests/ValidityState-valueMissing-radio.js
new file mode 100644
index 0000000..a775d4a
--- /dev/null
+++ b/LayoutTests/fast/forms/script-tests/ValidityState-valueMissing-radio.js
@@ -0,0 +1,44 @@
+description('valueMissing tests for radio buttons');
+
+var parent = document.createElement('div');
+document.body.appendChild(parent);
+
+debug('Without form element');
+parent.innerHTML = '<input name=victim type=radio required/>'
+    + '<input name=victim type=radio/>';
+var inputs = document.getElementsByName('victim');
+debug('No checked button:');
+shouldBeTrue('inputs[0].validity.valueMissing');
+// The following result should be false because the element does not have
+// "required".  It conforms to HTML5, and this behavior has no practical
+// problems.
+shouldBeFalse('inputs[1].validity.valueMissing');
+debug('The first button has been checked:');
+inputs[0].checked = true;
+shouldBeFalse('inputs[0].validity.valueMissing');
+shouldBeFalse('inputs[1].validity.valueMissing');
+debug('The second button has been checked:');
+inputs[1].checked = true;
+shouldBeFalse('inputs[0].validity.valueMissing');
+shouldBeFalse('inputs[1].validity.valueMissing');
+
+debug('With form element');
+parent.innerHTML = '<form>'
+    + '<input name=victim type=radio required/>'
+    + '<input name=victim type=radio/>'
+    + '</form>';
+inputs = document.getElementsByName('victim');
+debug('No checked button:');
+shouldBeTrue('inputs[0].validity.valueMissing');
+// The following result should be false.
+shouldBeFalse('inputs[1].validity.valueMissing');
+debug('The first button has been checked:');
+inputs[0].checked = true;
+shouldBeFalse('inputs[0].validity.valueMissing');
+shouldBeFalse('inputs[1].validity.valueMissing');
+debug('The second button has been checked:');
+inputs[1].checked = true;
+shouldBeFalse('inputs[0].validity.valueMissing');
+shouldBeFalse('inputs[1].validity.valueMissing');
+
+var successfullyParsed = true;
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index b12f2e6..93a990a 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,18 @@
+2010-03-07  Kent Tamura  <tkent at chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        Fix a bug that validity.valueMissing for a radio button with required
+        in a form element always returns true.
+        https://bugs.webkit.org/show_bug.cgi?id=35472
+
+        Test: fast/forms/ValidityState-valueMissing-radio.html
+
+        * html/HTMLInputElement.cpp:
+        (WebCore::checkedRadioButtons): Move the location to be used by valueMissing().
+        (WebCore::HTMLInputElement::valueMissing):
+          Use checkedRadioButtons() instead of document()->checkedRadioButtons().
+
 2010-03-07  Mark Rowe  <mrowe at apple.com>
 
         Rubber-stamped by Cameron Zwarich.
diff --git a/WebCore/html/HTMLInputElement.cpp b/WebCore/html/HTMLInputElement.cpp
index 5b9123d..bdc27d6 100644
--- a/WebCore/html/HTMLInputElement.cpp
+++ b/WebCore/html/HTMLInputElement.cpp
@@ -163,6 +163,13 @@ bool HTMLInputElement::autoComplete() const
     return true;
 }
 
+static inline CheckedRadioButtons& checkedRadioButtons(const HTMLInputElement* element)
+{
+    if (HTMLFormElement* form = element->form())
+        return form->checkedRadioButtons();
+    return element->document()->checkedRadioButtons();
+}
+
 bool HTMLInputElement::valueMissing() const
 {
     if (!isRequiredFormControl() || readOnly() || disabled())
@@ -187,7 +194,7 @@ bool HTMLInputElement::valueMissing() const
         case CHECKBOX:
             return !checked();
         case RADIO:
-            return !document()->checkedRadioButtons().checkedButtonForGroup(name());
+            return !checkedRadioButtons(this).checkedButtonForGroup(name());
         case COLOR:
             return false;
         case BUTTON:
@@ -678,14 +685,6 @@ void HTMLInputElement::stepDown(int n, ExceptionCode& ec)
     applyStep(-n, ec);
 }
 
-static inline CheckedRadioButtons& checkedRadioButtons(const HTMLInputElement *element)
-{
-    if (HTMLFormElement* form = element->form())
-        return form->checkedRadioButtons();
-    
-    return element->document()->checkedRadioButtons();
-}
-
 bool HTMLInputElement::isKeyboardFocusable(KeyboardEvent* event) const
 {
     // If text fields can be focused, then they should always be keyboard focusable

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list