mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-01 00:32:11 +00:00
Bug 1660048 - Remove dom.forms.color and dom.forms.datetime. r=smaug,marionette-reviewers,whimboo
They're enabled in all configurations and there's no plan to change this. With it, dom.experimental_forms is also useless, so we can remove it too. Differential Revision: https://phabricator.services.mozilla.com/D87623
This commit is contained in:
parent
16418eddeb
commit
325d955f89
@ -437,13 +437,6 @@ void GetDOMFileOrDirectoryPath(const OwningFileOrDirectory& aData,
|
|||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
/* static */
|
|
||||||
bool HTMLInputElement::ValueAsDateEnabled(JSContext* cx, JSObject* obj) {
|
|
||||||
return StaticPrefs::dom_experimental_forms() ||
|
|
||||||
StaticPrefs::dom_forms_datetime() ||
|
|
||||||
StaticPrefs::dom_forms_datetime_others();
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
HTMLInputElement::nsFilePickerShownCallback::Done(int16_t aResult) {
|
HTMLInputElement::nsFilePickerShownCallback::Done(int16_t aResult) {
|
||||||
mInput->PickerClosed();
|
mInput->PickerClosed();
|
||||||
@ -1291,8 +1284,7 @@ nsresult HTMLInputElement::AfterSetAttr(int32_t aNameSpaceID, nsAtom* aName,
|
|||||||
mAutocompleteInfoState = nsContentUtils::eAutocompleteAttrState_Unknown;
|
mAutocompleteInfoState = nsContentUtils::eAutocompleteAttrState_Unknown;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((mType == NS_FORM_INPUT_TIME || mType == NS_FORM_INPUT_DATE) &&
|
if (mType == NS_FORM_INPUT_TIME || mType == NS_FORM_INPUT_DATE) {
|
||||||
!IsExperimentalMobileType(mType)) {
|
|
||||||
if (aName == nsGkAtoms::value || aName == nsGkAtoms::readonly ||
|
if (aName == nsGkAtoms::value || aName == nsGkAtoms::readonly ||
|
||||||
aName == nsGkAtoms::tabindex || aName == nsGkAtoms::required ||
|
aName == nsGkAtoms::tabindex || aName == nsGkAtoms::required ||
|
||||||
aName == nsGkAtoms::disabled) {
|
aName == nsGkAtoms::disabled) {
|
||||||
@ -1426,10 +1418,8 @@ uint32_t HTMLInputElement::Width() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool HTMLInputElement::SanitizesOnValueGetter() const {
|
bool HTMLInputElement::SanitizesOnValueGetter() const {
|
||||||
// Don't return non-sanitized value for types that are experimental on mobile
|
// Don't return non-sanitized value for datetime types or number.
|
||||||
// or datetime types or number.
|
return mType == NS_FORM_INPUT_NUMBER || IsDateTimeInputType(mType);
|
||||||
return mType == NS_FORM_INPUT_NUMBER || IsExperimentalMobileType(mType) ||
|
|
||||||
IsDateTimeInputType(mType);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void HTMLInputElement::GetValue(nsAString& aValue, CallerType aCallerType) {
|
void HTMLInputElement::GetValue(nsAString& aValue, CallerType aCallerType) {
|
||||||
@ -1966,12 +1956,6 @@ nsresult HTMLInputElement::ApplyStep(int32_t aStep) {
|
|||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* static */
|
|
||||||
bool HTMLInputElement::IsExperimentalMobileType(uint8_t aType) {
|
|
||||||
return (aType == NS_FORM_INPUT_DATE || aType == NS_FORM_INPUT_TIME) &&
|
|
||||||
!StaticPrefs::dom_forms_datetime();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool HTMLInputElement::IsDateTimeInputType(uint8_t aType) {
|
bool HTMLInputElement::IsDateTimeInputType(uint8_t aType) {
|
||||||
return aType == NS_FORM_INPUT_DATE || aType == NS_FORM_INPUT_TIME ||
|
return aType == NS_FORM_INPUT_DATE || aType == NS_FORM_INPUT_TIME ||
|
||||||
aType == NS_FORM_INPUT_MONTH || aType == NS_FORM_INPUT_WEEK ||
|
aType == NS_FORM_INPUT_MONTH || aType == NS_FORM_INPUT_WEEK ||
|
||||||
@ -2189,8 +2173,7 @@ bool HTMLInputElement::MozIsTextField(bool aExcludePassword) {
|
|||||||
//
|
//
|
||||||
// FIXME: Historically we never returned true for `number`, we should consider
|
// FIXME: Historically we never returned true for `number`, we should consider
|
||||||
// changing that now that it is similar to other inputs.
|
// changing that now that it is similar to other inputs.
|
||||||
if (IsExperimentalMobileType(mType) || IsDateTimeInputType(mType) ||
|
if (IsDateTimeInputType(mType) || mType == NS_FORM_INPUT_NUMBER) {
|
||||||
mType == NS_FORM_INPUT_NUMBER) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2674,7 +2657,6 @@ nsresult HTMLInputElement::SetValueInternal(const nsAString& aValue,
|
|||||||
}
|
}
|
||||||
} else if ((mType == NS_FORM_INPUT_TIME ||
|
} else if ((mType == NS_FORM_INPUT_TIME ||
|
||||||
mType == NS_FORM_INPUT_DATE) &&
|
mType == NS_FORM_INPUT_DATE) &&
|
||||||
!IsExperimentalMobileType(mType) &&
|
|
||||||
!(aFlags & TextControlState::eSetValue_BySetUserInput)) {
|
!(aFlags & TextControlState::eSetValue_BySetUserInput)) {
|
||||||
if (Element* dateTimeBoxElement = GetDateTimeBoxElement()) {
|
if (Element* dateTimeBoxElement = GetDateTimeBoxElement()) {
|
||||||
AsyncEventDispatcher* dispatcher = new AsyncEventDispatcher(
|
AsyncEventDispatcher* dispatcher = new AsyncEventDispatcher(
|
||||||
@ -2944,8 +2926,7 @@ void HTMLInputElement::SetCheckedInternal(bool aChecked, bool aNotify) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void HTMLInputElement::Blur(ErrorResult& aError) {
|
void HTMLInputElement::Blur(ErrorResult& aError) {
|
||||||
if ((mType == NS_FORM_INPUT_TIME || mType == NS_FORM_INPUT_DATE) &&
|
if (mType == NS_FORM_INPUT_TIME || mType == NS_FORM_INPUT_DATE) {
|
||||||
!IsExperimentalMobileType(mType)) {
|
|
||||||
if (Element* dateTimeBoxElement = GetDateTimeBoxElement()) {
|
if (Element* dateTimeBoxElement = GetDateTimeBoxElement()) {
|
||||||
AsyncEventDispatcher* dispatcher = new AsyncEventDispatcher(
|
AsyncEventDispatcher* dispatcher = new AsyncEventDispatcher(
|
||||||
dateTimeBoxElement, u"MozBlurInnerTextBox"_ns, CanBubble::eNo,
|
dateTimeBoxElement, u"MozBlurInnerTextBox"_ns, CanBubble::eNo,
|
||||||
@ -2960,8 +2941,7 @@ void HTMLInputElement::Blur(ErrorResult& aError) {
|
|||||||
|
|
||||||
void HTMLInputElement::Focus(const FocusOptions& aOptions,
|
void HTMLInputElement::Focus(const FocusOptions& aOptions,
|
||||||
CallerType aCallerType, ErrorResult& aError) {
|
CallerType aCallerType, ErrorResult& aError) {
|
||||||
if ((mType == NS_FORM_INPUT_TIME || mType == NS_FORM_INPUT_DATE) &&
|
if (mType == NS_FORM_INPUT_TIME || mType == NS_FORM_INPUT_DATE) {
|
||||||
!IsExperimentalMobileType(mType)) {
|
|
||||||
if (Element* dateTimeBoxElement = GetDateTimeBoxElement()) {
|
if (Element* dateTimeBoxElement = GetDateTimeBoxElement()) {
|
||||||
AsyncEventDispatcher* dispatcher = new AsyncEventDispatcher(
|
AsyncEventDispatcher* dispatcher = new AsyncEventDispatcher(
|
||||||
dateTimeBoxElement, u"MozFocusInnerTextBox"_ns, CanBubble::eNo,
|
dateTimeBoxElement, u"MozFocusInnerTextBox"_ns, CanBubble::eNo,
|
||||||
@ -3222,7 +3202,7 @@ void HTMLInputElement::GetEventTargetParent(EventChainPreVisitor& aVisitor) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((mType == NS_FORM_INPUT_TIME || mType == NS_FORM_INPUT_DATE) &&
|
if ((mType == NS_FORM_INPUT_TIME || mType == NS_FORM_INPUT_DATE) &&
|
||||||
!IsExperimentalMobileType(mType) && aVisitor.mEvent->mMessage == eFocus &&
|
aVisitor.mEvent->mMessage == eFocus &&
|
||||||
aVisitor.mEvent->mOriginalTarget == this) {
|
aVisitor.mEvent->mOriginalTarget == this) {
|
||||||
// If original target is this and not the inner text control, we should
|
// If original target is this and not the inner text control, we should
|
||||||
// pass the focus to the inner text control.
|
// pass the focus to the inner text control.
|
||||||
@ -3287,7 +3267,7 @@ void HTMLInputElement::GetEventTargetParent(EventChainPreVisitor& aVisitor) {
|
|||||||
//
|
//
|
||||||
// FIXME(emilio): Is this still needed now that we use Shadow DOM for this?
|
// FIXME(emilio): Is this still needed now that we use Shadow DOM for this?
|
||||||
if ((mType == NS_FORM_INPUT_TIME || mType == NS_FORM_INPUT_DATE) &&
|
if ((mType == NS_FORM_INPUT_TIME || mType == NS_FORM_INPUT_DATE) &&
|
||||||
!IsExperimentalMobileType(mType) && aVisitor.mEvent->IsTrusted() &&
|
aVisitor.mEvent->IsTrusted() &&
|
||||||
(aVisitor.mEvent->mMessage == eFocus ||
|
(aVisitor.mEvent->mMessage == eFocus ||
|
||||||
aVisitor.mEvent->mMessage == eFocusIn ||
|
aVisitor.mEvent->mMessage == eFocusIn ||
|
||||||
aVisitor.mEvent->mMessage == eFocusOut ||
|
aVisitor.mEvent->mMessage == eFocusOut ||
|
||||||
@ -3306,18 +3286,8 @@ void HTMLInputElement::GetEventTargetParent(EventChainPreVisitor& aVisitor) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
nsresult HTMLInputElement::PreHandleEvent(EventChainVisitor& aVisitor) {
|
nsresult HTMLInputElement::PreHandleEvent(EventChainVisitor& aVisitor) {
|
||||||
nsresult rv;
|
|
||||||
if (aVisitor.mItemFlags & NS_PRE_HANDLE_BLUR_EVENT) {
|
if (aVisitor.mItemFlags & NS_PRE_HANDLE_BLUR_EVENT) {
|
||||||
MOZ_ASSERT(aVisitor.mEvent->mMessage == eBlur);
|
MOZ_ASSERT(aVisitor.mEvent->mMessage == eBlur);
|
||||||
// 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)) {
|
|
||||||
nsAutoString aValue;
|
|
||||||
GetNonFileValueInternal(aValue);
|
|
||||||
rv = SetValueInternal(aValue, TextControlState::eSetValue_Internal);
|
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
|
||||||
}
|
|
||||||
FireChangeEventIfNeeded();
|
FireChangeEventIfNeeded();
|
||||||
}
|
}
|
||||||
return nsGenericHTMLFormElementWithState::PreHandleEvent(aVisitor);
|
return nsGenericHTMLFormElementWithState::PreHandleEvent(aVisitor);
|
||||||
@ -3851,8 +3821,7 @@ nsresult HTMLInputElement::PostHandleEvent(EventChainPostVisitor& aVisitor) {
|
|||||||
if (aVisitor.mEvent->mMessage == eKeyPress &&
|
if (aVisitor.mEvent->mMessage == eKeyPress &&
|
||||||
keyEvent->mKeyCode == NS_VK_RETURN &&
|
keyEvent->mKeyCode == NS_VK_RETURN &&
|
||||||
(IsSingleLineTextControl(false, mType) ||
|
(IsSingleLineTextControl(false, mType) ||
|
||||||
mType == NS_FORM_INPUT_NUMBER ||
|
mType == NS_FORM_INPUT_NUMBER || IsDateTimeInputType(mType))) {
|
||||||
IsExperimentalMobileType(mType) || IsDateTimeInputType(mType))) {
|
|
||||||
FireChangeEventIfNeeded();
|
FireChangeEventIfNeeded();
|
||||||
if (aVisitor.mPresContext) {
|
if (aVisitor.mPresContext) {
|
||||||
rv = MaybeSubmitForm(MOZ_KnownLive(aVisitor.mPresContext));
|
rv = MaybeSubmitForm(MOZ_KnownLive(aVisitor.mPresContext));
|
||||||
@ -5053,10 +5022,8 @@ bool HTMLInputElement::ParseTime(const nsAString& aValue, uint32_t* aResult) {
|
|||||||
|
|
||||||
/* static */
|
/* static */
|
||||||
bool HTMLInputElement::IsDateTimeTypeSupported(uint8_t aDateTimeInputType) {
|
bool HTMLInputElement::IsDateTimeTypeSupported(uint8_t aDateTimeInputType) {
|
||||||
return ((aDateTimeInputType == NS_FORM_INPUT_DATE ||
|
return aDateTimeInputType == NS_FORM_INPUT_DATE ||
|
||||||
aDateTimeInputType == NS_FORM_INPUT_TIME) &&
|
aDateTimeInputType == NS_FORM_INPUT_TIME ||
|
||||||
(StaticPrefs::dom_forms_datetime() ||
|
|
||||||
StaticPrefs::dom_experimental_forms())) ||
|
|
||||||
((aDateTimeInputType == NS_FORM_INPUT_MONTH ||
|
((aDateTimeInputType == NS_FORM_INPUT_MONTH ||
|
||||||
aDateTimeInputType == NS_FORM_INPUT_WEEK ||
|
aDateTimeInputType == NS_FORM_INPUT_WEEK ||
|
||||||
aDateTimeInputType == NS_FORM_INPUT_DATETIME_LOCAL) &&
|
aDateTimeInputType == NS_FORM_INPUT_DATETIME_LOCAL) &&
|
||||||
@ -5082,8 +5049,7 @@ bool HTMLInputElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute,
|
|||||||
if (aAttribute == nsGkAtoms::type) {
|
if (aAttribute == nsGkAtoms::type) {
|
||||||
aResult.ParseEnumValue(aValue, kInputTypeTable, false, kInputDefaultType);
|
aResult.ParseEnumValue(aValue, kInputTypeTable, false, kInputDefaultType);
|
||||||
int32_t newType = aResult.GetEnumValue();
|
int32_t newType = aResult.GetEnumValue();
|
||||||
if ((newType == NS_FORM_INPUT_COLOR && !StaticPrefs::dom_forms_color()) ||
|
if (IsDateTimeInputType(newType) && !IsDateTimeTypeSupported(newType)) {
|
||||||
(IsDateTimeInputType(newType) && !IsDateTimeTypeSupported(newType))) {
|
|
||||||
// There's no public way to set an nsAttrValue to an enum value, but we
|
// 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
|
// can just re-parse with a table that doesn't have any types other than
|
||||||
// "text" in it.
|
// "text" in it.
|
||||||
|
@ -1589,8 +1589,7 @@ class HTMLInputElement final : public TextControlElement,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if aDateTimeInputType should be supported based on
|
* Checks if aDateTimeInputType should be supported.
|
||||||
* "dom.forms.datetime", and "dom.experimental_forms".
|
|
||||||
*/
|
*/
|
||||||
static bool IsDateTimeTypeSupported(uint8_t aDateTimeInputType);
|
static bool IsDateTimeTypeSupported(uint8_t aDateTimeInputType);
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ load 795221-5.xml
|
|||||||
load 811226.html
|
load 811226.html
|
||||||
load 819745.html
|
load 819745.html
|
||||||
load 828180.html
|
load 828180.html
|
||||||
pref(dom.experimental_forms,true) load 828472.html
|
load 828472.html
|
||||||
load 837033.html
|
load 837033.html
|
||||||
load 838256-1.html
|
load 838256-1.html
|
||||||
load 862084.html
|
load 862084.html
|
||||||
|
@ -175,10 +175,6 @@ bool DateTimeInputTypeBase::GetTimeFromMs(double aValue, uint16_t* aHours,
|
|||||||
// input type=date
|
// input type=date
|
||||||
|
|
||||||
nsresult DateInputType::GetBadInputMessage(nsAString& aMessage) {
|
nsresult DateInputType::GetBadInputMessage(nsAString& aMessage) {
|
||||||
if (!StaticPrefs::dom_forms_datetime()) {
|
|
||||||
return NS_ERROR_UNEXPECTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
return nsContentUtils::GetMaybeLocalizedString(
|
return nsContentUtils::GetMaybeLocalizedString(
|
||||||
nsContentUtils::eDOM_PROPERTIES, "FormValidationInvalidDate",
|
nsContentUtils::eDOM_PROPERTIES, "FormValidationInvalidDate",
|
||||||
mInputElement->OwnerDoc(), aMessage);
|
mInputElement->OwnerDoc(), aMessage);
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
defaults pref(dom.forms.datetime,true)
|
|
||||||
needs-focus == input-load.html input-ref.html
|
needs-focus == input-load.html input-ref.html
|
||||||
needs-focus == input-create.html input-ref.html
|
needs-focus == input-create.html input-ref.html
|
||||||
needs-focus == input-number.html input-number-ref.html
|
needs-focus == input-number.html input-number-ref.html
|
||||||
|
@ -112,7 +112,6 @@ skip-if = os == 'mac'
|
|||||||
[test_stepup_stepdown.html]
|
[test_stepup_stepdown.html]
|
||||||
[test_textarea_attributes_reflection.html]
|
[test_textarea_attributes_reflection.html]
|
||||||
[test_validation.html]
|
[test_validation.html]
|
||||||
[test_valueAsDate_pref.html]
|
|
||||||
[test_valueasdate_attribute.html]
|
[test_valueasdate_attribute.html]
|
||||||
[test_valueasnumber_attribute.html]
|
[test_valueasnumber_attribute.html]
|
||||||
[test_validation_not_in_doc.html]
|
[test_validation_not_in_doc.html]
|
||||||
|
@ -20,71 +20,39 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=764481
|
|||||||
|
|
||||||
var testData = [
|
var testData = [
|
||||||
{
|
{
|
||||||
prefs: [["dom.forms.color", false]],
|
prefs: [["dom.forms.datetime.others", false]],
|
||||||
inputType: "color",
|
|
||||||
expectedType: "text"
|
|
||||||
}, {
|
|
||||||
prefs: [["dom.forms.color", true]],
|
|
||||||
inputType: "color",
|
|
||||||
expectedType: "color"
|
|
||||||
}, {
|
|
||||||
prefs: [["dom.experimental_forms", false], ["dom.forms.datetime", false]],
|
|
||||||
inputType: "date",
|
|
||||||
expectedType: "text"
|
|
||||||
}, {
|
|
||||||
prefs: [["dom.experimental_forms", true], ["dom.forms.datetime", false]],
|
|
||||||
inputType: "date",
|
|
||||||
expectedType: "date"
|
|
||||||
}, {
|
|
||||||
prefs: [["dom.experimental_forms", false], ["dom.forms.datetime", true]],
|
|
||||||
inputType: "date",
|
|
||||||
expectedType: "date"
|
|
||||||
}, {
|
|
||||||
prefs: [["dom.experimental_forms", false], ["dom.forms.datetime", false]],
|
|
||||||
inputType: "time",
|
|
||||||
expectedType: "text"
|
|
||||||
}, {
|
|
||||||
prefs: [["dom.experimental_forms", true], ["dom.forms.datetime", false]],
|
|
||||||
inputType: "time",
|
|
||||||
expectedType: "time"
|
|
||||||
}, {
|
|
||||||
prefs: [["dom.experimental_forms", false], ["dom.forms.datetime", true]],
|
|
||||||
inputType: "time",
|
|
||||||
expectedType: "time"
|
|
||||||
}, {
|
|
||||||
prefs: [["dom.forms.datetime", false], ["dom.forms.datetime.others", false]],
|
|
||||||
inputType: "month",
|
inputType: "month",
|
||||||
expectedType: "text"
|
expectedType: "text"
|
||||||
}, {
|
}, {
|
||||||
prefs: [["dom.forms.datetime", true], ["dom.forms.datetime.others", false]],
|
prefs: [["dom.forms.datetime.others", false]],
|
||||||
inputType: "month",
|
inputType: "month",
|
||||||
expectedType: "text"
|
expectedType: "text"
|
||||||
}, {
|
}, {
|
||||||
prefs: [["dom.forms.datetime", false], ["dom.forms.datetime.others", true]],
|
prefs: [["dom.forms.datetime.others", true]],
|
||||||
inputType: "month",
|
inputType: "month",
|
||||||
expectedType: "month"
|
expectedType: "month"
|
||||||
}, {
|
}, {
|
||||||
prefs: [["dom.forms.datetime", false], ["dom.forms.datetime.others", false]],
|
prefs: [["dom.forms.datetime.others", false]],
|
||||||
inputType: "week",
|
inputType: "week",
|
||||||
expectedType: "text"
|
expectedType: "text"
|
||||||
}, {
|
}, {
|
||||||
prefs: [["dom.forms.datetime", true], ["dom.forms.datetime.others", false]],
|
prefs: [["dom.forms.datetime.others", false]],
|
||||||
inputType: "week",
|
inputType: "week",
|
||||||
expectedType: "text"
|
expectedType: "text"
|
||||||
}, {
|
}, {
|
||||||
prefs: [["dom.forms.datetime", false], ["dom.forms.datetime.others", true]],
|
prefs: [["dom.forms.datetime.others", true]],
|
||||||
inputType: "week",
|
inputType: "week",
|
||||||
expectedType: "week"
|
expectedType: "week"
|
||||||
}, {
|
}, {
|
||||||
prefs: [["dom.forms.datetime", false], ["dom.forms.datetime.others", false]],
|
prefs: [["dom.forms.datetime.others", false]],
|
||||||
inputType: "datetime-local",
|
inputType: "datetime-local",
|
||||||
expectedType: "text"
|
expectedType: "text"
|
||||||
}, {
|
}, {
|
||||||
prefs: [["dom.forms.datetime", true], ["dom.forms.datetime.others", false]],
|
prefs: [["dom.forms.datetime.others", false]],
|
||||||
inputType: "datetime-local",
|
inputType: "datetime-local",
|
||||||
expectedType: "text"
|
expectedType: "text"
|
||||||
}, {
|
}, {
|
||||||
prefs: [["dom.forms.datetime", false], ["dom.forms.datetime.others", true]],
|
prefs: [["dom.forms.datetime.others", true]],
|
||||||
inputType: "datetime-local",
|
inputType: "datetime-local",
|
||||||
expectedType: "datetime-local"
|
expectedType: "datetime-local"
|
||||||
}
|
}
|
||||||
|
@ -1,57 +0,0 @@
|
|||||||
<!DOCTYPE HTML>
|
|
||||||
<html>
|
|
||||||
<!--
|
|
||||||
https://bugzilla.mozilla.org/show_bug.cgi?id=874640
|
|
||||||
-->
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<title>Test for Bug 874640</title>
|
|
||||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
|
||||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
|
||||||
<script type="application/javascript">
|
|
||||||
|
|
||||||
/** Test for Bug 874640 **/
|
|
||||||
var states = [
|
|
||||||
// dom.experimental_forms, dom.forms.datetime, dom.forms.datetime.others, expectedValueAsDate
|
|
||||||
[ 'true', 'true', ,'true', 'true' ],
|
|
||||||
[ 'true', 'false', 'false', 'true' ],
|
|
||||||
[ 'false', 'true', 'false', 'true' ],
|
|
||||||
[ 'false', 'false', 'true', 'true' ],
|
|
||||||
[ 'false', 'false', 'false', 'false' ],
|
|
||||||
'end'
|
|
||||||
];
|
|
||||||
|
|
||||||
SimpleTest.waitForExplicitFinish();
|
|
||||||
|
|
||||||
function runTest(iframe) {
|
|
||||||
var state = states.shift();
|
|
||||||
|
|
||||||
if (state == 'end') {
|
|
||||||
SimpleTest.finish();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
SpecialPowers.pushPrefEnv({"set":[
|
|
||||||
["dom.experimental_forms", state[0] === 'true'],
|
|
||||||
["dom.forms.datetime", state[1] === 'true'],
|
|
||||||
["dom.forms.datetime.others", state[2] === 'true']]},
|
|
||||||
function() {
|
|
||||||
iframe.srcdoc = '<script>' +
|
|
||||||
'parent.is("valueAsDate" in document.createElement("input"), ' +
|
|
||||||
state[3] + ', "valueAsDate presence state should be ' + state[3] + '");' +
|
|
||||||
'<\/script>'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
</script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=874640">Mozilla Bug 874640</a>
|
|
||||||
<p id="display"></p>
|
|
||||||
<div id="content" style="display: none">
|
|
||||||
<iframe onload='runTest(this);'></iframe>
|
|
||||||
</div>
|
|
||||||
<pre id="test">
|
|
||||||
</pre>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@ -94,7 +94,7 @@ interface HTMLInputElement : HTMLElement {
|
|||||||
attribute DOMString defaultValue;
|
attribute DOMString defaultValue;
|
||||||
[CEReactions, Pure, SetterThrows, NeedsCallerType]
|
[CEReactions, Pure, SetterThrows, NeedsCallerType]
|
||||||
attribute [TreatNullAs=EmptyString] DOMString value;
|
attribute [TreatNullAs=EmptyString] DOMString value;
|
||||||
[Throws, Func="HTMLInputElement::ValueAsDateEnabled"]
|
[Throws]
|
||||||
attribute object? valueAsDate;
|
attribute object? valueAsDate;
|
||||||
[Pure, SetterThrows]
|
[Pure, SetterThrows]
|
||||||
attribute unrestricted double valueAsNumber;
|
attribute unrestricted double valueAsNumber;
|
||||||
@ -248,40 +248,36 @@ dictionary DateTimeValue {
|
|||||||
};
|
};
|
||||||
|
|
||||||
partial interface HTMLInputElement {
|
partial interface HTMLInputElement {
|
||||||
[Pref="dom.forms.datetime", ChromeOnly]
|
[ChromeOnly]
|
||||||
DateTimeValue getDateTimeInputBoxValue();
|
DateTimeValue getDateTimeInputBoxValue();
|
||||||
|
|
||||||
[Pref="dom.forms.datetime", ChromeOnly]
|
[ChromeOnly]
|
||||||
readonly attribute Element? dateTimeBoxElement;
|
readonly attribute Element? dateTimeBoxElement;
|
||||||
|
|
||||||
[Pref="dom.forms.datetime", ChromeOnly,
|
[ChromeOnly, BinaryName="getMinimumAsDouble"]
|
||||||
BinaryName="getMinimumAsDouble"]
|
|
||||||
double getMinimum();
|
double getMinimum();
|
||||||
|
|
||||||
[Pref="dom.forms.datetime", ChromeOnly,
|
[ChromeOnly, BinaryName="getMaximumAsDouble"]
|
||||||
BinaryName="getMaximumAsDouble"]
|
|
||||||
double getMaximum();
|
double getMaximum();
|
||||||
|
|
||||||
[Pref="dom.forms.datetime", Func="IsChromeOrUAWidget"]
|
[Func="IsChromeOrUAWidget"]
|
||||||
void openDateTimePicker(optional DateTimeValue initialValue = {});
|
void openDateTimePicker(optional DateTimeValue initialValue = {});
|
||||||
|
|
||||||
[Pref="dom.forms.datetime", Func="IsChromeOrUAWidget"]
|
[Func="IsChromeOrUAWidget"]
|
||||||
void updateDateTimePicker(optional DateTimeValue value = {});
|
void updateDateTimePicker(optional DateTimeValue value = {});
|
||||||
|
|
||||||
[Pref="dom.forms.datetime", Func="IsChromeOrUAWidget"]
|
[Func="IsChromeOrUAWidget"]
|
||||||
void closeDateTimePicker();
|
void closeDateTimePicker();
|
||||||
|
|
||||||
[Pref="dom.forms.datetime", Func="IsChromeOrUAWidget"]
|
[Func="IsChromeOrUAWidget"]
|
||||||
void setFocusState(boolean aIsFocused);
|
void setFocusState(boolean aIsFocused);
|
||||||
|
|
||||||
[Pref="dom.forms.datetime", Func="IsChromeOrUAWidget"]
|
[Func="IsChromeOrUAWidget"]
|
||||||
void updateValidityState();
|
void updateValidityState();
|
||||||
|
|
||||||
[Pref="dom.forms.datetime", Func="IsChromeOrUAWidget",
|
[Func="IsChromeOrUAWidget", BinaryName="getStepAsDouble"]
|
||||||
BinaryName="getStepAsDouble"]
|
|
||||||
double getStep();
|
double getStep();
|
||||||
|
|
||||||
[Pref="dom.forms.datetime", Func="IsChromeOrUAWidget",
|
[Func="IsChromeOrUAWidget", BinaryName="getStepBaseAsDouble"]
|
||||||
BinaryName="getStepBaseAsDouble"]
|
|
||||||
double getStepBase();
|
double getStepBase();
|
||||||
};
|
};
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
== input-color-1.html input-color-1-ref.html
|
== input-color-1.html input-color-1-ref.html
|
||||||
|
|
||||||
defaults pref(dom.forms.color,true)
|
|
||||||
|
|
||||||
fuzzy-if(!nativeThemePref,0-1,0-2) == margin-padding-1.html margin-padding-1-ref.html
|
fuzzy-if(!nativeThemePref,0-1,0-2) == margin-padding-1.html margin-padding-1-ref.html
|
||||||
== block-invalidate-1.html block-invalidate-1-ref.html
|
== block-invalidate-1.html block-invalidate-1-ref.html
|
||||||
== block-invalidate-2.html block-invalidate-2-ref.html
|
== block-invalidate-2.html block-invalidate-2-ref.html
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
defaults pref(dom.forms.datetime,true)
|
|
||||||
|
|
||||||
!= time-simple-unthemed.html time-simple-unthemed-ref.html
|
!= time-simple-unthemed.html time-simple-unthemed-ref.html
|
||||||
!= time-large-font.html time-basic.html
|
!= time-large-font.html time-basic.html
|
||||||
!= time-width-height.html time-basic.html
|
!= time-width-height.html time-basic.html
|
||||||
|
@ -2013,24 +2013,6 @@
|
|||||||
value: 0
|
value: 0
|
||||||
mirror: always
|
mirror: always
|
||||||
|
|
||||||
# Don't use new input types.
|
|
||||||
- name: dom.experimental_forms
|
|
||||||
type: bool
|
|
||||||
value: false
|
|
||||||
mirror: always
|
|
||||||
|
|
||||||
# Enable <input type=color> by default. It will be turned off for remaining
|
|
||||||
# platforms which don't have a color picker implemented yet.
|
|
||||||
- name: dom.forms.color
|
|
||||||
type: bool
|
|
||||||
value: true
|
|
||||||
mirror: always
|
|
||||||
# Is support for input type=date and type=time enabled?
|
|
||||||
- name: dom.forms.datetime
|
|
||||||
type: bool
|
|
||||||
value: true
|
|
||||||
mirror: always
|
|
||||||
|
|
||||||
# Support for input type=month, type=week and type=datetime-local. By default,
|
# Support for input type=month, type=week and type=datetime-local. By default,
|
||||||
# disabled.
|
# disabled.
|
||||||
- name: dom.forms.datetime.others
|
- name: dom.forms.datetime.others
|
||||||
|
@ -607,10 +607,7 @@ async function webdriverSendKeysToElement(
|
|||||||
|
|
||||||
event.input(el);
|
event.input(el);
|
||||||
event.change(el);
|
event.change(el);
|
||||||
} else if (
|
} else if (el.type == "date" || el.type == "time") {
|
||||||
(el.type == "date" || el.type == "time") &&
|
|
||||||
Preferences.get("dom.forms.datetime")
|
|
||||||
) {
|
|
||||||
interaction.setFormControlValue(el, value);
|
interaction.setFormControlValue(el, value);
|
||||||
} else {
|
} else {
|
||||||
event.sendKeysToElement(value, el, win);
|
event.sendKeysToElement(value, el, win);
|
||||||
@ -626,10 +623,7 @@ async function legacySendKeysToElement(el, value, a11y) {
|
|||||||
|
|
||||||
event.input(el);
|
event.input(el);
|
||||||
event.change(el);
|
event.change(el);
|
||||||
} else if (
|
} else if (el.type == "date" || el.type == "time") {
|
||||||
(el.type == "date" || el.type == "time") &&
|
|
||||||
Preferences.get("dom.forms.datetime")
|
|
||||||
) {
|
|
||||||
interaction.setFormControlValue(el, value);
|
interaction.setFormControlValue(el, value);
|
||||||
} else {
|
} else {
|
||||||
let visibilityCheckEl = el;
|
let visibilityCheckEl = el;
|
||||||
|
@ -17,10 +17,6 @@ user_pref("media.mediasource.mp4.enabled", true);
|
|||||||
user_pref("media.mediasource.webm.enabled", true);
|
user_pref("media.mediasource.webm.enabled", true);
|
||||||
user_pref("media.av1.enabled", true);
|
user_pref("media.av1.enabled", true);
|
||||||
user_pref("media.eme.enabled", true);
|
user_pref("media.eme.enabled", true);
|
||||||
// Enable some form preferences for testing
|
|
||||||
user_pref("dom.experimental_forms", true);
|
|
||||||
user_pref("dom.forms.color", true);
|
|
||||||
user_pref("dom.forms.datetime", true);
|
|
||||||
user_pref("dom.forms.datetime.others", true);
|
user_pref("dom.forms.datetime.others", true);
|
||||||
// Enable Gamepad
|
// Enable Gamepad
|
||||||
user_pref("dom.gamepad.enabled", true);
|
user_pref("dom.gamepad.enabled", true);
|
||||||
|
Loading…
Reference in New Issue
Block a user