Backed out changeset 444a4a7233f7 (bug 1278737) for frequent web platform test 2 failure on OSX in form-validation-reportValidity.html. r=backout

This commit is contained in:
Sebastian Hengst
2016-07-01 20:04:58 +02:00
parent f3498d4dbf
commit b74bde4463
33 changed files with 119 additions and 264 deletions

View File

@@ -220,7 +220,7 @@ add_task(function* test_search_input() {
}); });
add_task(function* test_datetime_month_week_datetimelocal_input_todos() { add_task(function* test_datetime_month_week_datetimelocal_input_todos() {
for (let type of ["datetime", "week", "datetime-local"]) { for (let type of ["datetime", "month", "week", "datetime-local"]) {
let returnedType = yield ContentTask.spawn(gBrowser.selectedBrowser, type, function*(type) { let returnedType = yield ContentTask.spawn(gBrowser.selectedBrowser, type, function*(type) {
let doc = content.document; let doc = content.document;
let input = doc.getElementById("input_" + type); let input = doc.getElementById("input_" + type);

View File

@@ -47,7 +47,6 @@ HTMLFormControlsCollection::ShouldBeInElements(nsIFormControl* aFormControl)
case NS_FORM_INPUT_TEXT : case NS_FORM_INPUT_TEXT :
case NS_FORM_INPUT_TEL : case NS_FORM_INPUT_TEL :
case NS_FORM_INPUT_URL : case NS_FORM_INPUT_URL :
case NS_FORM_INPUT_MONTH :
case NS_FORM_INPUT_NUMBER : case NS_FORM_INPUT_NUMBER :
case NS_FORM_INPUT_RANGE : case NS_FORM_INPUT_RANGE :
case NS_FORM_INPUT_DATE : case NS_FORM_INPUT_DATE :

View File

@@ -165,7 +165,6 @@ static const nsAttrValue::EnumTable kInputTypeTable[] = {
{ "hidden", NS_FORM_INPUT_HIDDEN }, { "hidden", NS_FORM_INPUT_HIDDEN },
{ "reset", NS_FORM_INPUT_RESET }, { "reset", NS_FORM_INPUT_RESET },
{ "image", NS_FORM_INPUT_IMAGE }, { "image", NS_FORM_INPUT_IMAGE },
{ "month", NS_FORM_INPUT_MONTH },
{ "number", NS_FORM_INPUT_NUMBER }, { "number", NS_FORM_INPUT_NUMBER },
{ "password", NS_FORM_INPUT_PASSWORD }, { "password", NS_FORM_INPUT_PASSWORD },
{ "radio", NS_FORM_INPUT_RADIO }, { "radio", NS_FORM_INPUT_RADIO },
@@ -180,7 +179,7 @@ static const nsAttrValue::EnumTable kInputTypeTable[] = {
}; };
// Default type is 'text'. // Default type is 'text'.
static const nsAttrValue::EnumTable* kInputDefaultType = &kInputTypeTable[17]; static const nsAttrValue::EnumTable* kInputDefaultType = &kInputTypeTable[16];
static const uint8_t NS_INPUT_INPUTMODE_AUTO = 0; static const uint8_t NS_INPUT_INPUTMODE_AUTO = 0;
static const uint8_t NS_INPUT_INPUTMODE_NUMERIC = 1; static const uint8_t NS_INPUT_INPUTMODE_NUMERIC = 1;
@@ -2137,9 +2136,9 @@ HTMLInputElement::GetValue(nsAString& aValue)
return rv; return rv;
} }
// Don't return non-sanitized value for types that are experimental on mobile // Don't return non-sanitized value for types that are experimental on mobile.
// or datetime types // or date types
if (IsExperimentalMobileType(mType) || IsDateTimeInputType(mType)) { if (IsExperimentalMobileType(mType) || mType == NS_FORM_INPUT_DATE) {
SanitizeValue(aValue); SanitizeValue(aValue);
} }
@@ -2777,19 +2776,9 @@ HTMLInputElement::ApplyStep(int32_t aStep)
bool bool
HTMLInputElement::IsExperimentalMobileType(uint8_t aType) HTMLInputElement::IsExperimentalMobileType(uint8_t aType)
{ {
return (aType == NS_FORM_INPUT_DATE && return aType == NS_FORM_INPUT_TIME ||
!Preferences::GetBool("dom.forms.datetime", false) && (aType == NS_FORM_INPUT_DATE &&
!Preferences::GetBool("dom.forms.datepicker", false)) || !Preferences::GetBool("dom.forms.datepicker", false));
(aType == NS_FORM_INPUT_TIME &&
!Preferences::GetBool("dom.forms.datetime", false));
}
bool
HTMLInputElement::IsDateTimeInputType(uint8_t aType)
{
return aType == NS_FORM_INPUT_DATE || aType == NS_FORM_INPUT_TIME ||
aType == NS_FORM_INPUT_MONTH;
} }
NS_IMETHODIMP NS_IMETHODIMP
@@ -2980,8 +2969,8 @@ HTMLInputElement::MozSetDirectory(const nsAString& aDirectoryPath,
bool bool
HTMLInputElement::MozIsTextField(bool aExcludePassword) HTMLInputElement::MozIsTextField(bool aExcludePassword)
{ {
// TODO: temporary until bug 888320 is fixed. // TODO: temporary until bug 773205 is fixed.
if (IsExperimentalMobileType(mType) || IsDateTimeInputType(mType)) { if (IsExperimentalMobileType(mType) || mType == NS_FORM_INPUT_DATE) {
return false; return false;
} }
@@ -4019,7 +4008,7 @@ HTMLInputElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
// Experimental mobile types rely on the system UI to prevent users to not // Experimental mobile types rely on the system UI to prevent users to not
// set invalid values but we have to be extra-careful. Especially if the // set invalid values but we have to be extra-careful. Especially if the
// option has been enabled on desktop. // option has been enabled on desktop.
if (IsExperimentalMobileType(mType) || IsDateTimeInputType(mType)) { if (IsExperimentalMobileType(mType) || mType == NS_FORM_INPUT_DATE) {
nsAutoString aValue; nsAutoString aValue;
GetValueInternal(aValue); GetValueInternal(aValue);
nsresult rv = nsresult rv =
@@ -4719,7 +4708,7 @@ HTMLInputElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
(IsSingleLineTextControl(false, mType) || (IsSingleLineTextControl(false, mType) ||
mType == NS_FORM_INPUT_NUMBER || mType == NS_FORM_INPUT_NUMBER ||
IsExperimentalMobileType(mType) || IsExperimentalMobileType(mType) ||
IsDateTimeInputType(mType))) { mType == NS_FORM_INPUT_DATE)) {
FireChangeEventIfNeeded(); FireChangeEventIfNeeded();
rv = MaybeSubmitForm(aVisitor.mPresContext); rv = MaybeSubmitForm(aVisitor.mPresContext);
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
@@ -5516,20 +5505,6 @@ HTMLInputElement::ParseTime(const nsAString& aValue, uint32_t* aResult)
return true; return true;
} }
static bool
IsDateTimeEnabled(int32_t aNewType)
{
return (aNewType == NS_FORM_INPUT_DATE &&
(Preferences::GetBool("dom.forms.datetime", false) ||
Preferences::GetBool("dom.experimental_forms", false) ||
Preferences::GetBool("dom.forms.datepicker", false))) ||
(aNewType == NS_FORM_INPUT_TIME &&
(Preferences::GetBool("dom.forms.datetime", false) ||
Preferences::GetBool("dom.experimental_forms", false))) ||
(aNewType == NS_FORM_INPUT_MONTH &&
Preferences::GetBool("dom.forms.datetime", false));
}
bool bool
HTMLInputElement::ParseAttribute(int32_t aNamespaceID, HTMLInputElement::ParseAttribute(int32_t aNamespaceID,
nsIAtom* aAttribute, nsIAtom* aAttribute,
@@ -5549,8 +5524,7 @@ HTMLInputElement::ParseAttribute(int32_t aNamespaceID,
(newType == NS_FORM_INPUT_NUMBER && (newType == NS_FORM_INPUT_NUMBER &&
!Preferences::GetBool("dom.forms.number", false)) || !Preferences::GetBool("dom.forms.number", false)) ||
(newType == NS_FORM_INPUT_COLOR && (newType == NS_FORM_INPUT_COLOR &&
!Preferences::GetBool("dom.forms.color", false)) || !Preferences::GetBool("dom.forms.color", false))) {
(IsDateTimeInputType(newType) && !IsDateTimeEnabled(newType))) {
newType = kInputDefaultType->value; newType = kInputDefaultType->value;
aResult.SetTo(newType, &aValue); aResult.SetTo(newType, &aValue);
} }
@@ -6936,7 +6910,6 @@ HTMLInputElement::GetValueMode() const
case NS_FORM_INPUT_DATE: case NS_FORM_INPUT_DATE:
case NS_FORM_INPUT_TIME: case NS_FORM_INPUT_TIME:
case NS_FORM_INPUT_COLOR: case NS_FORM_INPUT_COLOR:
case NS_FORM_INPUT_MONTH:
return VALUE_MODE_VALUE; return VALUE_MODE_VALUE;
default: default:
NS_NOTYETIMPLEMENTED("Unexpected input type in GetValueMode()"); NS_NOTYETIMPLEMENTED("Unexpected input type in GetValueMode()");
@@ -6982,7 +6955,6 @@ HTMLInputElement::DoesReadOnlyApply() const
case NS_FORM_INPUT_NUMBER: case NS_FORM_INPUT_NUMBER:
case NS_FORM_INPUT_DATE: case NS_FORM_INPUT_DATE:
case NS_FORM_INPUT_TIME: case NS_FORM_INPUT_TIME:
case NS_FORM_INPUT_MONTH:
return true; return true;
default: default:
NS_NOTYETIMPLEMENTED("Unexpected input type in DoesReadOnlyApply()"); NS_NOTYETIMPLEMENTED("Unexpected input type in DoesReadOnlyApply()");
@@ -7020,7 +6992,6 @@ HTMLInputElement::DoesRequiredApply() const
case NS_FORM_INPUT_NUMBER: case NS_FORM_INPUT_NUMBER:
case NS_FORM_INPUT_DATE: case NS_FORM_INPUT_DATE:
case NS_FORM_INPUT_TIME: case NS_FORM_INPUT_TIME:
case NS_FORM_INPUT_MONTH:
return true; return true;
default: default:
NS_NOTYETIMPLEMENTED("Unexpected input type in DoesRequiredApply()"); NS_NOTYETIMPLEMENTED("Unexpected input type in DoesRequiredApply()");
@@ -7035,7 +7006,8 @@ HTMLInputElement::DoesRequiredApply() const
bool bool
HTMLInputElement::PlaceholderApplies() const HTMLInputElement::PlaceholderApplies() const
{ {
if (IsDateTimeInputType(mType)) { if (mType == NS_FORM_INPUT_DATE ||
mType == NS_FORM_INPUT_TIME) {
return false; return false;
} }
@@ -7046,7 +7018,7 @@ bool
HTMLInputElement::DoesPatternApply() const HTMLInputElement::DoesPatternApply() const
{ {
// TODO: temporary until bug 773205 is fixed. // TODO: temporary until bug 773205 is fixed.
if (IsExperimentalMobileType(mType) || IsDateTimeInputType(mType)) { if (IsExperimentalMobileType(mType)) {
return false; return false;
} }
@@ -7062,7 +7034,6 @@ HTMLInputElement::DoesMinMaxApply() const
case NS_FORM_INPUT_DATE: case NS_FORM_INPUT_DATE:
case NS_FORM_INPUT_TIME: case NS_FORM_INPUT_TIME:
case NS_FORM_INPUT_RANGE: case NS_FORM_INPUT_RANGE:
case NS_FORM_INPUT_MONTH:
// TODO: // TODO:
// All date/time types. // All date/time types.
return true; return true;
@@ -7110,7 +7081,6 @@ HTMLInputElement::DoesAutocompleteApply() const
case NS_FORM_INPUT_NUMBER: case NS_FORM_INPUT_NUMBER:
case NS_FORM_INPUT_RANGE: case NS_FORM_INPUT_RANGE:
case NS_FORM_INPUT_COLOR: case NS_FORM_INPUT_COLOR:
case NS_FORM_INPUT_MONTH:
return true; return true;
#ifdef DEBUG #ifdef DEBUG
case NS_FORM_INPUT_RESET: case NS_FORM_INPUT_RESET:
@@ -7288,8 +7258,7 @@ HTMLInputElement::HasPatternMismatch() const
bool bool
HTMLInputElement::IsRangeOverflow() const HTMLInputElement::IsRangeOverflow() const
{ {
// TODO: this is temporary until bug 888324 is fixed. if (!DoesMinMaxApply()) {
if (!DoesMinMaxApply() || mType == NS_FORM_INPUT_MONTH) {
return false; return false;
} }
@@ -7309,8 +7278,7 @@ HTMLInputElement::IsRangeOverflow() const
bool bool
HTMLInputElement::IsRangeUnderflow() const HTMLInputElement::IsRangeUnderflow() const
{ {
// TODO: this is temporary until bug 888324 is fixed. if (!DoesMinMaxApply()) {
if (!DoesMinMaxApply() || mType == NS_FORM_INPUT_MONTH) {
return false; return false;
} }
@@ -8289,8 +8257,7 @@ HTMLInputElement::UpdateHasRange()
mHasRange = false; mHasRange = false;
// TODO: this is temporary until bug 888324 is fixed. if (!DoesMinMaxApply()) {
if (!DoesMinMaxApply() || mType == NS_FORM_INPUT_MONTH) {
return; return;
} }

View File

@@ -1017,11 +1017,7 @@ protected:
/** /**
* Returns if the step attribute apply for the current type. * Returns if the step attribute apply for the current type.
*/ */
bool DoesStepApply() const bool DoesStepApply() const { return DoesMinMaxApply(); }
{
// TODO: this is temporary until bug 888324 is fixed.
return DoesMinMaxApply() && mType != NS_FORM_INPUT_MONTH;
}
/** /**
* Returns if stepDown and stepUp methods apply for the current type. * Returns if stepDown and stepUp methods apply for the current type.
@@ -1031,11 +1027,7 @@ protected:
/** /**
* Returns if valueAsNumber attribute applies for the current type. * Returns if valueAsNumber attribute applies for the current type.
*/ */
bool DoesValueAsNumberApply() const bool DoesValueAsNumberApply() const { return DoesMinMaxApply(); }
{
// TODO: this is temporary until bug 888324 is fixed.
return DoesMinMaxApply() && mType != NS_FORM_INPUT_MONTH;
}
/** /**
* Returns if autocomplete attribute applies for the current type. * Returns if autocomplete attribute applies for the current type.
@@ -1259,12 +1251,6 @@ protected:
*/ */
static bool IsExperimentalMobileType(uint8_t aType); static bool IsExperimentalMobileType(uint8_t aType);
/*
* Returns if the current type is one of the date/time input types: date,
* time and month. TODO: week and datetime-local.
*/
static bool IsDateTimeInputType(uint8_t aType);
/** /**
* Flushes the layout frame tree to make sure we have up-to-date frames. * Flushes the layout frame tree to make sure we have up-to-date frames.
*/ */

View File

@@ -55,7 +55,6 @@ enum InputElementTypes {
NS_FORM_INPUT_HIDDEN, NS_FORM_INPUT_HIDDEN,
NS_FORM_INPUT_RESET, NS_FORM_INPUT_RESET,
NS_FORM_INPUT_IMAGE, NS_FORM_INPUT_IMAGE,
NS_FORM_INPUT_MONTH,
NS_FORM_INPUT_NUMBER, NS_FORM_INPUT_NUMBER,
NS_FORM_INPUT_PASSWORD, NS_FORM_INPUT_PASSWORD,
NS_FORM_INPUT_RADIO, NS_FORM_INPUT_RADIO,
@@ -267,7 +266,6 @@ nsIFormControl::IsSingleLineTextControl(bool aExcludePassword, uint32_t aType)
// TODO: those are temporary until bug 773205 is fixed. // TODO: those are temporary until bug 773205 is fixed.
aType == NS_FORM_INPUT_DATE || aType == NS_FORM_INPUT_DATE ||
aType == NS_FORM_INPUT_TIME || aType == NS_FORM_INPUT_TIME ||
aType == NS_FORM_INPUT_MONTH ||
(!aExcludePassword && aType == NS_FORM_INPUT_PASSWORD); (!aExcludePassword && aType == NS_FORM_INPUT_PASSWORD);
} }

View File

@@ -11,6 +11,7 @@ support-files =
[test_change_event.html] [test_change_event.html]
skip-if = (buildapp == 'b2g' && toolkit != 'gonk') #Bug 931116, b2g desktop specific, initial triage skip-if = (buildapp == 'b2g' && toolkit != 'gonk') #Bug 931116, b2g desktop specific, initial triage
[test_datalist_element.html] [test_datalist_element.html]
[test_experimental_forms_pref.html]
[test_form_attribute-1.html] [test_form_attribute-1.html]
[test_form_attribute-2.html] [test_form_attribute-2.html]
[test_form_attribute-3.html] [test_form_attribute-3.html]
@@ -60,7 +61,6 @@ skip-if = (toolkit == 'gonk' && debug) #debug-only failure; bug 926546
skip-if = (buildapp == 'b2g' && toolkit != 'gonk') #Bug 931116, b2g desktop specific, initial triage skip-if = (buildapp == 'b2g' && toolkit != 'gonk') #Bug 931116, b2g desktop specific, initial triage
[test_input_sanitization.html] [test_input_sanitization.html]
[test_input_textarea_set_value_no_scroll.html] [test_input_textarea_set_value_no_scroll.html]
[test_input_types_pref.html]
[test_input_typing_sanitization.html] [test_input_typing_sanitization.html]
skip-if = buildapp == 'mulet' skip-if = buildapp == 'mulet'
[test_input_untrusted_key_events.html] [test_input_untrusted_key_events.html]

View File

@@ -0,0 +1,51 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=764481
-->
<head>
<title>Test for Bug 764481</title>
<script type="application/javascript" src="/MochiKit/packed.js"></script>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=764481">Mozilla Bug 764481</a>
<p id="display"></p>
<div id="content" style="display: none" >
</div>
<pre id="test">
<script type="application/javascript">
var input = document.createElement("input");
SimpleTest.waitForExplicitFinish();
SpecialPowers.pushPrefEnv({'set': [["dom.experimental_forms", false], ["dom.forms.datepicker",false]]}, function() {
input.type = "date";
is(input.type, "text", "input type shouldn't be date when the experimental forms are disabled");
is(input.getAttribute('type'), "date", "input 'type' attribute should not change");
SpecialPowers.pushPrefEnv({'set': [["dom.experimental_forms",true], ["dom.forms.datepicker",false]]}, function() {
// Change the type of input to text and then back to date,
// so that HTMLInputElement::ParseAttribute gets called with the pref enabled.
input.type = "text";
input.type = "date";
is(input.type, "date", "input type should be date when the experimental forms are enabled");
is(input.getAttribute('type'), "date", "input 'type' attribute should not change");
SpecialPowers.pushPrefEnv({'set': [["dom.experimental_forms",false], ["dom.forms.datepicker",true]]}, function() {
// Change the type of input to text and then back to date,
// so that HTMLInputElement::ParseAttribute gets called with the pref enabled.
input.type = "text";
input.type = "date";
is(input.type, "date", "input type should be date when the datepicker is enabled");
is(input.getAttribute('type'), "date", "input 'type' attribute should not change");
SimpleTest.finish();
});
});
});
</script>
</pre>
</body>
</html>

View File

@@ -234,10 +234,10 @@ reflectLimitedEnumerated({
attribute: "type", attribute: "type",
validValues: [ "hidden", "text", "search", "tel", "url", "email", "password", validValues: [ "hidden", "text", "search", "tel", "url", "email", "password",
"checkbox", "radio", "file", "submit", "image", "reset", "checkbox", "radio", "file", "submit", "image", "reset",
"button", "date", "time", "number", "range", "color", "month" ], "button", "date", "time", "number", "range", "color" ],
invalidValues: [ "this-is-probably-a-wrong-type", "", "tulip" ], invalidValues: [ "this-is-probably-a-wrong-type", "", "tulip" ],
defaultValue: "text", defaultValue: "text",
unsupportedValues: [ "datetime", "week", "datetime-local" ] unsupportedValues: [ "datetime", "month", "week", "datetime-local" ]
}); });
// .defaultValue // .defaultValue

View File

@@ -79,7 +79,7 @@ var inputTypes =
var todoTypes = var todoTypes =
[ [
"week", "datetime", "datetime-local", "month", "week", "datetime", "datetime-local",
]; ];
var valueModeValue = var valueModeValue =

View File

@@ -1,98 +0,0 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=764481
-->
<head>
<title>Test for Bug 764481</title>
<script type="application/javascript" src="/MochiKit/packed.js"></script>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=764481">Mozilla Bug 764481</a>
<p id="display"></p>
<div id="content" style="display: none" >
</div>
<pre id="test">
<script type="application/javascript">
var input = document.createElement("input");
var testData = [
{
prefs: [["dom.forms.number", false]],
inputType: "number",
expectedType: "text"
}, {
prefs: [["dom.forms.number", true]],
inputType: "number",
expectedType: "number"
}, {
prefs: [["dom.forms.color", false]],
inputType: "color",
expectedType: "text"
}, {
prefs: [["dom.forms.color", true]],
inputType: "color",
expectedType: "color"
}, {
prefs: [["dom.experimental_forms", false], ["dom.forms.datepicker", false],
["dom.forms.datetime", false]],
inputType: "date",
expectedType: "text"
}, {
prefs: [["dom.experimental_forms", true], ["dom.forms.datepicker", false],
["dom.forms.datetime", false]],
inputType: "date",
expectedType: "date"
}, {
prefs: [["dom.experimental_forms", false], ["dom.forms.datepicker", true],
["dom.forms.datetime", false]],
inputType: "date",
expectedType: "date"
}, {
prefs: [["dom.experimental_forms", false], ["dom.forms.datepicker", false],
["dom.forms.datetime", true]],
inputType: "date",
expectedType: "date"
}, {
prefs: [["dom.forms.datetime", false]],
inputType: "month",
expectedType: "text"
}, {
prefs: [["dom.forms.datetime", true]],
inputType: "month",
expectedType: "month"
}
];
function testInputTypePreference(aData) {
return SpecialPowers.pushPrefEnv({'set': aData.prefs})
.then(() => {
// Change the type of input to text and then back to the tested input type,
// so that HTMLInputElement::ParseAttribute gets called with the pref enabled.
input.type = "text";
input.type = aData.inputType;
is(input.type, aData.expectedType, "input type should be '" +
aData.expectedType + "'' when pref " + aData.prefs + " is set");
is(input.getAttribute('type'), aData.inputType,
"input 'type' attribute should not change");
});
}
SimpleTest.waitForExplicitFinish();
let promise = Promise.resolve();
for (let i = 0; i < testData.length; i++) {
let data = testData[i];
promise = promise.then(() => testInputTypePreference(data));
}
promise.catch(error => ok(false, "Promise reject: " + error))
.then(() => SimpleTest.finish());
</script>
</pre>
</body>
</html>

View File

@@ -182,6 +182,7 @@ function runTest()
] ]
}, },
{ type: 'week', todo: true }, { type: 'week', todo: true },
{ type: 'month', todo: true },
{ type: 'datetime', todo: true }, { type: 'datetime', todo: true },
{ type: 'datetime-local', todo: true }, { type: 'datetime-local', todo: true },
]; ];

View File

@@ -29,8 +29,7 @@ var data = [
{ type: 'password', apply: false }, { type: 'password', apply: false },
{ type: 'datetime', apply: true, todo: true }, { type: 'datetime', apply: true, todo: true },
{ type: 'date', apply: true }, { type: 'date', apply: true },
// TODO: temporary set to false until bug 888324 is fixed. { type: 'month', apply: true, todo: true },
{ type: 'month', apply: false },
{ type: 'week', apply: true, todo: true }, { type: 'week', apply: true, todo: true },
{ type: 'time', apply: true }, { type: 'time', apply: true },
{ type: 'datetime-local', apply: true, todo: true }, { type: 'datetime-local', apply: true, todo: true },
@@ -146,9 +145,6 @@ for (var test of data) {
// Now make it something that won't cause an error below: // Now make it something that won't cause an error below:
input.max = '10'; input.max = '10';
break; break;
case 'month':
// TODO: this is temporary until bug 888324 is fixed.
break;
default: default:
ok(false, 'please, add a case for this new type (' + input.type + ')'); ok(false, 'please, add a case for this new type (' + input.type + ')');
} }

View File

@@ -29,8 +29,7 @@ var data = [
{ type: 'password', apply: false }, { type: 'password', apply: false },
{ type: 'datetime', apply: true, todo: true }, { type: 'datetime', apply: true, todo: true },
{ type: 'date', apply: true }, { type: 'date', apply: true },
// TODO: temporary set to false until bug 888324 is fixed. { type: 'month', apply: true, todo: true },
{ type: 'month', apply: false },
{ type: 'week', apply: true, todo: true }, { type: 'week', apply: true, todo: true },
{ type: 'time', apply: true }, { type: 'time', apply: true },
{ type: 'datetime-local', apply: true, todo: true }, { type: 'datetime-local', apply: true, todo: true },
@@ -142,9 +141,6 @@ for (var test of data) {
// it's default maximum is 100, its value would be 999, and it would // it's default maximum is 100, its value would be 999, and it would
// suffer from overflow. // suffer from overflow.
break; break;
case 'month':
// TODO: this is temporary until bug 888324 is fixed.
break;
default: default:
ok(false, 'please, add a case for this new type (' + input.type + ')'); ok(false, 'please, add a case for this new type (' + input.type + ')');
} }
@@ -339,9 +335,6 @@ for (var test of data) {
input.min = 'foo'; input.min = 'foo';
checkValidity(input, true, apply, false); checkValidity(input, true, apply, false);
break; break;
case 'month':
// TODO: this is temporary until bug 888324 is fixed.
break;
default: default:
ok(false, 'write tests for ' + input.type); ok(false, 'write tests for ' + input.type);
} }

View File

@@ -52,7 +52,6 @@ var gInputTestData = [
['date', false], ['date', false],
['time', false], ['time', false],
['color', false], ['color', false],
['month', false],
]; ];
/** /**
@@ -62,6 +61,7 @@ var gInputTestData = [
var gInputTodoData = [ var gInputTodoData = [
/* type expected result */ /* type expected result */
['datetime', false], ['datetime', false],
['month', false],
['week', false], ['week', false],
['datetime-local', false], ['datetime-local', false],
]; ];

View File

@@ -298,8 +298,8 @@ var input = document.getElementById('i');
// and |invalidTypes| are the ones which do not accept it. // and |invalidTypes| are the ones which do not accept it.
var validTypes = Array('text', 'password', 'search', 'tel', 'email', 'url'); var validTypes = Array('text', 'password', 'search', 'tel', 'email', 'url');
var barredTypes = Array('hidden', 'reset', 'button'); var barredTypes = Array('hidden', 'reset', 'button');
var invalidTypes = Array('checkbox', 'radio', 'file', 'number', 'range', 'date', 'time', 'color', 'submit', 'image', 'month'); var invalidTypes = Array('checkbox', 'radio', 'file', 'number', 'range', 'date', 'time', 'color', 'submit', 'image');
// TODO: 'datetime', 'week', and 'datetime-local' // TODO: 'datetime', 'month', 'week', and 'datetime-local'
// do not accept the @pattern too but are not implemented yet. // do not accept the @pattern too but are not implemented yet.
for (type of validTypes) { for (type of validTypes) {

View File

@@ -174,8 +174,6 @@ function checkInputRequiredValidity(type)
SpecialPowers.wrap(element).value = '2010-10-10'; SpecialPowers.wrap(element).value = '2010-10-10';
} else if (element.type == 'time') { } else if (element.type == 'time') {
SpecialPowers.wrap(element).value = '21:21'; SpecialPowers.wrap(element).value = '21:21';
} else if (element.type = 'month') {
SpecialPowers.wrap(element).value = '2010-10';
} else { } else {
SpecialPowers.wrap(element).value = 'foo'; SpecialPowers.wrap(element).value = 'foo';
} }
@@ -364,10 +362,10 @@ for (type of typeRequireNotApply) {
} }
// Now, checking for all types which accept the required attribute. // Now, checking for all types which accept the required attribute.
// TODO: check 'datetime', 'week' and 'datetime-local' // TODO: check 'datetime', 'month', 'week' and 'datetime-local'
// when they will be implemented. // when they will be implemented.
var typeRequireApply = ["text", "password", "search", "tel", "email", "url", var typeRequireApply = ["text", "password", "search", "tel", "email", "url",
"number", "date", "time", "month"]; "number", "date", "time"];
for (type of typeRequireApply) { for (type of typeRequireApply) {
checkInputRequiredValidity(type); checkInputRequiredValidity(type);

View File

@@ -29,8 +29,7 @@ var data = [
{ type: 'password', apply: false }, { type: 'password', apply: false },
{ type: 'datetime', apply: true, todo: true }, { type: 'datetime', apply: true, todo: true },
{ type: 'date', apply: true }, { type: 'date', apply: true },
// TODO: temporary set to false until bug 888324 is fixed. { type: 'month', apply: true, todo: true },
{ type: 'month', apply: false },
{ type: 'week', apply: true, todo: true }, { type: 'week', apply: true, todo: true },
{ type: 'time', apply: true }, { type: 'time', apply: true },
{ type: 'datetime-local', apply: true, todo: true }, { type: 'datetime-local', apply: true, todo: true },
@@ -720,9 +719,6 @@ for (var test of data) {
} }
} }
break;
case 'month':
// TODO: this is temporary until bug 888324 is fixed.
break; break;
default: default:
ok(false, "Implement the tests for <input type='" + test.type + " >"); ok(false, "Implement the tests for <input type='" + test.type + " >");

View File

@@ -44,13 +44,12 @@ function checkAvailability()
["date", true], ["date", true],
["time", true], ["time", true],
["color", false], ["color", false],
// TODO: temporary set to false until bug 888324 is fixed.
["month", false],
]; ];
var todoList = var todoList =
[ [
["datetime", true], ["datetime", true],
["month", true],
["week", true], ["week", true],
["datetime-local", true], ["datetime-local", true],
]; ];

View File

@@ -39,12 +39,11 @@ var testData = [
[ "time", true ], [ "time", true ],
[ "range", true ], [ "range", true ],
[ "color", true ], [ "color", true ],
[ 'month', true ]
// 'file' is treated separatly. // 'file' is treated separatly.
]; ];
var todoTypes = [ var todoTypes = [
"datetime", "week", "datetime-local" "datetime", "month", "week", "datetime-local"
]; ];
var nonTrivialSanitizing = [ 'number', 'date', 'time', 'color' ]; var nonTrivialSanitizing = [ 'number', 'date', 'time', 'color' ];
@@ -83,8 +82,6 @@ for (var i=0; i<length; ++i) {
expectedValue = '2012-12-21'; expectedValue = '2012-12-21';
} else if (testData[i][0] == 'time' || testData[j][0] == 'time') { } else if (testData[i][0] == 'time' || testData[j][0] == 'time') {
expectedValue = '21:21'; expectedValue = '21:21';
} else if (testData[i][0] == 'month' || testData[j][0] == 'month') {
expectedValue = '2013-03';
} else { } else {
expectedValue = "foo"; expectedValue = "foo";
} }

