- a/LayoutTests/ChangeLog +27 lines
Lines 1-3 a/LayoutTests/ChangeLog_sec1
1
2008-07-16  Michelangelo De Simone  <m.des@mac.com>
2
3
        Reviewed by NOBODY (OOPS!).
4
5
        Test suite for the willValidate form controls attribute.
6
7
        * fast/forms/willvalidate-000-expected.txt: Added.
8
        * fast/forms/willvalidate-000.html: Added.
9
        * fast/forms/willvalidate-001-expected.txt: Added.
10
        * fast/forms/willvalidate-001.html: Added.
11
        * fast/forms/willvalidate-002-expected.txt: Added.
12
        * fast/forms/willvalidate-002.html: Added.
13
        * fast/forms/willvalidate-003-expected.txt: Added.
14
        * fast/forms/willvalidate-003.html: Added.
15
        * fast/forms/willvalidate-004-expected.txt: Added.
16
        * fast/forms/willvalidate-004.html: Added.
17
        * fast/forms/willvalidate-005-expected.txt: Added.
18
        * fast/forms/willvalidate-005.html: Added.
19
        * fast/forms/willvalidate-006-expected.txt: Added.
20
        * fast/forms/willvalidate-006.html: Added.
21
        * fast/forms/willvalidate-007-expected.txt: Added.
22
        * fast/forms/willvalidate-007.html: Added.
23
        * fast/forms/willvalidate-008-expected.txt: Added.
24
        * fast/forms/willvalidate-008.html: Added.
25
        * fast/forms/willvalidate-009-expected.txt: Added.
26
        * fast/forms/willvalidate-009.html: Added.
27
1
2008-07-15  Sam Weinig  <sam@webkit.org>
28
2008-07-15  Sam Weinig  <sam@webkit.org>
2
29
3
        Reviewed by Anders Carlsson.
30
        Reviewed by Anders Carlsson.
- a/LayoutTests/fast/forms/willvalidate-000-expected.txt +7 lines
Line 0 a/LayoutTests/fast/forms/willvalidate-000-expected.txt_sec1
1
  Test
2
3
SUCCESS
4
SUCCESS
5
SUCCESS
6
SUCCESS
7
SUCCESS
- a/LayoutTests/fast/forms/willvalidate-000.html +30 lines
Line 0 a/LayoutTests/fast/forms/willvalidate-000.html_sec1
1
<html>
2
<head>
3
<title>Check for willValidate property existence</title>
4
<script language="JavaScript" type="text/javascript">
5
    function log(message) {
6
        document.getElementById("console").innerHTML += "<li>"+message+"</li>";
7
    }
8
9
    function test() {
10
        if (window.layoutTestController)
11
            layoutTestController.dumpAsText();
12
        
13
        i = document.getElementsByName("victim");
14
        for (c = 0; c < i.length; c++)
15
            log(typeof i[c].willValidate != "undefined" ? "SUCCESS" : "FAILURE");
16
    }
17
</script>
18
</head>
19
<body onload="test()">
20
<form>
21
<input name="victim"/>
22
<textarea name="victim"></textarea>
23
<fieldset name="victim">Test</fieldset>
24
<button name="victim">
25
<select name="victim"></select>
26
</form>
27
<hr>
28
<ol id="console"></ol>
29
</body>
30
</html>
- a/LayoutTests/fast/forms/willvalidate-001-expected.txt +2 lines
Line 0 a/LayoutTests/fast/forms/willvalidate-001-expected.txt_sec1
1
2
SUCCESS
- a/LayoutTests/fast/forms/willvalidate-001.html +24 lines
Line 0 a/LayoutTests/fast/forms/willvalidate-001.html_sec1
1
<html>
2
<head>
3
<title>willValidate and form association</title>
4
<script language="JavaScript" type="text/javascript">
5
    function log(message) {
6
        document.getElementById("console").innerHTML += "<li>"+message+"</li>";
7
    }
8
9
    function test() {
10
        if (window.layoutTestController)
11
            layoutTestController.dumpAsText();
12
        
13
        i = document.getElementsByTagName("input")[0];
14
15
        log((i.willValidate) ? "FAILURE" : "SUCCESS");
16
    }
