[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-10851-g50815da

commit-queue at webkit.org commit-queue at webkit.org
Wed Dec 22 18:21:39 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 283639742fcf875231722a3f49ab08f308fa81ec
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Dec 10 05:59:39 2010 +0000

    2010-12-09  Kenichi Ishibashi  <bashi at google.com>
    
            Reviewed by Kent Tamura.
    
            Improve validation API support of <object> and <keygen>
            https://bugs.webkit.org/show_bug.cgi?id=50663
    
            Adds tests for validation API for <object>.
            Tests for <output> and <keygen> are also added.
    
            * fast/dom/plugin-attributes-enumeration-expected.txt: Updated.
            * fast/forms/ValidityState-001-expected.txt: Updated.
            * fast/forms/ValidityState-001.html: Updated.
            * fast/forms/checkValidity-001-expected.txt: Updated.
            * fast/forms/checkValidity-001.html: Updated.
            * fast/forms/script-tests/setCustomValidity-existence.js: Added.
            * fast/forms/script-tests/validationMessage.js: Updated.
            * fast/forms/script-tests/willvalidate.js: Updated.
            * fast/forms/setCustomValidity-existence-expected.txt: Added.
            * fast/forms/setCustomValidity-existence.html: Added.
            * fast/forms/validationMessage-expected.txt: Updated.
            * fast/forms/willvalidate-expected.txt: Updated.
    2010-12-09  Kenichi Ishibashi  <bashi at google.com>
    
            Reviewed by Kent Tamura.
    
            Improve validation API support of <object> and <keygen>
            https://bugs.webkit.org/show_bug.cgi?id=50663
    
            Adds validation API to HTMLObjectElement class.
            Makes HTMLKeygenElement::willValidate() return false.
    
            Test: fast/forms/setCustomValidity-existence.html
    
            * html/HTMLKeygenElement.h:
            (WebCore::HTMLKeygenElement::willValidate): Added.
            * html/HTMLObjectElement.h:
            (WebCore::HTMLObjectElement::validationMessage): Added.
            (WebCore::HTMLObjectElement::checkValidity): Added.
            (WebCore::HTMLObjectElement::setCustomValidity): Added.
            * html/HTMLObjectElement.idl: Added validation API properties.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73686 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 56006d3..96e0f8c 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,26 @@
+2010-12-09  Kenichi Ishibashi  <bashi at google.com>
+
+        Reviewed by Kent Tamura.
+
+        Improve validation API support of <object> and <keygen>
+        https://bugs.webkit.org/show_bug.cgi?id=50663
+
+        Adds tests for validation API for <object>.
+        Tests for <output> and <keygen> are also added.
+
+        * fast/dom/plugin-attributes-enumeration-expected.txt: Updated.
+        * fast/forms/ValidityState-001-expected.txt: Updated.
+        * fast/forms/ValidityState-001.html: Updated.
+        * fast/forms/checkValidity-001-expected.txt: Updated.
+        * fast/forms/checkValidity-001.html: Updated.
+        * fast/forms/script-tests/setCustomValidity-existence.js: Added.
+        * fast/forms/script-tests/validationMessage.js: Updated.
+        * fast/forms/script-tests/willvalidate.js: Updated.
+        * fast/forms/setCustomValidity-existence-expected.txt: Added.
+        * fast/forms/setCustomValidity-existence.html: Added.
+        * fast/forms/validationMessage-expected.txt: Updated.
+        * fast/forms/willvalidate-expected.txt: Updated.
+
 2010-12-09  Sadrul Habib Chowdhury  <sadrul at chromium.org>
 
         Reviewed by Kent Tamura.
diff --git a/LayoutTests/fast/dom/plugin-attributes-enumeration-expected.txt b/LayoutTests/fast/dom/plugin-attributes-enumeration-expected.txt
index 8e0b2a8..6a6ade9 100644
--- a/LayoutTests/fast/dom/plugin-attributes-enumeration-expected.txt
+++ b/LayoutTests/fast/dom/plugin-attributes-enumeration-expected.txt
@@ -18,6 +18,8 @@ hspace
 standby
 type
 useMap
+validationMessage
+validity
 vspace
 willValidate
 ----------
diff --git a/LayoutTests/fast/forms/ValidityState-001-expected.txt b/LayoutTests/fast/forms/ValidityState-001-expected.txt
index 03a2975..af7d4e0 100644
--- a/LayoutTests/fast/forms/ValidityState-001-expected.txt
+++ b/LayoutTests/fast/forms/ValidityState-001-expected.txt
@@ -1,8 +1,11 @@
 Each form control in this document exposes a validity attribute that returns a live instance of ValidityState.
 
-   
-SUCCESS
-SUCCESS
-SUCCESS
-SUCCESS
-SUCCESS
+      
+Test for FIELDSET: SUCCESS
+Test for SELECT: SUCCESS
+Test for INPUT: SUCCESS
+Test for TEXTAREA: SUCCESS
+Test for BUTTON: SUCCESS
+Test for OUTPUT: SUCCESS
+Test for OBJECT: SUCCESS
+Test for KEYGEN: SUCCESS
diff --git a/LayoutTests/fast/forms/ValidityState-001.html b/LayoutTests/fast/forms/ValidityState-001.html
index bfc085d..5c6ba09 100644
--- a/LayoutTests/fast/forms/ValidityState-001.html
+++ b/LayoutTests/fast/forms/ValidityState-001.html
@@ -22,7 +22,7 @@
         v = document.getElementsByName("victim");
 
         for (i = 0; i < v.length; i++)
-            log((v[i].validity && countAttr(v[i].validity) == 9) ? "SUCCESS" : "FAILURE");
+            log('Test for ' + v[i].tagName + ': ' + ((v[i].validity && countAttr(v[i].validity) == 9) ? "SUCCESS" : "FAILURE"));
     }
 </script>
 </head>