View File

@@ -38,9 +38,9 @@ var types = [
[ "text", "email", "password", "url", "search", "tel" ], [ "text", "email", "password", "url", "search", "tel" ],
// These types can't be too long. // These types can't be too long.
[ "radio", "checkbox", "submit", "button", "reset", "image", "hidden", [ "radio", "checkbox", "submit", "button", "reset", "image", "hidden",
'number', 'range', 'date', 'time', 'color', 'month' ], 'number', 'range', 'date', 'time', 'color' ],
// These types can't be too long but are not implemented yet. // These types can't be too long but are not implemented yet.
[ "datetime", "week", 'datetime-local' ] [ "datetime", "month", "week", 'datetime-local' ]
]; ];
var input = document.createElement("input"); var input = document.createElement("input");

View File

@@ -3696,12 +3696,10 @@ nsCSSFrameConstructor::FindInputData(Element* aElement,
nsCSSAnonBoxes::buttonContent) }, nsCSSAnonBoxes::buttonContent) },
// TODO: this is temporary until a frame is written: bug 635240. // TODO: this is temporary until a frame is written: bug 635240.
SIMPLE_INT_CREATE(NS_FORM_INPUT_NUMBER, NS_NewNumberControlFrame), SIMPLE_INT_CREATE(NS_FORM_INPUT_NUMBER, NS_NewNumberControlFrame),
// TODO: this is temporary until a frame is written: bug 888320. // TODO: this is temporary until a frame is written: bug 773205.
SIMPLE_INT_CREATE(NS_FORM_INPUT_DATE, NS_NewTextControlFrame), SIMPLE_INT_CREATE(NS_FORM_INPUT_DATE, NS_NewTextControlFrame),
// TODO: this is temporary until a frame is written: bug 888320 // TODO: this is temporary until a frame is written: bug 773205
SIMPLE_INT_CREATE(NS_FORM_INPUT_TIME, NS_NewTextControlFrame), SIMPLE_INT_CREATE(NS_FORM_INPUT_TIME, NS_NewTextControlFrame),
// TODO: this is temporary until a frame is written: bug 888320
SIMPLE_INT_CREATE(NS_FORM_INPUT_MONTH, NS_NewTextControlFrame),
{ NS_FORM_INPUT_SUBMIT, { NS_FORM_INPUT_SUBMIT,
FCDATA_WITH_WRAPPING_BLOCK(0, NS_NewGfxButtonControlFrame, FCDATA_WITH_WRAPPING_BLOCK(0, NS_NewGfxButtonControlFrame,
nsCSSAnonBoxes::buttonContent) }, nsCSSAnonBoxes::buttonContent) },