17
</script>
18
</head>
19
<body onload="test()">
20
<input name="test">
21
<hr>
22
<ol id="console"></ol>
23
</body>
24
</html>
- a/LayoutTests/fast/forms/willvalidate-002-expected.txt +2 lines
Line 0 a/LayoutTests/fast/forms/willvalidate-002-expected.txt_sec1
1
2
SUCCESS
- a/LayoutTests/fast/forms/willvalidate-002.html +24 lines
Line 0 a/LayoutTests/fast/forms/willvalidate-002.html_sec1
1
<html>
2
<head>
3
<title>willValidate and control name</title>
4
<script language="JavaScript" type="text/javascript">
5
    function log(message) {
6
        document.getElementById("console").innerHTML += "<li>"+message+"</li>";
7
    }
8
9
    function test() {
10
        if (window.layoutTestController)
11
            layoutTestController.dumpAsText();
12
        
13
        i = document.getElementsByTagName("input")[0];
14
        
15
        log((i.willValidate) ? "FAILURE" : "SUCCESS");
16
    }
17
</script>
18
</head>
19
<body onload="test()">
20
<form><p><input></p></form>
21
<hr>
22
<ol id="console"></ol>
23
</body>
24
</html>
- a/LayoutTests/fast/forms/willvalidate-003-expected.txt +2 lines
Line 0 a/LayoutTests/fast/forms/willvalidate-003-expected.txt_sec1
1
2
SUCCESS
- a/LayoutTests/fast/forms/willvalidate-003.html +24 lines
Line 0 a/LayoutTests/fast/forms/willvalidate-003.html_sec1
1
<html>
2
<head>
3
<title>willValidate and a disabled control</title>
4
<script language="JavaScript" type="text/javascript">
5
    function log(message) {
6
        document.getElementById("console").innerHTML += "<li>"+message+"</li>";
7
    }
8
9
    function test() {
10
        if (window.layoutTestController)
11
            layoutTestController.dumpAsText();
12
        
13
        i = document.getElementsByTagName("input")[0];
14
        
15
        log((i.willValidate) ? "FAILURE" : "SUCCESS");
16
    }
17
</script>
18
</head>
19
<body onload="test()">
20
<form><p><input name="test" disabled></p></form>
21
<hr>
22
<ol id="console"></ol>
23
</body>
24
</html>
- a/LayoutTests/fast/forms/willvalidate-004-expected.txt +2 lines
Line 0 a/LayoutTests/fast/forms/willvalidate-004-expected.txt_sec1
1
2
SUCCESS
- a/LayoutTests/fast/forms/willvalidate-004.html +24 lines
Line 0 a/LayoutTests/fast/forms/willvalidate-004.html_sec1
1
<html>
2
<head>
3
<title>willValidate and button control</title>
4
<script language="JavaScript" type="text/javascript">
5
    function log(message) {
6
        document.getElementById("console").innerHTML += "<li>"+message+"</li>";
7
    }
8
9
    function test() {
10
        if (window.layoutTestController)
11
            layoutTestController.dumpAsText();
12
        
13
        i = document.getElementsByTagName("input")[0];
14
        
15
        log((i.willValidate) ? "FAILURE" : "SUCCESS");
16
    }
17
</script>
18
</head>
19
<body onload="test()">
20
<form><p><input name="test" type="button"></p></form>
21
<hr>
22
<ol id="console"></ol>
23
</body>
24
</html>
- a/LayoutTests/fast/forms/willvalidate-005-expected.txt +2 lines
Line 0 a/LayoutTests/fast/forms/willvalidate-005-expected.txt_sec1
1
2
SUCCESS
- a/LayoutTests/fast/forms/willvalidate-005.html +24 lines
Line 0 a/LayoutTests/fast/forms/willvalidate-005.html_sec1
1
<html>
2
<head>
3
<title>willValidate and submit control</title>
4
<script language="JavaScript" type="text/javascript">
5
    function log(message) {
6
        document.getElementById("console").innerHTML += "<li>"+message+"</li>";
7
    }
8
9
    function test() {
10
        if (window.layoutTestController)
11
            layoutTestController.dumpAsText();
12
        
13
        i = document.getElementsByTagName("input")[0];
14
        
15
        log((i.willValidate) ? "SUCCESS" : "FAILURE");
16
    }
