Bug 1317539 - Remove dom.forms.number pref. r=bz

MozReview-Commit-ID: EgeUfWMcE8D
This commit is contained in:
Cameron McCormack
2018-04-10 11:02:28 +10:00
parent 196912c9bf
commit 9a6c8a3e60
11 changed files with 3 additions and 57 deletions

View File

@@ -5660,20 +5660,6 @@ HTMLInputElement::IsInputDateTimeOthersEnabled()
return sDateTimeOthersEnabled;
}
/* static */ bool
HTMLInputElement::IsInputNumberEnabled()
{
static bool sInputNumberEnabled = false;
static bool sInputNumberPrefCached = false;
if (!sInputNumberPrefCached) {
sInputNumberPrefCached = true;
Preferences::AddBoolVarCache(&sInputNumberEnabled, "dom.forms.number",
false);
}
return sInputNumberEnabled;
}
/* static */ bool
HTMLInputElement::IsInputColorEnabled()
{
@@ -5710,8 +5696,7 @@ HTMLInputElement::ParseAttribute(int32_t aNamespaceID,
if (aAttribute == nsGkAtoms::type) {
aResult.ParseEnumValue(aValue, kInputTypeTable, false, kInputDefaultType);
int32_t newType = aResult.GetEnumValue();
if ((newType == NS_FORM_INPUT_NUMBER && !IsInputNumberEnabled()) ||
(newType == NS_FORM_INPUT_COLOR && !IsInputColorEnabled()) ||
if ((newType == NS_FORM_INPUT_COLOR && !IsInputColorEnabled()) ||
(IsDateTimeInputType(newType) && !IsDateTimeTypeSupported(newType))) {
// There's no public way to set an nsAttrValue to an enum value, but we
// can just re-parse with a table that doesn't have any types other than