View File

@@ -11,7 +11,6 @@ user_pref("dom.disable_open_during_load", false);
user_pref("dom.experimental_forms", true); // on for testing user_pref("dom.experimental_forms", true); // on for testing
user_pref("dom.forms.number", true); // on for testing user_pref("dom.forms.number", true); // on for testing
user_pref("dom.forms.color", true); // on for testing user_pref("dom.forms.color", true); // on for testing
user_pref("dom.forms.datetime", true); // on for testing
user_pref("dom.max_script_run_time", 0); // no slow script dialogs user_pref("dom.max_script_run_time", 0); // no slow script dialogs
user_pref("hangmonitor.timeout", 0); // no hang monitor user_pref("hangmonitor.timeout", 0); // no hang monitor
user_pref("dom.max_chrome_script_run_time", 0); user_pref("dom.max_chrome_script_run_time", 0);

View File

@@ -589,6 +589,12 @@
[input.type: setAttribute() to "DATETIME" followed by IDL get] [input.type: setAttribute() to "DATETIME" followed by IDL get]
expected: FAIL expected: FAIL
[input.type: setAttribute() to "month" followed by IDL get]
expected: FAIL
[input.type: setAttribute() to "MONTH" followed by IDL get]
expected: FAIL
[input.type: setAttribute() to "week" followed by IDL get] [input.type: setAttribute() to "week" followed by IDL get]
expected: FAIL expected: FAIL
@@ -607,6 +613,12 @@
[input.type: IDL set to "DATETIME" followed by IDL get] [input.type: IDL set to "DATETIME" followed by IDL get]
expected: FAIL expected: FAIL
[input.type: IDL set to "month" followed by IDL get]
expected: FAIL
[input.type: IDL set to "MONTH" followed by IDL get]
expected: FAIL
[input.type: IDL set to "week" followed by IDL get] [input.type: IDL set to "week" followed by IDL get]
expected: FAIL expected: FAIL