17
</script>
18
</head>
19
<body onload="test()">
20
<form><p><input name="test" type="submit"></p></form>
21
<hr>
22
<ol id="console"></ol>
23
</body>
24
</html>
- a/LayoutTests/fast/forms/willvalidate-006-expected.txt +4 lines
Line 0 a/LayoutTests/fast/forms/willvalidate-006-expected.txt_sec1
1
2
Fieldset test
3
4
SUCCESS
- a/LayoutTests/fast/forms/willvalidate-006.html +27 lines
Line 0 a/LayoutTests/fast/forms/willvalidate-006.html_sec1
1
<html>
2
<head>
3
<title>willValidate and the &lt;fieldset> element</title>
4
<script language="JavaScript" type="text/javascript">
5
    function log(message) {
6
        document.getElementById("console").innerHTML += "<li>"+message+"</li>";
7
    }
8
9
    function test() {
10
        if (window.layoutTestController)
11
            layoutTestController.dumpAsText();
12
        
13
        i = document.getElementsByTagName("fieldset")[0];
14
        log((i.willValidate) ? "FAILURE" : "SUCCESS");
15
    }
16
</script>
17
</head>
18
<body onload="test()">
19
<form>
20
<fieldset>
21
<p id="r">Fieldset test</p>
22
</fieldset>
23
</form>
24
<hr>
25
<ol id="console"></ol>
26
</body>
27
</html>
- a/LayoutTests/fast/forms/willvalidate-007-expected.txt +2 lines
Line 0 a/LayoutTests/fast/forms/willvalidate-007-expected.txt_sec1
1
2
SUCCESS
- a/LayoutTests/fast/forms/willvalidate-007.html +23 lines
Line 0 a/LayoutTests/fast/forms/willvalidate-007.html_sec1
1
<html>
2
<head>
3
<title>willValidate and a readonly control</title>
4
<script language="JavaScript" type="text/javascript">
5
    function log(message) {
6
        document.getElementById("console").innerHTML += "<li>"+message+"</li>";
7
    }
8
9
    function test() {
10
        if (window.layoutTestController)
11
            layoutTestController.dumpAsText();
12
        
13
        i = document.getElementsByTagName("input")[0];
14
        log((i.willValidate) ? "FAILURE" : "SUCCESS");
15
    }
16
</script>
17
</head>
18
<body onload="test()">
19
<form><input name="test" readonly></form>
20
<hr>
21
<ol id="console"></ol>
22
</body>
23
</html>
- a/LayoutTests/fast/forms/willvalidate-008-expected.txt +1 lines
Line 0 a/LayoutTests/fast/forms/willvalidate-008-expected.txt_sec1
1
SUCCESS
- a/LayoutTests/fast/forms/willvalidate-008.html +23 lines
Line 0 a/LayoutTests/fast/forms/willvalidate-008.html_sec1
1
<html>
2
<head>
3
<title>willValidate and a hidden control</title>
4
<script language="JavaScript" type="text/javascript">
5
    function log(message) {
6
        document.getElementById("console").innerHTML += "<li>"+message+"</li>";
7
    }
8
9
    function test() {
10
        if (window.layoutTestController)
11
            layoutTestController.dumpAsText();
12
        
13
        i = document.getElementsByTagName("input")[0];
14
        log((i.willValidate) ? "FAILURE" : "SUCCESS");
15
    }
16
</script>
17
</head>
18
<body onload="test()">
19
<form><input name="test" type="hidden"></form>
20
<hr>
21
<ol id="console"></ol>
22
</body>
23
</html>
- a/LayoutTests/fast/forms/willvalidate-009-expected.txt +2 lines
Line 0 a/LayoutTests/fast/forms/willvalidate-009-expected.txt_sec1
1
2
SUCCESS
- a/LayoutTests/fast/forms/willvalidate-009.html +23 lines
Line 0 a/LayoutTests/fast/forms/willvalidate-009.html_sec1
1
<html>
2
<head>
3
<title>willValidate and a reset control</title>
4
<script language="JavaScript" type="text/javascript">
5
    function log(message) {
6
        document.getElementById("console").innerHTML += "<li>"+message+"</li>";
7
    }
8
9
    function test() {
10
        if (window.layoutTestController)
11
            layoutTestController.dumpAsText();
12
        
13
        i = document.getElementsByTagName("input")[0];
14
        log((i.willValidate) ? "FAILURE" : "SUCCESS");
15
    }
16
</script>
17
</head>
18
<body onload="test()">
19
<form><input name="test" type="reset"></form>
20
<hr>
21
<ol id="console"></ol>
22
</body>
23
</html>
- a/WebCore/ChangeLog +34 lines
Lines 1-3 a/WebCore/ChangeLog_sec1
1
2008-07-16  Michelangelo De Simone  <michelangelo@me.com>
2
3
        Reviewed by NOBODY (OOPS!).