@@ -34,6 +34,9 @@ a live instance of ValidityState.</p>
 <input name="victim"/>
 <textarea name="victim"></textarea>
 <button name="victim"></button>
+<output name="victim"></output>
+<object name="victim"></object>
+<keygen name="victim"></keygen>
 </fieldset>
 <hr>
 <ol id="console"></ol>
diff --git a/LayoutTests/fast/forms/checkValidity-001-expected.txt b/LayoutTests/fast/forms/checkValidity-001-expected.txt
index 5583d6c..acce042 100644
--- a/LayoutTests/fast/forms/checkValidity-001-expected.txt
+++ b/LayoutTests/fast/forms/checkValidity-001-expected.txt
@@ -3,12 +3,15 @@ This test checks if checkValidity() returns correctly a true (meaning no error)
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
- lorem ipsum  
-PASS v[i].checkValidity() is true
-PASS v[i].checkValidity() is true
-PASS v[i].checkValidity() is true
-PASS v[i].checkValidity() is true
-PASS v[i].checkValidity() is true
+ lorem ipsum     
+PASS document.getElementsByTagName("fieldset")[0].checkValidity() is true
+PASS document.getElementsByTagName("input")[0].checkValidity() is true
+PASS document.getElementsByTagName("button")[0].checkValidity() is true
+PASS document.getElementsByTagName("select")[0].checkValidity() is true
+PASS document.getElementsByTagName("textarea")[0].checkValidity() is true
+PASS document.getElementsByTagName("output")[0].checkValidity() is true
+PASS document.getElementsByTagName("object")[0].checkValidity() is true
+PASS document.getElementsByTagName("keygen")[0].checkValidity() is true
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/LayoutTests/fast/forms/checkValidity-001.html b/LayoutTests/fast/forms/checkValidity-001.html
index 9f362fa..b4cfa42 100644
--- a/LayoutTests/fast/forms/checkValidity-001.html
+++ b/LayoutTests/fast/forms/checkValidity-001.html
@@ -12,14 +12,22 @@
 <button name="victim">lorem ipsum</button>
 <select name="victim"></select>
 <textarea name="victim"></textarea>
+<output name="victim"></output>
+<object name="victim"></object>
+<keygen name="victim"></keygen>
 </form>
 <div id="console"></div>
 <script>
 description("This test checks if checkValidity() returns correctly a true (meaning no error) result.");
 
