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:
@@ -220,7 +220,7 @@ add_task(function* test_search_input() {
|
||||
});
|
||||
|
||||
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 doc = content.document;
|
||||
let input = doc.getElementById("input_" + type);
|
||||
|
||||
@@ -47,7 +47,6 @@ HTMLFormControlsCollection::ShouldBeInElements(nsIFormControl* aFormControl)
|
||||
case NS_FORM_INPUT_TEXT :
|
||||
case NS_FORM_INPUT_TEL :
|
||||
case NS_FORM_INPUT_URL :
|
||||
case NS_FORM_INPUT_MONTH :
|
||||
case NS_FORM_INPUT_NUMBER :
|
||||
case NS_FORM_INPUT_RANGE :
|
||||
case NS_FORM_INPUT_DATE :
|
||||
|
||||
@@ -165,7 +165,6 @@ static const nsAttrValue::EnumTable kInputTypeTable[] = {
|
||||
{ "hidden", NS_FORM_INPUT_HIDDEN },
|
||||
{ "reset", NS_FORM_INPUT_RESET },
|
||||
{ "image", NS_FORM_INPUT_IMAGE },
|
||||
{ "month", NS_FORM_INPUT_MONTH },
|
||||
{ "number", NS_FORM_INPUT_NUMBER },
|
||||
{ "password", NS_FORM_INPUT_PASSWORD },
|
||||
{ "radio", NS_FORM_INPUT_RADIO },
|
||||
@@ -180,7 +179,7 @@ static const nsAttrValue::EnumTable kInputTypeTable[] = {
|
||||
};
|
||||
|
||||
// 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_NUMERIC = 1;
|
||||
@@ -2137,9 +2136,9 @@ HTMLInputElement::GetValue(nsAString& aValue)
|
||||
return rv;
|
||||
}
|
||||
|
||||
// Don't return non-sanitized value for types that are experimental on mobile
|
||||
// or datetime types
|
||||
if (IsExperimentalMobileType(mType) || IsDateTimeInputType(mType)) {
|
||||
// Don't return non-sanitized value for types that are experimental on mobile.
|
||||
// or date types
|
||||
if (IsExperimentalMobileType(mType) || mType == NS_FORM_INPUT_DATE) {
|
||||
SanitizeValue(aValue);
|
||||
}
|
||||
|
||||
@@ -2777,19 +2776,9 @@ HTMLInputElement::ApplyStep(int32_t aStep)
|
||||
bool
|
||||
HTMLInputElement::IsExperimentalMobileType(uint8_t aType)
|
||||
{
|
||||
return (aType == NS_FORM_INPUT_DATE &&
|
||||
!Preferences::GetBool("dom.forms.datetime", 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;
|
||||
|
||||
return aType == NS_FORM_INPUT_TIME ||
|
||||
(aType == NS_FORM_INPUT_DATE &&
|
||||
!Preferences::GetBool("dom.forms.datepicker", false));
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
@@ -2980,8 +2969,8 @@ HTMLInputElement::MozSetDirectory(const nsAString& aDirectoryPath,
|
||||
bool
|
||||
HTMLInputElement::MozIsTextField(bool aExcludePassword)
|
||||
{
|
||||
// TODO: temporary until bug 888320 is fixed.
|
||||
if (IsExperimentalMobileType(mType) || IsDateTimeInputType(mType)) {
|
||||
// TODO: temporary until bug 773205 is fixed.
|
||||
if (IsExperimentalMobileType(mType) || mType == NS_FORM_INPUT_DATE) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -4019,7 +4008,7 @@ HTMLInputElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
||||
// 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
|
||||
// option has been enabled on desktop.
|
||||
if (IsExperimentalMobileType(mType) || IsDateTimeInputType(mType)) {
|
||||
if (IsExperimentalMobileType(mType) || mType == NS_FORM_INPUT_DATE) {
|
||||
nsAutoString aValue;
|
||||
GetValueInternal(aValue);
|
||||
nsresult rv =
|
||||
@@ -4719,7 +4708,7 @@ HTMLInputElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
|
||||
(IsSingleLineTextControl(false, mType) ||
|
||||
mType == NS_FORM_INPUT_NUMBER ||
|
||||
IsExperimentalMobileType(mType) ||
|
||||
IsDateTimeInputType(mType))) {
|
||||
mType == NS_FORM_INPUT_DATE)) {
|
||||
FireChangeEventIfNeeded();
|
||||
rv = MaybeSubmitForm(aVisitor.mPresContext);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
@@ -5516,20 +5505,6 @@ HTMLInputElement::ParseTime(const nsAString& aValue, uint32_t* aResult)
|
||||
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
|
||||
HTMLInputElement::ParseAttribute(int32_t aNamespaceID,
|
||||
nsIAtom* aAttribute,
|
||||
@@ -5549,8 +5524,7 @@ HTMLInputElement::ParseAttribute(int32_t aNamespaceID,
|
||||
(newType == NS_FORM_INPUT_NUMBER &&
|
||||
!Preferences::GetBool("dom.forms.number", false)) ||
|
||||
(newType == NS_FORM_INPUT_COLOR &&
|
||||
!Preferences::GetBool("dom.forms.color", false)) ||
|
||||
(IsDateTimeInputType(newType) && !IsDateTimeEnabled(newType))) {
|
||||
!Preferences::GetBool("dom.forms.color", false))) {
|
||||
newType = kInputDefaultType->value;
|
||||
aResult.SetTo(newType, &aValue);
|
||||
}
|
||||
@@ -6936,7 +6910,6 @@ HTMLInputElement::GetValueMode() const
|
||||
case NS_FORM_INPUT_DATE:
|
||||
case NS_FORM_INPUT_TIME:
|
||||
case NS_FORM_INPUT_COLOR:
|
||||
case NS_FORM_INPUT_MONTH:
|
||||
return VALUE_MODE_VALUE;
|
||||
default:
|
||||
NS_NOTYETIMPLEMENTED("Unexpected input type in GetValueMode()");
|
||||
@@ -6982,7 +6955,6 @@ HTMLInputElement::DoesReadOnlyApply() const
|
||||
case NS_FORM_INPUT_NUMBER:
|
||||
case NS_FORM_INPUT_DATE:
|
||||
case NS_FORM_INPUT_TIME:
|
||||
case NS_FORM_INPUT_MONTH:
|
||||
return true;
|
||||
default:
|
||||
NS_NOTYETIMPLEMENTED("Unexpected input type in DoesReadOnlyApply()");
|
||||
@@ -7020,7 +6992,6 @@ HTMLInputElement::DoesRequiredApply() const
|
||||
case NS_FORM_INPUT_NUMBER:
|
||||
case NS_FORM_INPUT_DATE:
|
||||
case NS_FORM_INPUT_TIME:
|
||||
case NS_FORM_INPUT_MONTH:
|
||||
return true;
|
||||
default:
|
||||
NS_NOTYETIMPLEMENTED("Unexpected input type in DoesRequiredApply()");
|
||||
@@ -7035,7 +7006,8 @@ HTMLInputElement::DoesRequiredApply() const
|
||||
bool
|
||||
HTMLInputElement::PlaceholderApplies() const
|
||||
{
|
||||
if (IsDateTimeInputType(mType)) {
|
||||
if (mType == NS_FORM_INPUT_DATE ||
|
||||
mType == NS_FORM_INPUT_TIME) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -7046,7 +7018,7 @@ bool
|
||||
HTMLInputElement::DoesPatternApply() const
|
||||
{
|
||||
// TODO: temporary until bug 773205 is fixed.
|
||||
if (IsExperimentalMobileType(mType) || IsDateTimeInputType(mType)) {
|
||||
if (IsExperimentalMobileType(mType)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -7062,7 +7034,6 @@ HTMLInputElement::DoesMinMaxApply() const
|
||||
case NS_FORM_INPUT_DATE:
|
||||
case NS_FORM_INPUT_TIME:
|
||||
case NS_FORM_INPUT_RANGE:
|
||||
case NS_FORM_INPUT_MONTH:
|
||||
// TODO:
|
||||
// All date/time types.
|
||||
return true;
|
||||
@@ -7110,7 +7081,6 @@ HTMLInputElement::DoesAutocompleteApply() const
|
||||
case NS_FORM_INPUT_NUMBER:
|
||||
case NS_FORM_INPUT_RANGE:
|
||||
case NS_FORM_INPUT_COLOR:
|
||||
case NS_FORM_INPUT_MONTH:
|
||||
return true;
|
||||
#ifdef DEBUG
|
||||
case NS_FORM_INPUT_RESET:
|
||||
@@ -7288,8 +7258,7 @@ HTMLInputElement::HasPatternMismatch() const
|
||||
bool
|
||||
HTMLInputElement::IsRangeOverflow() const
|
||||
{
|
||||
// TODO: this is temporary until bug 888324 is fixed.
|
||||
if (!DoesMinMaxApply() || mType == NS_FORM_INPUT_MONTH) {
|
||||
if (!DoesMinMaxApply()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -7309,8 +7278,7 @@ HTMLInputElement::IsRangeOverflow() const
|
||||
bool
|
||||
HTMLInputElement::IsRangeUnderflow() const
|
||||
{
|
||||
// TODO: this is temporary until bug 888324 is fixed.
|
||||
if (!DoesMinMaxApply() || mType == NS_FORM_INPUT_MONTH) {
|
||||
if (!DoesMinMaxApply()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -8289,8 +8257,7 @@ HTMLInputElement::UpdateHasRange()
|
||||
|
||||
mHasRange = false;
|
||||
|
||||
// TODO: this is temporary until bug 888324 is fixed.
|
||||
if (!DoesMinMaxApply() || mType == NS_FORM_INPUT_MONTH) {
|
||||
if (!DoesMinMaxApply()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1017,11 +1017,7 @@ protected:
|
||||
/**
|
||||
* Returns if the step attribute apply for the current type.
|
||||
*/
|
||||
bool DoesStepApply() const
|
||||
{
|
||||
// TODO: this is temporary until bug 888324 is fixed.
|
||||
return DoesMinMaxApply() && mType != NS_FORM_INPUT_MONTH;
|
||||
}
|
||||
bool DoesStepApply() const { return DoesMinMaxApply(); }
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
bool DoesValueAsNumberApply() const
|
||||
{
|
||||
// TODO: this is temporary until bug 888324 is fixed.
|
||||
return DoesMinMaxApply() && mType != NS_FORM_INPUT_MONTH;
|
||||
}
|
||||
bool DoesValueAsNumberApply() const { return DoesMinMaxApply(); }
|
||||
|
||||
/**
|
||||
* Returns if autocomplete attribute applies for the current type.
|
||||
@@ -1259,12 +1251,6 @@ protected:
|
||||
*/
|
||||
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.
|
||||
*/
|
||||
|
||||
@@ -55,7 +55,6 @@ enum InputElementTypes {
|
||||
NS_FORM_INPUT_HIDDEN,
|
||||
NS_FORM_INPUT_RESET,
|
||||
NS_FORM_INPUT_IMAGE,
|
||||
NS_FORM_INPUT_MONTH,
|
||||
NS_FORM_INPUT_NUMBER,
|
||||
NS_FORM_INPUT_PASSWORD,
|
||||
NS_FORM_INPUT_RADIO,
|
||||
@@ -267,7 +266,6 @@ nsIFormControl::IsSingleLineTextControl(bool aExcludePassword, uint32_t aType)
|
||||
// TODO: those are temporary until bug 773205 is fixed.
|
||||
aType == NS_FORM_INPUT_DATE ||
|
||||
aType == NS_FORM_INPUT_TIME ||
|
||||
aType == NS_FORM_INPUT_MONTH ||
|
||||
(!aExcludePassword && aType == NS_FORM_INPUT_PASSWORD);
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ support-files =
|
||||
[test_change_event.html]
|
||||
skip-if = (buildapp == 'b2g' && toolkit != 'gonk') #Bug 931116, b2g desktop specific, initial triage
|
||||
[test_datalist_element.html]
|
||||
[test_experimental_forms_pref.html]
|
||||
[test_form_attribute-1.html]
|
||||
[test_form_attribute-2.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
|
||||
[test_input_sanitization.html]
|
||||
[test_input_textarea_set_value_no_scroll.html]
|
||||
[test_input_types_pref.html]
|
||||
[test_input_typing_sanitization.html]
|
||||
skip-if = buildapp == 'mulet'
|
||||
[test_input_untrusted_key_events.html]
|
||||
|
||||
51
dom/html/test/forms/test_experimental_forms_pref.html
Normal file
51
dom/html/test/forms/test_experimental_forms_pref.html
Normal 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>
|
||||
@@ -234,10 +234,10 @@ reflectLimitedEnumerated({
|
||||
attribute: "type",
|
||||
validValues: [ "hidden", "text", "search", "tel", "url", "email", "password",
|
||||
"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" ],
|
||||
defaultValue: "text",
|
||||
unsupportedValues: [ "datetime", "week", "datetime-local" ]
|
||||
unsupportedValues: [ "datetime", "month", "week", "datetime-local" ]
|
||||
});
|
||||
|
||||
// .defaultValue
|
||||
|
||||
@@ -79,7 +79,7 @@ var inputTypes =
|
||||
|
||||
var todoTypes =
|
||||
[
|
||||
"week", "datetime", "datetime-local",
|
||||
"month", "week", "datetime", "datetime-local",
|
||||
];
|
||||
|
||||
var valueModeValue =
|
||||
|
||||
@@ -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>
|
||||
@@ -182,6 +182,7 @@ function runTest()
|
||||
]
|
||||
},
|
||||
{ type: 'week', todo: true },
|
||||
{ type: 'month', todo: true },
|
||||
{ type: 'datetime', todo: true },
|
||||
{ type: 'datetime-local', todo: true },
|
||||
];
|
||||
|
||||
@@ -29,8 +29,7 @@ var data = [
|
||||
{ type: 'password', apply: false },
|
||||
{ type: 'datetime', apply: true, todo: true },
|
||||
{ type: 'date', apply: true },
|
||||
// TODO: temporary set to false until bug 888324 is fixed.
|
||||
{ type: 'month', apply: false },
|
||||
{ type: 'month', apply: true, todo: true },
|
||||
{ type: 'week', apply: true, todo: true },
|
||||
{ type: 'time', apply: 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:
|
||||
input.max = '10';
|
||||
break;
|
||||
case 'month':
|
||||
// TODO: this is temporary until bug 888324 is fixed.
|
||||
break;
|
||||
default:
|
||||
ok(false, 'please, add a case for this new type (' + input.type + ')');
|
||||
}
|
||||
|
||||
@@ -29,8 +29,7 @@ var data = [
|
||||
{ type: 'password', apply: false },
|
||||
{ type: 'datetime', apply: true, todo: true },
|
||||
{ type: 'date', apply: true },
|
||||
// TODO: temporary set to false until bug 888324 is fixed.
|
||||
{ type: 'month', apply: false },
|
||||
{ type: 'month', apply: true, todo: true },
|
||||
{ type: 'week', apply: true, todo: true },
|
||||
{ type: 'time', apply: 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
|
||||
// suffer from overflow.
|
||||
break;
|
||||
case 'month':
|
||||
// TODO: this is temporary until bug 888324 is fixed.
|
||||
break;
|
||||
default:
|
||||
ok(false, 'please, add a case for this new type (' + input.type + ')');
|
||||
}
|
||||
@@ -339,9 +335,6 @@ for (var test of data) {
|
||||
input.min = 'foo';
|
||||
checkValidity(input, true, apply, false);
|
||||
break;
|
||||
case 'month':
|
||||
// TODO: this is temporary until bug 888324 is fixed.
|
||||
break;
|
||||
default:
|
||||
ok(false, 'write tests for ' + input.type);
|
||||
}
|
||||
|
||||
@@ -52,7 +52,6 @@ var gInputTestData = [
|
||||
['date', false],
|
||||
['time', false],
|
||||
['color', false],
|
||||
['month', false],
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -62,6 +61,7 @@ var gInputTestData = [
|
||||
var gInputTodoData = [
|
||||
/* type expected result */
|
||||
['datetime', false],
|
||||
['month', false],
|
||||
['week', false],
|
||||
['datetime-local', false],
|
||||
];
|
||||
|
||||
@@ -298,8 +298,8 @@ var input = document.getElementById('i');
|
||||
// and |invalidTypes| are the ones which do not accept it.
|
||||
var validTypes = Array('text', 'password', 'search', 'tel', 'email', 'url');
|
||||
var barredTypes = Array('hidden', 'reset', 'button');
|
||||
var invalidTypes = Array('checkbox', 'radio', 'file', 'number', 'range', 'date', 'time', 'color', 'submit', 'image', 'month');
|
||||
// TODO: 'datetime', 'week', and 'datetime-local'
|
||||
var invalidTypes = Array('checkbox', 'radio', 'file', 'number', 'range', 'date', 'time', 'color', 'submit', 'image');
|
||||
// TODO: 'datetime', 'month', 'week', and 'datetime-local'
|
||||
// do not accept the @pattern too but are not implemented yet.
|
||||
|
||||
for (type of validTypes) {
|
||||
|
||||
@@ -174,8 +174,6 @@ function checkInputRequiredValidity(type)
|
||||
SpecialPowers.wrap(element).value = '2010-10-10';
|
||||
} else if (element.type == 'time') {
|
||||
SpecialPowers.wrap(element).value = '21:21';
|
||||
} else if (element.type = 'month') {
|
||||
SpecialPowers.wrap(element).value = '2010-10';
|
||||
} else {
|
||||
SpecialPowers.wrap(element).value = 'foo';
|
||||
}
|
||||
@@ -364,10 +362,10 @@ for (type of typeRequireNotApply) {
|
||||
}
|
||||
|
||||
// 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.
|
||||
var typeRequireApply = ["text", "password", "search", "tel", "email", "url",
|
||||
"number", "date", "time", "month"];
|
||||
"number", "date", "time"];
|
||||
|
||||
for (type of typeRequireApply) {
|
||||
checkInputRequiredValidity(type);
|
||||
|
||||
@@ -29,8 +29,7 @@ var data = [
|
||||
{ type: 'password', apply: false },
|
||||
{ type: 'datetime', apply: true, todo: true },
|
||||
{ type: 'date', apply: true },
|
||||
// TODO: temporary set to false until bug 888324 is fixed.
|
||||
{ type: 'month', apply: false },
|
||||
{ type: 'month', apply: true, todo: true },
|
||||
{ type: 'week', apply: true, todo: true },
|
||||
{ type: 'time', apply: 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;
|
||||
default:
|
||||
ok(false, "Implement the tests for <input type='" + test.type + " >");
|
||||
|
||||
@@ -44,13 +44,12 @@ function checkAvailability()
|
||||
["date", true],
|
||||
["time", true],
|
||||
["color", false],
|
||||
// TODO: temporary set to false until bug 888324 is fixed.
|
||||
["month", false],
|
||||
];
|
||||
|
||||
var todoList =
|
||||
[
|
||||
["datetime", true],
|
||||
["month", true],
|
||||
["week", true],
|
||||
["datetime-local", true],
|
||||
];
|
||||
|
||||
@@ -39,12 +39,11 @@ var testData = [
|
||||
[ "time", true ],
|
||||
[ "range", true ],
|
||||
[ "color", true ],
|
||||
[ 'month', true ]
|
||||
// 'file' is treated separatly.
|
||||
];
|
||||
|
||||
var todoTypes = [
|
||||
"datetime", "week", "datetime-local"
|
||||
"datetime", "month", "week", "datetime-local"
|
||||
];
|
||||
|
||||
var nonTrivialSanitizing = [ 'number', 'date', 'time', 'color' ];
|
||||
@@ -83,8 +82,6 @@ for (var i=0; i<length; ++i) {
|
||||
expectedValue = '2012-12-21';
|
||||
} else if (testData[i][0] == 'time' || testData[j][0] == 'time') {
|
||||
expectedValue = '21:21';
|
||||
} else if (testData[i][0] == 'month' || testData[j][0] == 'month') {
|
||||
expectedValue = '2013-03';
|
||||
} else {
|
||||
expectedValue = "foo";
|
||||
}
|
||||
|
||||
@@ -38,9 +38,9 @@ var types = [
|
||||
[ "text", "email", "password", "url", "search", "tel" ],
|
||||
// These types can't be too long.
|
||||
[ "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.
|
||||
[ "datetime", "week", 'datetime-local' ]
|
||||
[ "datetime", "month", "week", 'datetime-local' ]
|
||||
];
|
||||
|
||||
var input = document.createElement("input");
|
||||
|
||||
@@ -3696,12 +3696,10 @@ nsCSSFrameConstructor::FindInputData(Element* aElement,
|
||||
nsCSSAnonBoxes::buttonContent) },
|
||||
// TODO: this is temporary until a frame is written: bug 635240.
|
||||
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),
|
||||
// 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),
|
||||
// TODO: this is temporary until a frame is written: bug 888320
|
||||
SIMPLE_INT_CREATE(NS_FORM_INPUT_MONTH, NS_NewTextControlFrame),
|
||||
{ NS_FORM_INPUT_SUBMIT,
|
||||
FCDATA_WITH_WRAPPING_BLOCK(0, NS_NewGfxButtonControlFrame,
|
||||
nsCSSAnonBoxes::buttonContent) },
|
||||
|
||||
@@ -11,7 +11,6 @@ user_pref("dom.disable_open_during_load", false);
|
||||
user_pref("dom.experimental_forms", 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.datetime", true); // on for testing
|
||||
user_pref("dom.max_script_run_time", 0); // no slow script dialogs
|
||||
user_pref("hangmonitor.timeout", 0); // no hang monitor
|
||||
user_pref("dom.max_chrome_script_run_time", 0);
|
||||
|
||||
@@ -589,6 +589,12 @@
|
||||
[input.type: setAttribute() to "DATETIME" followed by IDL get]
|
||||
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]
|
||||
expected: FAIL
|
||||
|
||||
@@ -607,6 +613,12 @@
|
||||
[input.type: IDL set to "DATETIME" followed by IDL get]
|
||||
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]
|
||||
expected: FAIL
|
||||
|
||||
|
||||
@@ -39,22 +39,7 @@
|
||||
[[INPUT in DATETIME status\] The datetime type must be supported.]
|
||||
expected: FAIL
|
||||
|
||||
[[INPUT in MONTH status\] suffering from an overflow]
|
||||
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)]
|
||||
[[INPUT in MONTH status\] The month type must be supported.]
|
||||
expected: FAIL
|
||||
|
||||
[[INPUT in WEEK status\] The week type must be supported.]
|
||||
|
||||
@@ -3,10 +3,7 @@
|
||||
[[INPUT in DATETIME status\] The datetime type must be supported.]
|
||||
expected: FAIL
|
||||
|
||||
[[INPUT in MONTH status\] The value attribute is greater than max attribute]
|
||||
expected: FAIL
|
||||
|
||||
[[INPUT in MONTH status\] The value attribute is greater than max attribute(Year is 10000 should be valid)]
|
||||
[[INPUT in MONTH status\] The month type must be supported.]
|
||||
expected: FAIL
|
||||
|
||||
[[INPUT in WEEK status\] The week type must be supported.]
|
||||
|
||||
@@ -3,10 +3,7 @@
|
||||
[[INPUT in DATETIME status\] The datetime type must be supported.]
|
||||
expected: FAIL
|
||||
|
||||
[[INPUT in MONTH status\] The value attribute is less than min attribute]
|
||||
expected: FAIL
|
||||
|
||||
[[INPUT in MONTH status\] The value attribute is less than min attribute(Year is 10000 should be valid)]
|
||||
[[INPUT in MONTH status\] The month type must be supported.]
|
||||
expected: FAIL
|
||||
|
||||
[[INPUT in WEEK status\] The week type must be supported.]
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
[[INPUT in DATE status\] The value must match the step]
|
||||
expected: FAIL
|
||||
|
||||
[[INPUT in MONTH status\] The value must mismatch the step]
|
||||
[[INPUT in MONTH status\] The month type must be supported.]
|
||||
expected: FAIL
|
||||
|
||||
[[INPUT in WEEK status\] The week type must be supported.]
|
||||
|
||||
@@ -21,13 +21,7 @@
|
||||
[[INPUT in DATETIME status\] The datetime type must be supported.]
|
||||
expected: FAIL
|
||||
|
||||
[[INPUT in MONTH status\] validity.valid must be false if validity.rangeOverflow is true]
|
||||
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]
|
||||
[[INPUT in MONTH status\] The month type must be supported.]
|
||||
expected: FAIL
|
||||
|
||||
[[INPUT in WEEK status\] The week type must be supported.]
|
||||
|
||||
@@ -3,19 +3,7 @@
|
||||
[[INPUT in DATETIME status\] The datetime type must be supported.]
|
||||
expected: FAIL
|
||||
|
||||
[[INPUT in MONTH status\] The value attribute is a number(1234567)]
|
||||
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)]
|
||||
[[INPUT in MONTH status\] The month type must be supported.]
|
||||
expected: FAIL
|
||||
|
||||
[[INPUT in WEEK status\] The week type must be supported.]
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
[datetime type support on input element]
|
||||
expected: FAIL
|
||||
|
||||
[month type support on input element]
|
||||
expected: FAIL
|
||||
|
||||
[week type support on input element]
|
||||
expected: FAIL
|
||||
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
[month.html]
|
||||
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]
|
||||
expected: FAIL
|
||||
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
[selection.html]
|
||||
type: testharness
|
||||
[input type month should support the select() method]
|
||||
expected: FAIL
|
||||
|
||||
[input type week should support the select() method]
|
||||
expected: FAIL
|
||||
|
||||
|
||||
@@ -117,13 +117,6 @@ Form History test: form field autocomplete
|
||||
<button type="submit">Submit</button>
|
||||
</form>
|
||||
|
||||
<!-- form with input type='month' -->
|
||||
<form id="form18" onsubmit="return false;">
|
||||
<input type="month" name="field15">
|
||||
<button type="submit">Submit</button>
|
||||
</form>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<pre id="test">
|
||||
@@ -170,7 +163,7 @@ function setupFormHistory(aCallback) {
|
||||
}
|
||||
|
||||
// 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");
|
||||
for (var type of todoTypes) {
|
||||
todoInput.type = type;
|
||||
|
||||
Reference in New Issue
Block a user