View File

@@ -39,22 +39,7 @@
[[INPUT in DATETIME status\] The datetime type must be supported.] [[INPUT in DATETIME status\] The datetime type must be supported.]
expected: FAIL expected: FAIL
[[INPUT in MONTH status\] suffering from an overflow] [[INPUT in MONTH status\] The month type must be supported.]
expected: FAIL
[[INPUT in MONTH status\] suffering from an overflow (in a form)]
expected: FAIL
[[INPUT in MONTH status\] suffering from an underflow]
expected: FAIL
[[INPUT in MONTH status\] suffering from an underflow (in a form)]
expected: FAIL
[[INPUT in MONTH status\] suffering from a step mismatch]
expected: FAIL
[[INPUT in MONTH status\] suffering from a step mismatch (in a form)]
expected: FAIL expected: FAIL
[[INPUT in WEEK status\] The week type must be supported.] [[INPUT in WEEK status\] The week type must be supported.]

View File

@@ -3,10 +3,7 @@
[[INPUT in DATETIME status\] The datetime type must be supported.] [[INPUT in DATETIME status\] The datetime type must be supported.]
expected: FAIL expected: FAIL
[[INPUT in MONTH status\] The value attribute is greater than max attribute] [[INPUT in MONTH status\] The month type must be supported.]
expected: FAIL
[[INPUT in MONTH status\] The value attribute is greater than max attribute(Year is 10000 should be valid)]
expected: FAIL expected: FAIL
[[INPUT in WEEK status\] The week type must be supported.] [[INPUT in WEEK status\] The week type must be supported.]

