Changeset 141405 in webkit


Ignore:
Timestamp:
Jan 31, 2013 5:01:58 AM (11 years ago)
Author:
Vineet
Message:

formMethod to have empty string as default value and 'get' as invalid.
https://bugs.webkit.org/show_bug.cgi?id=108263

Reviewed by Kent Tamura.

The spec says formmethod should only have an invalid value default, not a missing value default.
Spec: http://www.whatwg.org/specs/web-apps/current-work/#form-submission-0

http://www.w3.org/html/wg/drafts/html/master/forms.html#attr-fs-formmethod

Source/WebCore:

Test: fast/forms/formmethod-attribute-test.html

  • html/HTMLFormControlElement.cpp: For the missing formMethod attr return empty string.

(WebCore::HTMLFormControlElement::formMethod):

LayoutTests:

  • fast/forms/formmethod-attribute-test-expected.txt: Added.
  • fast/forms/formmethod-attribute-test.html: Added.
  • fast/forms/submit-form-attributes-expected.txt:
  • fast/forms/submit-form-attributes.html: Modified test to behave as expected.
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r141403 r141405  
     12013-01-31   Vineet Chaudhary  <rgf748@motorola.com>
     2
     3        formMethod to have empty string as default value and 'get' as invalid.
     4        https://bugs.webkit.org/show_bug.cgi?id=108263
     5
     6        Reviewed by Kent Tamura.
     7
     8        The spec says formmethod should only have an invalid value default, not a missing value default.
     9        Spec: http://www.whatwg.org/specs/web-apps/current-work/#form-submission-0
     10              http://www.w3.org/html/wg/drafts/html/master/forms.html#attr-fs-formmethod
     11
     12        * fast/forms/formmethod-attribute-test-expected.txt: Added.
     13        * fast/forms/formmethod-attribute-test.html: Added.
     14        * fast/forms/submit-form-attributes-expected.txt:
     15        * fast/forms/submit-form-attributes.html: Modified test to behave as expected.
     16
    1172013-01-31  Andrey Adaikin  <aandrey@chromium.org>
    218
  • trunk/LayoutTests/fast/forms/submit-form-attributes-expected.txt

    r96484 r141405  
    77PASS input.formAction is ""
    88PASS input.formEnctype is "application/x-www-form-urlencoded"
    9 PASS input.formMethod is "get"
     9PASS input.formMethod is ""
    1010PASS input.formTarget is ""
    1111PASS input.formAction is "http://localhost/"
     
    3030PASS input.getAttribute("formEnctype") is null
    3131PASS input.formEnctype is "application/x-www-form-urlencoded"
    32 PASS input.formMethod is "get"
     32PASS input.formMethod is ""
    3333PASS input.getAttribute("formMethod") is null
    3434PASS input.formMethod is "get"
     
    6262PASS button.formAction is ""
    6363PASS button.formEnctype is "application/x-www-form-urlencoded"
    64 PASS button.formMethod is "get"
     64PASS button.formMethod is ""
    6565PASS button.formTarget is ""
    6666PASS button.formAction is "http://localhost/"
     
    8585PASS button.getAttribute("formEnctype") is null
    8686PASS button.formEnctype is "application/x-www-form-urlencoded"
    87 PASS button.formMethod is "get"
     87PASS button.formMethod is ""
    8888PASS button.getAttribute("formMethod") is null
    8989PASS button.formMethod is "get"
  • trunk/LayoutTests/fast/forms/submit-form-attributes.html

    r107781 r141405  
    1616shouldBe('input.formAction', '""');
    1717shouldBe('input.formEnctype', '"application/x-www-form-urlencoded"');
    18 shouldBe('input.formMethod', '"get"');
     18shouldBeEqualToString("input.formMethod", "");
    1919shouldBe('input.formTarget', '""');
    2020
     
    6161shouldBe('input.formEnctype', '"application/x-www-form-urlencoded"');
    6262input.formMethod = null;
    63 shouldBe('input.formMethod', '"get"');
     63shouldBeEqualToString("input.formMethod", "");
    6464shouldBe('input.getAttribute("formMethod")', 'null');
    6565input.setAttribute('formMethod', null);
     
    113113shouldBe('button.formAction', '""');
    114114shouldBe('button.formEnctype', '"application/x-www-form-urlencoded"');
    115 shouldBe('button.formMethod', '"get"');
     115shouldBeEqualToString("button.formMethod", "");
    116116shouldBe('button.formTarget', '""');
    117117
     
    158158shouldBe('button.formEnctype', '"application/x-www-form-urlencoded"');
    159159button.formMethod = null;
    160 shouldBe('button.formMethod', '"get"');
     160shouldBeEqualToString("button.formMethod", "");
    161161shouldBe('button.getAttribute("formMethod")', 'null');
    162162button.setAttribute('formMethod', null);
  • trunk/Source/WebCore/ChangeLog

    r141404 r141405  
     12013-01-31   Vineet Chaudhary  <rgf748@motorola.com>
     2
     3        formMethod to have empty string as default value and 'get' as invalid.
     4        https://bugs.webkit.org/show_bug.cgi?id=108263
     5
     6        Reviewed by Kent Tamura.
     7
     8        The spec says formmethod should only have an invalid value default, not a missing value default.
     9        Spec: http://www.whatwg.org/specs/web-apps/current-work/#form-submission-0
     10              http://www.w3.org/html/wg/drafts/html/master/forms.html#attr-fs-formmethod
     11
     12        Test: fast/forms/formmethod-attribute-test.html
     13
     14        * html/HTMLFormControlElement.cpp: For the missing formMethod attr return empty string.
     15        (WebCore::HTMLFormControlElement::formMethod):
     16
    1172013-01-20 Kondapally Kalyan <kalyan.kondapally@intel.com>
    218
  • trunk/Source/WebCore/html/HTMLFormControlElement.cpp

    r141292 r141405  
    8383String HTMLFormControlElement::formMethod() const
    8484{
    85     return FormSubmission::Attributes::methodString(FormSubmission::Attributes::parseMethodType(fastGetAttribute(formmethodAttr)));
     85    const AtomicString& formMethodAttr = fastGetAttribute(formmethodAttr);
     86    if (formMethodAttr.isNull())
     87        return emptyString();
     88    return FormSubmission::Attributes::methodString(FormSubmission::Attributes::parseMethodType(formMethodAttr));
    8689}
    8790
Note: See TracChangeset for help on using the changeset viewer.