-v = document.getElementsByName("victim");
-for (i = 0; i < v.length; i++)
-    shouldBe("v[i].checkValidity()", "true");
+shouldBe('document.getElementsByTagName("fieldset")[0].checkValidity()', 'true');
+shouldBe('document.getElementsByTagName("input")[0].checkValidity()', 'true');
+shouldBe('document.getElementsByTagName("button")[0].checkValidity()', 'true');
+shouldBe('document.getElementsByTagName("select")[0].checkValidity()', 'true');
+shouldBe('document.getElementsByTagName("textarea")[0].checkValidity()', 'true');
+shouldBe('document.getElementsByTagName("output")[0].checkValidity()', 'true');
+shouldBe('document.getElementsByTagName("object")[0].checkValidity()', 'true');
+shouldBe('document.getElementsByTagName("keygen")[0].checkValidity()', 'true');
 
 var successfullyParsed = true;
 </script>
diff --git a/LayoutTests/fast/forms/script-tests/setCustomValidity-existence.js b/LayoutTests/fast/forms/script-tests/setCustomValidity-existence.js
new file mode 100644
index 0000000..059543c
--- /dev/null
+++ b/LayoutTests/fast/forms/script-tests/setCustomValidity-existence.js
@@ -0,0 +1,27 @@
+description('Existence tests for .setCustomValidity property');
+
+var parent = document.createElement('div');
+document.body.appendChild(parent);
+
+debug('Existence of .setCustomValidity');
+parent.innerHTML = '<form>'
+    + '<input name="victim"/>'
+    + '<textarea name="victim"></textarea>'
+    + '<fieldset name="victim">Test</fieldset>'
+    + '<button name="victim">'
+    + '<select name="victim"></select>'
+    + '<output name="victim"></output>'
+    + '<object name="victim"></object>'
+    + '<keygen name="victim">'
+    + '</form>';
+
+shouldBe('typeof document.getElementsByTagName("input")[0].setCustomValidity', '"function"');
+shouldBe('typeof document.getElementsByTagName("button")[0].setCustomValidity', '"function"');
+shouldBe('typeof document.getElementsByTagName("fieldset")[0].setCustomValidity', '"function"');
+shouldBe('typeof document.getElementsByTagName("select")[0].setCustomValidity', '"function"');
+shouldBe('typeof document.getElementsByTagName("textarea")[0].setCustomValidity', '"function"');
+shouldBe('typeof document.getElementsByTagName("output")[0].setCustomValidity', '"function"');
+shouldBe('typeof document.getElementsByTagName("object")[0].setCustomValidity', '"function"');
+shouldBe('typeof document.getElementsByTagName("keygen")[0].setCustomValidity', '"function"');
+
+var successfullyParsed = true;
diff --git a/LayoutTests/fast/forms/script-tests/validationMessage.js b/LayoutTests/fast/forms/script-tests/validationMessage.js
index 5c56542..31246c7 100644
--- a/LayoutTests/fast/forms/script-tests/validationMessage.js
+++ b/LayoutTests/fast/forms/script-tests/validationMessage.js
@@ -62,4 +62,22 @@ happySelect.name = "select";
 form.appendChild(happySelect);
 shouldBe("happySelect.validationMessage", "''");
 
+// Output elements can't be validated
+var happyOutput = document.createElement("output");
+happySelect.name = "output";
+form.appendChild(happyOutput);
+shouldBe("happyOutput.validationMessage", "''");
+
+// Object elements can't be validated
+var happyObject = document.createElement("object");
+happySelect.name = "object";
+form.appendChild(happyObject);
+shouldBe("happyObject.validationMessage", "''");
+
+// Keygen controls can't be validated
+var happyKeygen = document.createElement("keygen");
+happySelect.name = "keygen";
+form.appendChild(happyKeygen);
+shouldBe("happyKeygen.validationMessage", "''");
+
 var successfullyParsed = true;
