+2011-10-21 Vineet Chaudhary <vineet.chaudhary@motorola.com>
+
+ Setting form.enctype reflected attribute behaves strangely.
+ https://bugs.webkit.org/show_bug.cgi?id=44879
+
+ Reviewed by Darin Adler.
+
+ Leading/trailing white-spaces should not be allowed while specifying attribute value.
+ Added more test coverage for form.enctype attribute.
+
+ * fast/forms/encoding-test.html:
+ * fast/forms/enctype-attribute-expected.txt:
+ * fast/forms/enctype-attribute.html: Corrected test case as per new behavior.
+
2011-10-21 Julien Chaffraix <jchaffraix@webkit.org>
Gardening update.
<input type=text>
</form>
<script>
-document.forms[0].enctype = 'multipart/formdata';
+document.forms[0].enctype = 'multipart/form-data';
document.write(document.forms[0].encoding);
</script>
PASS form1.getAttribute("enctype") is "foobar"
PASS form1.setAttribute("enctype", "baz"); form1.enctype is "application/x-www-form-urlencoded"
+Text and its subtypes:
+PASS form1.enctype = "text"; form1.enctype is "application/x-www-form-urlencoded"
+PASS form1.enctype = "plain"; form1.enctype is "application/x-www-form-urlencoded"
+PASS form1.enctype = "text/1d-interleaved-parityfec"; form1.enctype is "application/x-www-form-urlencoded"
+PASS form1.enctype = "text/calendar"; form1.enctype is "application/x-www-form-urlencoded"
+PASS form1.enctype = "text/css"; form1.enctype is "application/x-www-form-urlencoded"
+PASS form1.enctype = "text/csv"; form1.enctype is "application/x-www-form-urlencoded"
+PASS form1.enctype = "text/dns"; form1.enctype is "application/x-www-form-urlencoded"
+PASS form1.enctype = "text/enriched"; form1.enctype is "application/x-www-form-urlencoded"
+PASS form1.enctype = "text/example"; form1.enctype is "application/x-www-form-urlencoded"
+PASS form1.enctype = "text/fwdred"; form1.enctype is "application/x-www-form-urlencoded"
+PASS form1.enctype = "text/html"; form1.enctype is "application/x-www-form-urlencoded"
+PASS form1.enctype = "text/rfc822-headers"; form1.enctype is "application/x-www-form-urlencoded"
+PASS form1.enctype = "text/richtext"; form1.enctype is "application/x-www-form-urlencoded"
+PASS form1.enctype = "text/rtx"; form1.enctype is "application/x-www-form-urlencoded"
+PASS form1.enctype = "text/sgml"; form1.enctype is "application/x-www-form-urlencoded"
+PASS form1.enctype = "text/t140"; form1.enctype is "application/x-www-form-urlencoded"
+PASS form1.enctype = "text/troff"; form1.enctype is "application/x-www-form-urlencoded"
+PASS form1.enctype = "text/ulpfec"; form1.enctype is "application/x-www-form-urlencoded"
+PASS form1.enctype = "text/uri-list"; form1.enctype is "application/x-www-form-urlencoded"
+PASS form1.enctype = "text/vcard"; form1.enctype is "application/x-www-form-urlencoded"
+PASS form1.enctype = "text/xml"; form1.enctype is "application/x-www-form-urlencoded"
+PASS form1.enctype = "text/xml-external-parsed-entity"; form1.enctype is "application/x-www-form-urlencoded"
+
+Multipart and its subtypes:
+PASS form1.enctype = "multipart"; form1.enctype is "application/x-www-form-urlencoded"
+PASS form1.enctype = "form-data"; form1.enctype is "application/x-www-form-urlencoded"
+PASS form1.enctype = "multipart/mixed"; form1.enctype is "application/x-www-form-urlencoded"
+PASS form1.enctype = "multipart/message"; form1.enctype is "application/x-www-form-urlencoded"
+PASS form1.enctype = "multipart/digest"; form1.enctype is "application/x-www-form-urlencoded"
+PASS form1.enctype = "multipart/alternative"; form1.enctype is "application/x-www-form-urlencoded"
+PASS form1.enctype = "multipart/alternative"; form1.enctype is "application/x-www-form-urlencoded"
+PASS form1.enctype = "multipart/byteranges"; form1.enctype is "application/x-www-form-urlencoded"
+PASS form1.enctype = "multipart/encrypted"; form1.enctype is "application/x-www-form-urlencoded"
+PASS form1.enctype = "multipart/example"; form1.enctype is "application/x-www-form-urlencoded"
+PASS form1.enctype = "multipart/parallel"; form1.enctype is "application/x-www-form-urlencoded"
+PASS form1.enctype = "multipart/related"; form1.enctype is "application/x-www-form-urlencoded"
+PASS form1.enctype = "multipart/report"; form1.enctype is "application/x-www-form-urlencoded"
+PASS form1.enctype = "multipart/signed"; form1.enctype is "application/x-www-form-urlencoded"
+
Valid values:
PASS form1.enctype = "Text/Plain"; form1.enctype is "text/plain"
PASS form1.getAttribute("enctype") is "Text/Plain"
PASS form1.setAttribute("enctype", "Text/Plain"); form1.enctype is "text/plain"
+PASS form1.enctype = "Multipart/Form-Data"; form1.enctype is "multipart/form-data"
+PASS form1.getAttribute("enctype") is "Multipart/Form-Data"
+PASS form1.setAttribute("enctype", "Multipart/Form-Data"); form1.enctype is "multipart/form-data"
-Valid values with whitespace:
-PASS form1.enctype = " multipart/form-data"; form1.enctype is "multipart/form-data"
+Values with whitespace:
+PASS form1.enctype = " multipart/form-data"; form1.enctype is "application/x-www-form-urlencoded"
PASS form1.getAttribute("enctype") is " multipart/form-data"
+PASS form1.enctype = "multipart/form-data "; form1.enctype is "application/x-www-form-urlencoded"
+PASS form1.getAttribute("enctype") is "multipart/form-data "
PASS form1.enctype = "application/x-www-form-urlencoded "; form1.enctype is "application/x-www-form-urlencoded"
PASS successfullyParsed is true
shouldBe('form1.enctype = "foobar"; form1.enctype', '"application/x-www-form-urlencoded"');
shouldBe('form1.getAttribute("enctype")', '"foobar"');
shouldBe('form1.setAttribute("enctype", "baz"); form1.enctype', '"application/x-www-form-urlencoded"');
+debug('');
+debug('Text and its subtypes:');
+shouldBe('form1.enctype = "text"; form1.enctype', '"application/x-www-form-urlencoded"');
+shouldBe('form1.enctype = "plain"; form1.enctype', '"application/x-www-form-urlencoded"');
+shouldBe('form1.enctype = "text/1d-interleaved-parityfec"; form1.enctype', '"application/x-www-form-urlencoded"');
+shouldBe('form1.enctype = "text/calendar"; form1.enctype', '"application/x-www-form-urlencoded"');
+shouldBe('form1.enctype = "text/css"; form1.enctype', '"application/x-www-form-urlencoded"');
+shouldBe('form1.enctype = "text/csv"; form1.enctype', '"application/x-www-form-urlencoded"');
+shouldBe('form1.enctype = "text/dns"; form1.enctype', '"application/x-www-form-urlencoded"');
+shouldBe('form1.enctype = "text/enriched"; form1.enctype', '"application/x-www-form-urlencoded"');
+shouldBe('form1.enctype = "text/example"; form1.enctype', '"application/x-www-form-urlencoded"');
+shouldBe('form1.enctype = "text/fwdred"; form1.enctype', '"application/x-www-form-urlencoded"');
+shouldBe('form1.enctype = "text/html"; form1.enctype', '"application/x-www-form-urlencoded"');
+shouldBe('form1.enctype = "text/rfc822-headers"; form1.enctype', '"application/x-www-form-urlencoded"');
+shouldBe('form1.enctype = "text/richtext"; form1.enctype', '"application/x-www-form-urlencoded"');
+shouldBe('form1.enctype = "text/rtx"; form1.enctype', '"application/x-www-form-urlencoded"');
+shouldBe('form1.enctype = "text/sgml"; form1.enctype', '"application/x-www-form-urlencoded"');
+shouldBe('form1.enctype = "text/t140"; form1.enctype', '"application/x-www-form-urlencoded"');
+shouldBe('form1.enctype = "text/troff"; form1.enctype', '"application/x-www-form-urlencoded"');
+shouldBe('form1.enctype = "text/ulpfec"; form1.enctype', '"application/x-www-form-urlencoded"');
+shouldBe('form1.enctype = "text/uri-list"; form1.enctype', '"application/x-www-form-urlencoded"');
+shouldBe('form1.enctype = "text/vcard"; form1.enctype', '"application/x-www-form-urlencoded"');
+shouldBe('form1.enctype = "text/xml"; form1.enctype', '"application/x-www-form-urlencoded"');
+shouldBe('form1.enctype = "text/xml-external-parsed-entity"; form1.enctype', '"application/x-www-form-urlencoded"');
+debug('');
+debug('Multipart and its subtypes:');
+shouldBe('form1.enctype = "multipart"; form1.enctype', '"application/x-www-form-urlencoded"');
+shouldBe('form1.enctype = "form-data"; form1.enctype', '"application/x-www-form-urlencoded"');
+shouldBe('form1.enctype = "multipart/mixed"; form1.enctype', '"application/x-www-form-urlencoded"');
+shouldBe('form1.enctype = "multipart/message"; form1.enctype', '"application/x-www-form-urlencoded"');
+shouldBe('form1.enctype = "multipart/digest"; form1.enctype', '"application/x-www-form-urlencoded"');
+shouldBe('form1.enctype = "multipart/alternative"; form1.enctype', '"application/x-www-form-urlencoded"');
+shouldBe('form1.enctype = "multipart/alternative"; form1.enctype', '"application/x-www-form-urlencoded"');
+shouldBe('form1.enctype = "multipart/byteranges"; form1.enctype', '"application/x-www-form-urlencoded"');
+shouldBe('form1.enctype = "multipart/encrypted"; form1.enctype', '"application/x-www-form-urlencoded"');
+shouldBe('form1.enctype = "multipart/example"; form1.enctype', '"application/x-www-form-urlencoded"');
+shouldBe('form1.enctype = "multipart/parallel"; form1.enctype', '"application/x-www-form-urlencoded"');
+shouldBe('form1.enctype = "multipart/related"; form1.enctype', '"application/x-www-form-urlencoded"');
+shouldBe('form1.enctype = "multipart/report"; form1.enctype', '"application/x-www-form-urlencoded"');
+shouldBe('form1.enctype = "multipart/signed"; form1.enctype', '"application/x-www-form-urlencoded"');
debug('');
debug('Valid values:');
shouldBe('form1.enctype = "Text/Plain"; form1.enctype', '"text/plain"');
shouldBe('form1.getAttribute("enctype")', '"Text/Plain"');
shouldBe('form1.setAttribute("enctype", "Text/Plain"); form1.enctype', '"text/plain"');
+shouldBe('form1.enctype = "Multipart/Form-Data"; form1.enctype', '"multipart/form-data"');
+shouldBe('form1.getAttribute("enctype")', '"Multipart/Form-Data"');
+shouldBe('form1.setAttribute("enctype", "Multipart/Form-Data"); form1.enctype', '"multipart/form-data"');
+
debug('');
-debug('Valid values with whitespace:');
+debug('Values with whitespace:');
// Note: IE9 thorws "Invalid argument.", Firefox 6 doesn't allow leading whitespace.
// Firefox matches to the specification.
-shouldBe('form1.enctype = " multipart/form-data"; form1.enctype', '"multipart/form-data"');
+shouldBe('form1.enctype = " multipart/form-data"; form1.enctype', '"application/x-www-form-urlencoded"');
shouldBe('form1.getAttribute("enctype")', '" multipart/form-data"');
+shouldBe('form1.enctype = "multipart/form-data "; form1.enctype', '"application/x-www-form-urlencoded"');
+shouldBe('form1.getAttribute("enctype")', '"multipart/form-data "');
shouldBe('form1.enctype = "application/x-www-form-urlencoded "; form1.enctype', '"application/x-www-form-urlencoded"');
+2011-10-21 Vineet Chaudhary <vineet.chaudhary@motorola.com>
+
+ Setting form.enctype reflected attribute behaves strangely.
+ https://bugs.webkit.org/show_bug.cgi?id=44879
+
+ Reviewed by Darin Adler.
+
+ The spec says form.enctype should be application/x-www-form-urlencoded,
+ So as "text", "plain", "multipart" or "form-data" these are not a valid value so must be ignored.
+
+ * loader/FormSubmission.cpp:
+ (WebCore::FormSubmission::Attributes::parseEncodingType):
+
2011-10-21 Matthew Delaney <mdelaney@apple.com>
Ensure periodic flushing of canvas drawing context
String FormSubmission::Attributes::parseEncodingType(const String& type)
{
- if (type.contains("multipart", false) || type.contains("form-data", false))
+ if (equalIgnoringCase(type, "multipart/form-data"))
return "multipart/form-data";
- if (type.contains("text", false) || type.contains("plain", false))
+ if (equalIgnoringCase(type, "text/plain"))
return "text/plain";
return "application/x-www-form-urlencoded";
}