4
5
        Added the simple willValidate attribute to form controls according to
6
        WebForms 2 spec.
7
8
        URL: http://www.w3.org/TR/web-forms-2/#willvalidate
9
10
        Tests: fast/forms/willvalidate-000.html
11
               fast/forms/willvalidate-001.html
12
               fast/forms/willvalidate-002.html
13
               fast/forms/willvalidate-003.html
14
               fast/forms/willvalidate-004.html
15
               fast/forms/willvalidate-005.html
16
               fast/forms/willvalidate-006.html
17
               fast/forms/willvalidate-007.html
18
               fast/forms/willvalidate-008.html
19
               fast/forms/willvalidate-009.html
20
21
        * html/HTMLButtonElement.h: Added willValidate(), always false.
22
        * html/HTMLButtonElement.idl: willValidate attribute exposed.
23
        * html/HTMLFieldSetElement.h: Added willValidate(), always false.
24
        * html/HTMLFieldSetElement.idl: willValidate attribute exposed.
25
        * html/HTMLFormControlElement.cpp: (WebCore::HTMLFormControlElement::willValidate):
26
        Added base willValidate() implementation.
27
        * html/HTMLFormControlElement.h: Added willValidate().
28
        * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::willValidate):
29
        Added willValidate(), checks for input type.
30
        * html/HTMLInputElement.h: Added willValidate()
31
        * html/HTMLInputElement.idl: willValidate attribute exposed.
32
        * html/HTMLSelectElement.idl: willValidate attribute exposed.
33
        * html/HTMLTextAreaElement.idl: willValidate attribute exposed.
34
1
2008-07-15  Maxime Britto  <britto@apple.com>
35
2008-07-15  Maxime Britto  <britto@apple.com>
2
36
3
        Reviewed by Eric.
37
        Reviewed by Eric.
- a/WebCore/html/HTMLButtonElement.h +2 lines
Lines 56-61 public: a/WebCore/html/HTMLButtonElement.h_sec1
56
56
57
    String value() const;
57
    String value() const;
58
    void setValue(const String&);
58
    void setValue(const String&);
59
60
    virtual bool willValidate() const { return false; }
59
    
61
    
60
private:
62
private:
61
    enum Type { SUBMIT, RESET, BUTTON };
63
    enum Type { SUBMIT, RESET, BUTTON };
- a/WebCore/html/HTMLButtonElement.idl -1 / +1 lines
Lines 32-38 module html { a/WebCore/html/HTMLButtonElement.idl_sec1
32
                 attribute  [ConvertNullToNullString] DOMString            name;
32
                 attribute  [ConvertNullToNullString] DOMString            name;
33
        readonly attribute  DOMString            type;
33
        readonly attribute  DOMString            type;
34
                 attribute  [ConvertNullToNullString] DOMString            value;
34
                 attribute  [ConvertNullToNullString] DOMString            value;
35
35
        readonly attribute boolean               willValidate;
36
        void click();
36
        void click();
37
    };
37
    };
38
38
- a/WebCore/html/HTMLFieldSetElement.h +2 lines
Lines 49-54 public: a/WebCore/html/HTMLFieldSetElement.h_sec1
49
    virtual bool isFocusable() const;
49
    virtual bool isFocusable() const;
50
    virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
50
    virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
51
    virtual const AtomicString& type() const;
51
    virtual const AtomicString& type() const;
52
53
    virtual bool willValidate() const { return false; }
52
};
54
};
53
55
54
} //namespace
56
} //namespace
- a/WebCore/html/HTMLFieldSetElement.idl +1 lines
Lines 25-30 module html { a/WebCore/html/HTMLFieldSetElement.idl_sec1
25
        ImplementationUUID=93573758-96db-415d-9bdc-ee7238604094
25
        ImplementationUUID=93573758-96db-415d-9bdc-ee7238604094
26
    ] HTMLFieldSetElement : HTMLElement {
26
    ] HTMLFieldSetElement : HTMLElement {
27
        readonly attribute HTMLFormElement form;
27
        readonly attribute HTMLFormElement form;
28
        readonly attribute boolean         willValidate;
28
    };
29
    };