View File

@@ -3,10 +3,7 @@
[[INPUT in DATETIME status\] The datetime type must be supported.] [[INPUT in DATETIME status\] The datetime type must be supported.]
expected: FAIL expected: FAIL
[[INPUT in MONTH status\] The value attribute is less than min attribute] [[INPUT in MONTH status\] The month type must be supported.]
expected: FAIL
[[INPUT in MONTH status\] The value attribute is less than min attribute(Year is 10000 should be valid)]
expected: FAIL expected: FAIL
[[INPUT in WEEK status\] The week type must be supported.] [[INPUT in WEEK status\] The week type must be supported.]

View File

@@ -6,7 +6,7 @@
[[INPUT in DATE status\] The value must match the step] [[INPUT in DATE status\] The value must match the step]
expected: FAIL expected: FAIL
[[INPUT in MONTH status\] The value must mismatch the step] [[INPUT in MONTH status\] The month type must be supported.]
expected: FAIL expected: FAIL
[[INPUT in WEEK status\] The week type must be supported.] [[INPUT in WEEK status\] The week type must be supported.]

View File

@@ -21,13 +21,7 @@
[[INPUT in DATETIME status\] The datetime type must be supported.] [[INPUT in DATETIME status\] The datetime type must be supported.]
expected: FAIL expected: FAIL
[[INPUT in MONTH status\] validity.valid must be false if validity.rangeOverflow is true] [[INPUT in MONTH status\] The month type must be supported.]
expected: FAIL
[[INPUT in MONTH status\] validity.valid must be false if validity.rangeUnderflow is true]
expected: FAIL
[[INPUT in MONTH status\] validity.valid must be false if validity.stepMismatch is true]
expected: FAIL expected: FAIL
[[INPUT in WEEK status\] The week type must be supported.] [[INPUT in WEEK status\] The week type must be supported.]