diff --git a/LayoutTests/fast/forms/script-tests/willvalidate.js b/LayoutTests/fast/forms/script-tests/willvalidate.js
index f38d587..6f12652 100644
--- a/LayoutTests/fast/forms/script-tests/willvalidate.js
+++ b/LayoutTests/fast/forms/script-tests/willvalidate.js
@@ -10,6 +10,9 @@ parent.innerHTML = '<form>'
     + '<fieldset name="victim">Test</fieldset>'
     + '<button name="victim">'
     + '<select name="victim"></select>'
+    + '<output name="victim"></output>'
+    + '<object name="victim"></object>'
+    + '<keygen name="victim">'
     + '</form>';
 var controls = document.getElementsByName('victim');
     for (var i = 0; i < controls.length; i++)
@@ -65,4 +68,19 @@ debug('Textarea element');
 parent.innerHTML = '<form><textarea name="text"></textarea></form>';
 shouldBeTrue('document.getElementsByTagName("textarea")[0].willValidate');
 
+debug('');
+debug('Output element');
+parent.innerHTML = '<form><output></output></form>';
+shouldBeFalse('document.getElementsByTagName("output")[0].willValidate');
+
+debug('');
+debug('Object element');
+parent.innerHTML = '<form><object></object></form>';
+shouldBeFalse('document.getElementsByTagName("object")[0].willValidate');
+
+debug('');
+debug('Keygen element');
+parent.innerHTML = '<form><keygen></form>';
+shouldBeFalse('document.getElementsByTagName("keygen")[0].willValidate');
+
 var successfullyParsed = true;
diff --git a/LayoutTests/fast/forms/setCustomValidity-existence-expected.txt b/LayoutTests/fast/forms/setCustomValidity-existence-expected.txt
new file mode 100644
index 0000000..5ac4f84
--- /dev/null
+++ b/LayoutTests/fast/forms/setCustomValidity-existence-expected.txt
@@ -0,0 +1,19 @@
+Existence tests for .setCustomValidity property
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Existence of .setCustomValidity
+PASS typeof document.getElementsByTagName("input")[0].setCustomValidity is "function"
+PASS typeof document.getElementsByTagName("button")[0].setCustomValidity is "function"
+PASS typeof document.getElementsByTagName("fieldset")[0].setCustomValidity is "function"
+PASS typeof document.getElementsByTagName("select")[0].setCustomValidity is "function"
+PASS typeof document.getElementsByTagName("textarea")[0].setCustomValidity is "function"
+PASS typeof document.getElementsByTagName("output")[0].setCustomValidity is "function"
+PASS typeof document.getElementsByTagName("object")[0].setCustomValidity is "function"
+PASS typeof document.getElementsByTagName("keygen")[0].setCustomValidity is "function"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+Test
+
diff --git a/LayoutTests/fast/forms/setCustomValidity-existence.html b/LayoutTests/fast/forms/setCustomValidity-existence.html
new file mode 100644
index 0000000..21264ba
--- /dev/null
+++ b/LayoutTests/fast/forms/setCustomValidity-existence.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/setCustomValidity-existence.js"></script>
+<script src="../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/forms/validationMessage-expected.txt b/LayoutTests/fast/forms/validationMessage-expected.txt
index e91961d..7249b2f 100644
--- a/LayoutTests/fast/forms/validationMessage-expected.txt
+++ b/LayoutTests/fast/forms/validationMessage-expected.txt
@@ -12,6 +12,9 @@ PASS but.validationMessage is ''
 PASS anoninput.validationMessage is ''
 PASS happyFieldset.validationMessage is ''
 PASS happySelect.validationMessage is ''
+PASS happyOutput.validationMessage is ''
+PASS happyObject.validationMessage is ''
+PASS happyKeygen.validationMessage is ''
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/LayoutTests/fast/forms/willvalidate-expected.txt b/LayoutTests/fast/forms/willvalidate-expected.txt
index 2787be8..7a1c392 100644
--- a/LayoutTests/fast/forms/willvalidate-expected.txt
+++ b/LayoutTests/fast/forms/willvalidate-expected.txt
@@ -9,6 +9,9 @@ PASS typeof controls[i].willValidate is "boolean"
 PASS typeof controls[i].willValidate is "boolean"
 PASS typeof controls[i].willValidate is "boolean"
 PASS typeof controls[i].willValidate is "boolean"