29
30
30
}
31
}
- a/WebCore/html/HTMLFormControlElement.cpp +9 lines
Lines 223-228 short HTMLFormControlElement::tabIndex() const a/WebCore/html/HTMLFormControlElement.cpp_sec1
223
{
223
{
224
    return Element::tabIndex();
224
    return Element::tabIndex();
225
}
225
}
226
227
bool HTMLFormControlElement::willValidate() const
228
{
229
    // FIXME: Implementation shall be completed with these checks:
230
    //      The control does not have a repetition template as an ancestor.
231
    //      The control does not have a datalist element as an ancestor.
232
    //      The control is not an output element.
233
    return form() && name().length() && !disabled() && !isReadOnlyControl();
234
}
226
    
235
    
227
bool HTMLFormControlElement::supportsFocus() const
236
bool HTMLFormControlElement::supportsFocus() const
228
{
237
{
- a/WebCore/html/HTMLFormControlElement.h +2 lines
Lines 93-98 public: a/WebCore/html/HTMLFormControlElement.h_sec1
93
93
94
    short tabIndex() const;
94
    short tabIndex() const;
95
95
96
    virtual bool willValidate() const;
97
96
    void formDestroyed() { m_form = 0; }
98
    void formDestroyed() { m_form = 0; }
97
99
98
protected:
100
protected:
- a/WebCore/html/HTMLInputElement.cpp +6 lines
Lines 1578-1581 void HTMLInputElement::getSubresourceAttributeStrings(Vector<String>& urls) cons a/WebCore/html/HTMLInputElement.cpp_sec1
1578
    urls.append(src().string());  
1578
    urls.append(src().string());  
1579
}
1579
}
1580
1580
1581
bool HTMLInputElement::willValidate() const
1582
{
1583
    // FIXME: This shall check for new WF2 input types too
1584
    return HTMLFormControlElementWithState::willValidate() && inputType() != HIDDEN &&
1585
           inputType() != BUTTON && inputType() != RESET;
1586
}
1581
} // namespace
1587
} // namespace
- a/WebCore/html/HTMLInputElement.h +2 lines
Lines 196-201 public: a/WebCore/html/HTMLInputElement.h_sec1
196
196
197
    virtual void getSubresourceAttributeStrings(Vector<String>&) const;
197
    virtual void getSubresourceAttributeStrings(Vector<String>&) const;
198
    
198
    
199
    virtual bool willValidate() const;
200
199
protected:
201
protected:
200
    virtual void willMoveToNewOwnerDocument();
202
    virtual void willMoveToNewOwnerDocument();
201
    virtual void didMoveToNewOwnerDocument();
203
    virtual void didMoveToNewOwnerDocument();
- a/WebCore/html/HTMLInputElement.idl -1 / +1 lines
Lines 49-55 module html { a/WebCore/html/HTMLInputElement.idl_sec1
49
                 attribute [ConvertNullToNullString] DOMString type; // readonly dropped as part of DOM level 2
49
                 attribute [ConvertNullToNullString] DOMString type; // readonly dropped as part of DOM level 2
50
                 attribute [ConvertNullToNullString] DOMString useMap;
50
                 attribute [ConvertNullToNullString] DOMString useMap;
51
                 attribute [ConvertNullToNullString] DOMString value;
51
                 attribute [ConvertNullToNullString] DOMString value;
52
        
52
        readonly attribute boolean         willValidate;
53
        void               select();
53
        void               select();
54
        void               click();
54
        void               click();
55
        
55
        
- a/WebCore/html/HTMLSelectElement.idl +1 lines
Lines 41-46 module html { a/WebCore/html/HTMLSelectElement.idl_sec1
41
#endif
41
#endif
42
42
43
        readonly attribute HTMLFormElement form;
43
        readonly attribute HTMLFormElement form;
44
        readonly attribute boolean         willValidate;
44
45
45
        // Modified in DOM Level 2:
46
        // Modified in DOM Level 2:
46
        readonly attribute HTMLOptionsCollection options;
47
        readonly attribute HTMLOptionsCollection options;
- a/WebCore/html/HTMLTextAreaElement.idl +2 lines
Lines 39-44 module html { a/WebCore/html/HTMLTextAreaElement.idl_sec1
39
        
39
        
40
        void     select();
40
        void     select();
41
41
42
        readonly attribute boolean         willValidate;
43
42
       // WinIE & FireFox extension:
44
       // WinIE & FireFox extension:
43
                 attribute long selectionStart;
45
                 attribute long selectionStart;
44
                 attribute long selectionEnd;
46
                 attribute long selectionEnd;

Return to Bug 20101