View File

@@ -3,19 +3,7 @@
[[INPUT in DATETIME status\] The datetime type must be supported.] [[INPUT in DATETIME status\] The datetime type must be supported.]
expected: FAIL expected: FAIL
[[INPUT in MONTH status\] The value attribute is a number(1234567)] [[INPUT in MONTH status\] The month type must be supported.]
expected: FAIL
[[INPUT in MONTH status\] The value attribute is a Date object]
expected: FAIL
[[INPUT in MONTH status\] Invalid month string(2000-99)]
expected: FAIL
[[INPUT in MONTH status\] Invalid month string(37-01)]
expected: FAIL
[[INPUT in MONTH status\] Invalid month string(2000/01)]
expected: FAIL expected: FAIL
[[INPUT in WEEK status\] The week type must be supported.] [[INPUT in WEEK status\] The week type must be supported.]

View File

@@ -3,6 +3,9 @@
[datetime type support on input element] [datetime type support on input element]
expected: FAIL expected: FAIL
[month type support on input element]
expected: FAIL
[week type support on input element] [week type support on input element]
expected: FAIL expected: FAIL

View File

@@ -1,5 +1,8 @@
[month.html] [month.html]
type: testharness type: testharness
[month type support on input element]
expected: FAIL
[The value attribute, if specified and not empty, must have a value that is a valid month string] [The value attribute, if specified and not empty, must have a value that is a valid month string]
expected: FAIL expected: FAIL

View File

@@ -1,5 +1,8 @@
[selection.html] [selection.html]
type: testharness type: testharness
[input type month should support the select() method]
expected: FAIL
[input type week should support the select() method] [input type week should support the select() method]
expected: FAIL expected: FAIL

View File

@@ -117,13 +117,6 @@ Form History test: form field autocomplete
<button type="submit">Submit</button> <button type="submit">Submit</button>
</form> </form>
<!-- form with input type='month' -->
<form id="form18" onsubmit="return false;">
<input type="month" name="field15">
<button type="submit">Submit</button>
</form>
</div> </div>
<pre id="test"> <pre id="test">
@@ -170,7 +163,7 @@ function setupFormHistory(aCallback) {
} }
// All these non-implemeted types might need autocomplete tests in the future. // All these non-implemeted types might need autocomplete tests in the future.
var todoTypes = [ "datetime", "week", "datetime-local" ]; var todoTypes = [ "datetime", "month", "week", "datetime-local" ];
var todoInput = document.createElement("input"); var todoInput = document.createElement("input");
for (var type of todoTypes) { for (var type of todoTypes) {
todoInput.type = type; todoInput.type = type;