+PASS typeof controls[i].willValidate is "boolean"
+PASS typeof controls[i].willValidate is "boolean"
+PASS typeof controls[i].willValidate is "boolean"
 
 Form association
 PASS input.willValidate is true
@@ -36,6 +39,15 @@ PASS document.getElementsByTagName("fieldset")[0].willValidate is false
 
 Textarea element
 PASS document.getElementsByTagName("textarea")[0].willValidate is true
+
+Output element
+PASS document.getElementsByTagName("output")[0].willValidate is false
+
+Object element
+PASS document.getElementsByTagName("object")[0].willValidate is false
+
+Keygen element
+PASS document.getElementsByTagName("keygen")[0].willValidate is false
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index beb949a..2812bb9 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,23 @@
+2010-12-09  Kenichi Ishibashi  <bashi at google.com>
+
+        Reviewed by Kent Tamura.
+
+        Improve validation API support of <object> and <keygen>
+        https://bugs.webkit.org/show_bug.cgi?id=50663
+
+        Adds validation API to HTMLObjectElement class.
+        Makes HTMLKeygenElement::willValidate() return false.
+
+        Test: fast/forms/setCustomValidity-existence.html
+
+        * html/HTMLKeygenElement.h:
+        (WebCore::HTMLKeygenElement::willValidate): Added.
+        * html/HTMLObjectElement.h:
+        (WebCore::HTMLObjectElement::validationMessage): Added.
+        (WebCore::HTMLObjectElement::checkValidity): Added.
+        (WebCore::HTMLObjectElement::setCustomValidity): Added.
+        * html/HTMLObjectElement.idl: Added validation API properties.
+
 2010-12-09  Sadrul Habib Chowdhury  <sadrul at chromium.org>
 
         Reviewed by Kent Tamura.
diff --git a/WebCore/html/HTMLKeygenElement.h b/WebCore/html/HTMLKeygenElement.h
index f722e5b..80f94b5 100644
--- a/WebCore/html/HTMLKeygenElement.h
+++ b/WebCore/html/HTMLKeygenElement.h
@@ -39,6 +39,7 @@ private:
     virtual void parseMappedAttribute(Attribute*);
     virtual bool appendFormData(FormDataList&, bool);
 
+    virtual bool willValidate() const { return false; }
     virtual bool isOptionalFormControl() const { return false; }
 
     AtomicString m_challenge;
diff --git a/WebCore/html/HTMLObjectElement.h b/WebCore/html/HTMLObjectElement.h
index e420628..d5797ff 100644
--- a/WebCore/html/HTMLObjectElement.h
+++ b/WebCore/html/HTMLObjectElement.h
@@ -52,6 +52,12 @@ public:
     virtual bool isEnumeratable() const { return true; }
     virtual bool appendFormData(FormDataList&, bool);
 
+    // Implementations of constraint validation API.
+    // Note that the object elements are always barred from constraint validation.
+    String validationMessage() { return String(); }
+    bool checkValidity() { return true; }
+    void setCustomValidity(const String&) { }
+
     virtual void attributeChanged(Attribute*, bool preserveDecls = false);
 
     using TreeShared<ContainerNode>::ref;
diff --git a/WebCore/html/HTMLObjectElement.idl b/WebCore/html/HTMLObjectElement.idl
index 82801ae..c1fa8c0 100644
--- a/WebCore/html/HTMLObjectElement.idl
+++ b/WebCore/html/HTMLObjectElement.idl
@@ -43,6 +43,10 @@ module html {
         attribute [Reflect] long vspace;
         attribute [Reflect] DOMString width;
         readonly attribute boolean willValidate;
+        readonly attribute ValidityState validity;
+        readonly attribute DOMString validationMessage;
+        boolean checkValidity();
+        void setCustomValidity(in [ConvertUndefinedOrNullToNullString] DOMString error);
 
         // Introduced in DOM Level 2:
         readonly attribute [CheckFrameSecurity] Document contentDocument;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list