& aBody,
const ResponseInit& aInit, ErrorResult& rv);
nsIGlobalObject* GetParentObject() const
diff --git a/dom/file/File.h b/dom/file/File.h
index 4343023a164d..4dc448eb75ae 100644
--- a/dom/file/File.h
+++ b/dom/file/File.h
@@ -42,7 +42,7 @@ struct ChromeFilePropertyBag;
struct FilePropertyBag;
class BlobImpl;
class File;
-class OwningArrayBufferOrArrayBufferViewOrBlobOrUSVString;
+class OwningArrayBufferViewOrArrayBufferOrBlobOrUSVString;
class Promise;
class Blob : public nsIDOMBlob
@@ -59,7 +59,7 @@ public:
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(Blob, nsIDOMBlob)
- typedef OwningArrayBufferOrArrayBufferViewOrBlobOrUSVString BlobPart;
+ typedef OwningArrayBufferViewOrArrayBufferOrBlobOrUSVString BlobPart;
// This creates a Blob or a File based on the type of BlobImpl.
static Blob*
diff --git a/dom/file/FileCreatorHelper.cpp b/dom/file/FileCreatorHelper.cpp
index 918fdf72d709..00094c892d5d 100644
--- a/dom/file/FileCreatorHelper.cpp
+++ b/dom/file/FileCreatorHelper.cpp
@@ -99,6 +99,10 @@ FileCreatorHelper::FileCreatorHelper(Promise* aPromise,
MOZ_ASSERT(aPromise);
}
+FileCreatorHelper::~FileCreatorHelper()
+{
+}
+
void
FileCreatorHelper::SendRequest(nsIFile* aFile,
const ChromeFilePropertyBag& aBag,
diff --git a/dom/file/FileCreatorHelper.h b/dom/file/FileCreatorHelper.h
index 4c64ce83ecc3..12cd7e72800a 100644
--- a/dom/file/FileCreatorHelper.h
+++ b/dom/file/FileCreatorHelper.h
@@ -72,7 +72,7 @@ private:
BlobImpl** aBlobImpl);
FileCreatorHelper(Promise* aPromise, nsPIDOMWindowInner* aWindow);
- ~FileCreatorHelper() = default;
+ ~FileCreatorHelper();
void
SendRequest(nsIFile* aFile, const ChromeFilePropertyBag& aBag,
diff --git a/dom/html/HTMLInputElement.cpp b/dom/html/HTMLInputElement.cpp
index f763175ab89a..9dcc5277ab34 100644
--- a/dom/html/HTMLInputElement.cpp
+++ b/dom/html/HTMLInputElement.cpp
@@ -2433,11 +2433,8 @@ HTMLInputElement::GetMaximum() const
Decimal
HTMLInputElement::GetStepBase() const
{
- MOZ_ASSERT(mType == NS_FORM_INPUT_NUMBER ||
- mType == NS_FORM_INPUT_DATE ||
- mType == NS_FORM_INPUT_TIME ||
- mType == NS_FORM_INPUT_MONTH ||
- mType == NS_FORM_INPUT_WEEK ||
+ MOZ_ASSERT(IsDateTimeInputType(mType) ||
+ mType == NS_FORM_INPUT_NUMBER ||
mType == NS_FORM_INPUT_RANGE,
"Check that kDefaultStepBase is correct for this new type");
@@ -8671,6 +8668,7 @@ HTMLInputElement::GetStepScaleFactor() const
case NS_FORM_INPUT_RANGE:
return kStepScaleFactorNumberRange;
case NS_FORM_INPUT_TIME:
+ case NS_FORM_INPUT_DATETIME_LOCAL:
return kStepScaleFactorTime;
case NS_FORM_INPUT_MONTH:
return kStepScaleFactorMonth;
@@ -8695,6 +8693,7 @@ HTMLInputElement::GetDefaultStep() const
case NS_FORM_INPUT_RANGE:
return kDefaultStep;
case NS_FORM_INPUT_TIME:
+ case NS_FORM_INPUT_DATETIME_LOCAL:
return kDefaultStepTime;
default:
MOZ_ASSERT(false, "Unrecognized input type");
diff --git a/dom/html/HTMLInputElement.h b/dom/html/HTMLInputElement.h
index fe97471c0a55..7fa84726330f 100644
--- a/dom/html/HTMLInputElement.h
+++ b/dom/html/HTMLInputElement.h
@@ -1070,11 +1070,7 @@ protected:
/**
* Returns if the step attribute apply for the current type.
*/
- bool DoesStepApply() const
- {
- // TODO: this is temporary until bug 888331 is fixed.
- return DoesMinMaxApply() && mType != NS_FORM_INPUT_DATETIME_LOCAL;
- }
+ bool DoesStepApply() const { return DoesMinMaxApply(); }
/**
* Returns if stepDown and stepUp methods apply for the current type.
diff --git a/dom/html/HTMLObjectElement.cpp b/dom/html/HTMLObjectElement.cpp
index c509ac1af3ed..b80c684d5d6d 100644
--- a/dom/html/HTMLObjectElement.cpp
+++ b/dom/html/HTMLObjectElement.cpp
@@ -79,7 +79,7 @@ HTMLObjectElement::DoneAddingChildren(bool aHaveNotified)
// If we're already in a document, we need to trigger the load
// Otherwise, BindToTree takes care of that.
if (IsInComposedDoc()) {
- StartObjectLoad(aHaveNotified);
+ StartObjectLoad(aHaveNotified, false);
}
}
@@ -310,7 +310,8 @@ HTMLObjectElement::SetAttr(int32_t aNameSpaceID, nsIAtom *aName,
// a document, just in case that the caller wants to set additional
// attributes before inserting the node into the document.
if (aNotify && IsInComposedDoc() && mIsDoneAddingChildren &&
- aNameSpaceID == kNameSpaceID_None && aName == nsGkAtoms::data) {
+ aNameSpaceID == kNameSpaceID_None && aName == nsGkAtoms::data &&
+ !BlockEmbedOrObjectContentLoading()) {
return LoadObject(aNotify, true);
}
@@ -327,7 +328,8 @@ HTMLObjectElement::UnsetAttr(int32_t aNameSpaceID, nsIAtom* aAttribute,
// See comment in SetAttr
if (aNotify && IsInComposedDoc() && mIsDoneAddingChildren &&
- aNameSpaceID == kNameSpaceID_None && aAttribute == nsGkAtoms::data) {
+ aNameSpaceID == kNameSpaceID_None && aAttribute == nsGkAtoms::data &&
+ !BlockEmbedOrObjectContentLoading()) {
return LoadObject(aNotify, true);
}
@@ -535,15 +537,16 @@ HTMLObjectElement::GetAttributeMappingFunction() const
}
void
-HTMLObjectElement::StartObjectLoad(bool aNotify)
+HTMLObjectElement::StartObjectLoad(bool aNotify, bool aForce)
{
// BindToTree can call us asynchronously, and we may be removed from the tree
// in the interim
- if (!IsInComposedDoc() || !OwnerDoc()->IsActive()) {
+ if (!IsInComposedDoc() || !OwnerDoc()->IsActive() ||
+ BlockEmbedOrObjectContentLoading()) {
return;
}
- LoadObject(aNotify);
+ LoadObject(aNotify, aForce);
SetIsNetworkCreated(false);
}
diff --git a/dom/html/HTMLObjectElement.h b/dom/html/HTMLObjectElement.h
index 7cb98249beb9..f439108fee14 100644
--- a/dom/html/HTMLObjectElement.h
+++ b/dom/html/HTMLObjectElement.h
@@ -98,7 +98,7 @@ public:
nsresult CopyInnerTo(Element* aDest);
- void StartObjectLoad() { StartObjectLoad(true); }
+ void StartObjectLoad() { StartObjectLoad(true, false); }
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(HTMLObjectElement,
nsGenericHTMLFormElement)
@@ -247,12 +247,12 @@ public:
return GetContentDocument(aSubjectPrincipal);
}
-private:
/**
* Calls LoadObject with the correct arguments to start the plugin load.
*/
- void StartObjectLoad(bool aNotify);
+ void StartObjectLoad(bool aNotify, bool aForceLoad);
+private:
/**
* Returns if the element is currently focusable regardless of it's tabindex
* value. This is used to know the default tabindex value.
diff --git a/dom/html/HTMLSharedObjectElement.cpp b/dom/html/HTMLSharedObjectElement.cpp
index 1f7b9cc6ae46..9c78b03a360c 100644
--- a/dom/html/HTMLSharedObjectElement.cpp
+++ b/dom/html/HTMLSharedObjectElement.cpp
@@ -180,7 +180,7 @@ HTMLSharedObjectElement::SetAttr(int32_t aNameSpaceID, nsIAtom *aName,
// attributes before inserting the node into the document.
if (aNotify && IsInComposedDoc() && mIsDoneAddingChildren &&
aNameSpaceID == kNameSpaceID_None && aName == URIAttrName()
- && !BlockEmbedContentLoading()) {
+ && !BlockEmbedOrObjectContentLoading()) {
return LoadObject(aNotify, true);
}
@@ -313,7 +313,7 @@ HTMLSharedObjectElement::StartObjectLoad(bool aNotify, bool aForceLoad)
// BindToTree can call us asynchronously, and we may be removed from the tree
// in the interim
if (!IsInComposedDoc() || !OwnerDoc()->IsActive() ||
- BlockEmbedContentLoading()) {
+ BlockEmbedOrObjectContentLoading()) {
return;
}
@@ -389,31 +389,5 @@ HTMLSharedObjectElement::GetContentPolicyType() const
}
}
-bool
-HTMLSharedObjectElement::BlockEmbedContentLoading()
-{
- // Only check on embed elements
- if (!IsHTMLElement(nsGkAtoms::embed)) {
- return false;
- }
- // Traverse up the node tree to see if we have any ancestors that may block us
- // from loading
- for (nsIContent* parent = GetParent(); parent; parent = parent->GetParent()) {
- if (parent->IsAnyOfHTMLElements(nsGkAtoms::video, nsGkAtoms::audio)) {
- return true;
- }
- // If we have an ancestor that is an object with a source, it'll have an
- // associated displayed type. If that type is not null, don't load content
- // for the embed.
- if (HTMLObjectElement* object = HTMLObjectElement::FromContent(parent)) {
- uint32_t type = object->DisplayedType();
- if (type != eType_Null) {
- return true;
- }
- }
- }
- return false;
-}
-
} // namespace dom
} // namespace mozilla
diff --git a/dom/html/HTMLSharedObjectElement.h b/dom/html/HTMLSharedObjectElement.h
index 3d51d0a996b6..a6e7fe65d250 100644
--- a/dom/html/HTMLSharedObjectElement.h
+++ b/dom/html/HTMLSharedObjectElement.h
@@ -220,21 +220,6 @@ private:
static void MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
GenericSpecifiedValues* aGenericData);
-
- /**
- * Decides whether we should load embed node content.
- *
- * If this is an embed node there are cases in which we should not try to load
- * the content:
- *
- * - If the embed node is the child of a media element
- * - If the embed node is the child of an object node that already has
- * content being loaded.
- *
- * In these cases, this function will return false, which will cause
- * us to skip calling LoadObject.
- */
- bool BlockEmbedContentLoading();
};
} // namespace dom
diff --git a/dom/html/nsGenericHTMLFrameElement.cpp b/dom/html/nsGenericHTMLFrameElement.cpp
index 76056536af4d..4b5b71a5965f 100644
--- a/dom/html/nsGenericHTMLFrameElement.cpp
+++ b/dom/html/nsGenericHTMLFrameElement.cpp
@@ -453,18 +453,28 @@ nsGenericHTMLFrameElement::IsHTMLFocusable(bool aWithMouse,
return false;
}
+static bool sMozBrowserFramesEnabled = false;
+#ifdef DEBUG
+static bool sBoolVarCacheInitialized = false;
+#endif
+
+void
+nsGenericHTMLFrameElement::InitStatics()
+{
+ MOZ_ASSERT(!sBoolVarCacheInitialized);
+ MOZ_ASSERT(NS_IsMainThread());
+ Preferences::AddBoolVarCache(&sMozBrowserFramesEnabled,
+ "dom.mozBrowserFramesEnabled");
+#ifdef DEBUG
+ sBoolVarCacheInitialized = true;
+#endif
+}
+
+
bool
nsGenericHTMLFrameElement::BrowserFramesEnabled()
{
- static bool sMozBrowserFramesEnabled = false;
- static bool sBoolVarCacheInitialized = false;
-
- if (!sBoolVarCacheInitialized) {
- sBoolVarCacheInitialized = true;
- Preferences::AddBoolVarCache(&sMozBrowserFramesEnabled,
- "dom.mozBrowserFramesEnabled");
- }
-
+ MOZ_ASSERT(sBoolVarCacheInitialized);
return sMozBrowserFramesEnabled;
}
diff --git a/dom/html/nsGenericHTMLFrameElement.h b/dom/html/nsGenericHTMLFrameElement.h
index d9c2df9d5714..fd565e8bb5e8 100644
--- a/dom/html/nsGenericHTMLFrameElement.h
+++ b/dom/html/nsGenericHTMLFrameElement.h
@@ -71,6 +71,8 @@ public:
virtual int32_t TabIndexDefault() override;
+ virtual nsIMozBrowserFrame* GetAsMozBrowserFrame() override { return this; }
+
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsGenericHTMLFrameElement,
nsGenericHTMLElement)
@@ -86,6 +88,7 @@ public:
void PresetOpenerWindow(mozIDOMWindowProxy* aOpenerWindow,
mozilla::ErrorResult& aRv);
+ static void InitStatics();
static bool BrowserFramesEnabled();
/**
diff --git a/dom/html/test/forms/test_step_attribute.html b/dom/html/test/forms/test_step_attribute.html
index 31277860c9d9..a14afa46125d 100644
--- a/dom/html/test/forms/test_step_attribute.html
+++ b/dom/html/test/forms/test_step_attribute.html
@@ -31,8 +31,7 @@ var data = [
{ type: 'month', apply: true },
{ type: 'week', apply: true },
{ type: 'time', apply: true },
- // TODO: temporary set to false until bug 888331 is fixed.
- { type: 'datetime-local', apply: false },
+ { type: 'datetime-local', apply: true },
{ type: 'number', apply: true },
{ type: 'range', apply: true },
{ type: 'color', apply: false },
@@ -950,7 +949,104 @@ for (var test of data) {
break;
case 'datetime-local':
- // TODO: this is temporary until bug 888331 is fixed.
+ // When step is invalid, every datetime is valid
+ input.step = 0;
+ input.value = '2017-02-06T12:00';
+ checkValidity(input, true, apply);
+
+ input.step = 'foo';
+ input.value = '1970-01-01T00:00';
+ checkValidity(input, true, apply);
+
+ input.step = '-1';
+ input.value = '1969-12-12 00:10';
+ checkValidity(input, true, apply);
+
+ input.removeAttribute('step');
+ input.value = '1500-01-01T12:00';
+ checkValidity(input, true, apply);
+
+ input.step = 'any';
+ input.value = '1966-12-12T12:00';
+ checkValidity(input, true, apply);
+
+ input.step = 'ANY';
+ input.value = '2017-01-01 12:00';
+ checkValidity(input, true, apply);
+
+ // When min is set to a valid datetime, there is a step base.
+ input.min = '2017-01-01T00:00:00';
+ input.step = '2';
+ input.value = '2017-01-01T00:00:02';
+ checkValidity(input, true, apply);
+
+ input.value = '2017-01-01T00:00:03';
+ checkValidity(input, false, apply,
+ { low: "2017-01-01T00:00:02", high: "2017-01-01T00:00:04" });
+
+ input.min = '2017-01-01T00:00:05';
+ input.value = '2017-01-01T00:00:08';
+ checkValidity(input, false, apply,
+ { low: "2017-01-01T00:00:07", high: "2017-01-01T00:00:09" });
+
+ input.min = '2000-01-01T00:00';
+ input.step = '120';
+ input.value = '2000-01-01T00:02';
+ checkValidity(input, true, apply);
+
+ // Without any step attribute the datetime is valid
+ input.removeAttribute('step');
+ checkValidity(input, true, apply);
+
+ input.min = '1950-01-01T00:00';
+ input.step = '129600'; // 1.5 day
+ input.value = '1950-01-02T00:00';
+ checkValidity(input, false, apply,
+ { low: "1950-01-01T00:00", high: "1950-01-02T12:00" });
+
+ input.step = '259200'; // 3 days
+ input.value = '1950-01-04T12:00';
+ checkValidity(input, false, apply,
+ { low: "1950-01-04T00:00", high: "1950-01-07T00:00" });
+
+ input.value = '1950-01-10T00:00';
+ checkValidity(input, true, apply);
+
+ input.step = '0.5'; // half a second
+ input.value = '1950-01-01T00:00:00.123';
+ checkValidity(input, false, apply,
+ { low: "1950-01-01T00:00", high: "1950-01-01T00:00:00.500" });
+
+ input.value = '2000-01-01T12:30:30.600';
+ checkValidity(input, false, apply,
+ { low: "2000-01-01T12:30:30.500", high: "2000-01-01T12:30:31" });
+
+ input.value = '1950-01-05T00:00:00.500';
+ checkValidity(input, true, apply);
+
+ input.step = '2.1';
+ input.min = '1991-01-01T12:00';
+ input.value = '1991-01-01T12:00';
+ checkValidity(input, true, apply);
+
+ input.value = '1991-01-01T12:00:03';
+ checkValidity(input, false, apply,
+ { low: "1991-01-01T12:00:02.100", high: "1991-01-01T12:00:04.200" });
+
+ input.value = '1991-01-01T12:00:06.3';
+ checkValidity(input, true, apply);
+
+ input.step = '2.1';
+ input.min = '1969-12-20T10:00:05';
+ input.value = '1969-12-20T10:00:05';
+ checkValidity(input, true, apply);
+
+ input.value = '1969-12-20T10:00:08';
+ checkValidity(input, false, apply,
+ { low: "1969-12-20T10:00:07.100", high: "1969-12-20T10:00:09.200" });
+
+ input.value = '1969-12-20T10:00:09.200';
+ checkValidity(input, true, apply);
break;
default:
diff --git a/dom/html/test/forms/test_stepup_stepdown.html b/dom/html/test/forms/test_stepup_stepdown.html
index d968951801e0..21cde58aa567 100644
--- a/dom/html/test/forms/test_stepup_stepdown.html
+++ b/dom/html/test/forms/test_stepup_stepdown.html
@@ -52,13 +52,8 @@ function checkAvailability()
["time", true],
["month", true],
["week", true],
- ["color", false],
- ];
-
- var todoList =
- [
- ["datetime", true],
["datetime-local", true],
+ ["color", false],
];
var element = document.createElement("input");
@@ -82,27 +77,6 @@ function checkAvailability()
}
is(exceptionCaught, !data[1], "stepUp() availability is not correct");
}
-
- for (data of todoList) {
- var exceptionCaught = false;
- element.type = data[0];
- try {
- element.stepDown();
- } catch (e) {
- exceptionCaught = true;
- }
- todo_is(exceptionCaught, !data[1],
- "stepDown() availability is not correct");
-
- exceptionCaught = false;
- try {
- element.stepUp();
- } catch (e) {
- exceptionCaught = true;
- }
- todo_is(exceptionCaught, !data[1],
- "stepUp() availability is not correct");
- }
}
function checkStepDown()
@@ -509,6 +483,80 @@ function checkStepDown()
[ '2016-W01', 'AnY', null, null, 1, null, true ],
[ '2016-W01', 'aNy', null, null, 1, null, true ],
]},
+ { type: 'datetime-local', data: [
+ // Regular case.
+ [ '2017-02-07T09:30', null, null, null, null, '2017-02-07T09:29', false ],
+ // Argument testing.
+ [ '2017-02-07T09:30', null, null, null, 1, '2017-02-07T09:29', false ],
+ [ '2017-02-07T09:30', null, null, null, 5, '2017-02-07T09:25', false ],
+ [ '2017-02-07T09:30', null, null, null, -1, '2017-02-07T09:31', false ],
+ [ '2017-02-07T09:30', null, null, null, 0, '2017-02-07T09:30', false ],
+ // hour/minutes/seconds wrapping.
+ [ '2000-01-01T05:00', null, null, null, null, '2000-01-01T04:59', false ],
+ [ '2000-01-01T05:00:00', 1, null, null, null, '2000-01-01T04:59:59', false ],
+ [ '2000-01-01T05:00:00', 0.1, null, null, null, '2000-01-01T04:59:59.900', false ],
+ [ '2000-01-01T05:00:00', 0.01, null, null, null, '2000-01-01T04:59:59.990', false ],
+ [ '2000-01-01T05:00:00', 0.001, null, null, null, '2000-01-01T04:59:59.999', false ],
+ // month/year wrapping.
+ [ '2012-08-01T12:00', null, null, null, 1440, '2012-07-31T12:00', false ],
+ [ '1969-01-02T12:00', null, null, null, 5760, '1968-12-29T12:00', false ],
+ [ '1969-12-31T00:00', null, null, null, -1440, '1970-01-01T00:00', false ],
+ [ '2012-02-29T00:00', null, null, null, -1440, '2012-03-01T00:00', false ],
+ // stepDown() on '00:00' gives '23:59'.
+ [ '2017-02-07T00:00', null, null, null, 1, '2017-02-06T23:59', false ],
+ [ '2017-02-07T00:00', null, null, null, 3, '2017-02-06T23:57', false ],
+ // Some random step values..
+ [ '2017-02-07T16:07', '0.5', null, null, null, '2017-02-07T16:06:59.500', false ],
+ [ '2017-02-07T16:07', '2', null, null, null, '2017-02-07T16:06:58', false ],
+ [ '2017-02-07T16:07', '0.25', null, null, 4, '2017-02-07T16:06:59', false ],
+ [ '2017-02-07T16:07', '1.1', '2017-02-07T16:00', null, 1, '2017-02-07T16:06:59.100', false ],
+ [ '2017-02-07T16:07', '1.1', '2017-02-07T16:00', null, 2, '2017-02-07T16:06:58', false ],
+ [ '2017-02-07T16:07', '1.1', '2017-02-07T16:00', null, 10, '2017-02-07T16:06:49.200', false ],
+ [ '2017-02-07T16:07', '129600', '2017-02-01T00:00', null, 2, '2017-02-05T12:00', false ],
+ // step = 0 isn't allowed (-> step = 1).
+ [ '2017-02-07T10:15', '0', null, null, null, '2017-02-07T10:14', false ],
+ // step < 0 isn't allowed (-> step = 1).
+ [ '2017-02-07T10:15', '-1', null, null, null, '2017-02-07T10:14', false ],
+ // step = NaN isn't allowed (-> step = 1).
+ [ '2017-02-07T10:15', 'foo', null, null, null, '2017-02-07T10:14', false ],
+ // Min values testing.
+ [ '2012-02-02T17:02', '60', 'foo', null, 2, '2012-02-02T17:00', false ],
+ [ '2012-02-02T17:10', '60', '2012-02-02T17:09', null, null, '2012-02-02T17:09', false ],
+ [ '2012-02-02T17:10', '60', '2012-02-02T17:10', null, null, '2012-02-02T17:10', false ],
+ [ '2012-02-02T17:10', '60', '2012-02-02T17:30', null, 1, '2012-02-02T17:10', false ],
+ [ '2012-02-02T17:10', '180', '2012-02-02T17:05', null, null, '2012-02-02T17:08', false ],
+ [ '2012-02-03T20:05', '86400', '2012-02-02T17:05', null, null, '2012-02-03T17:05', false ],
+ [ '2012-02-03T18:00', '129600', '2012-02-01T00:00', null, null, '2012-02-02T12:00', false ],
+ // Max values testing.
+ [ '2012-02-02T17:15', '60', null, 'foo', null, '2012-02-02T17:14', false ],
+ [ '2012-02-02T17:15', null, null, '2012-02-02T17:20', null, '2012-02-02T17:14', false ],
+ [ '2012-02-02T17:15', null, null, '2012-02-02T17:15', null, '2012-02-02T17:14', false ],
+ [ '2012-02-02T17:15', null, null, '2012-02-02T17:13', 4, '2012-02-02T17:11', false ],
+ [ '2012-02-02T17:15', '120', null, '2012-02-02T17:13', 3, '2012-02-02T17:09', false ],
+ [ '2012-02-03T20:05', '86400', null, '2012-02-03T20:05', null, '2012-02-02T20:05', false ],
+ [ '2012-02-03T18:00', '129600', null, '2012-02-03T20:00', null, '2012-02-02T06:00', false ],
+ // Step mismatch.
+ [ '2017-02-07T17:19', '120', '2017-02-07T17:10', null, null, '2017-02-07T17:18', false ],
+ [ '2017-02-07T17:19', '120', '2017-02-07T17:10', null, 2, '2017-02-07T17:16', false ],
+ [ '2017-02-07T17:19', '120', '2017-02-07T17:18', '2017-02-07T17:25', null, '2017-02-07T17:18', false ],
+ [ '2017-02-07T17:19', '120', null, null, null, '2017-02-07T17:17', false ],
+ [ '2017-02-07T17:19', '180', null, null, null, '2017-02-07T17:16', false ],
+ [ '2017-02-07T17:19', '172800', '2017-02-02T17:19', '2017-02-10T17:19', null, '2017-02-06T17:19', false ],
+ // Clamping.
+ [ '2017-02-07T17:22', null, null, '2017-02-07T17:11', null, '2017-02-07T17:11', false ],
+ [ '2017-02-07T17:22', '120', '2017-02-07T17:20', '2017-02-07T17:22', null, '2017-02-07T17:20', false ],
+ [ '2017-02-07T17:22', '300', '2017-02-07T17:12', '2017-02-07T17:20', 10, '2017-02-07T17:12', false ],
+ [ '2017-02-07T17:22', '300', '2017-02-07T17:18', '2017-02-07T17:20', 2, '2017-02-07T17:18', false ],
+ [ '2017-02-07T17:22', '600', '2017-02-02T17:00', '2017-02-07T17:00', 15, '2017-02-07T15:00', false ],
+ [ '2017-02-07T17:22', '600', '2017-02-02T17:00', '2017-02-07T17:00', 2, '2017-02-07T17:00', false ],
+ // value = "" (NaN).
+ [ '', null, null, null, null, '1969-12-31T23:59', false ],
+ // With step = 'any'.
+ [ '2017-02-07T15:20', 'any', null, null, 1, null, true ],
+ [ '2017-02-07T15:20', 'ANY', null, null, 1, null, true ],
+ [ '2017-02-07T15:20', 'AnY', null, null, 1, null, true ],
+ [ '2017-02-07T15:20', 'aNy', null, null, 1, null, true ],
+ ]},
];
for (var test of testData) {
@@ -958,6 +1006,78 @@ function checkStepUp()
[ '2016-W01', 'AnY', null, null, 1, null, true ],
[ '2016-W01', 'aNy', null, null, 1, null, true ],
]},
+ { type: 'datetime-local', data: [
+ // Regular case.
+ [ '2017-02-07T17:09', null, null, null, null, '2017-02-07T17:10', false ],
+ // Argument testing.
+ [ '2017-02-07T17:10', null, null, null, 1, '2017-02-07T17:11', false ],
+ [ '2017-02-07T17:10', null, null, null, 5, '2017-02-07T17:15', false ],
+ [ '2017-02-07T17:10', null, null, null, -1, '2017-02-07T17:09', false ],
+ [ '2017-02-07T17:10', null, null, null, 0, '2017-02-07T17:10', false ],
+ // hour/minutes/seconds wrapping.
+ [ '2000-01-01T04:59', null, null, null, null, '2000-01-01T05:00', false ],
+ [ '2000-01-01T04:59:59', 1, null, null, null, '2000-01-01T05:00', false ],
+ [ '2000-01-01T04:59:59.900', 0.1, null, null, null, '2000-01-01T05:00', false ],
+ [ '2000-01-01T04:59:59.990', 0.01, null, null, null, '2000-01-01T05:00', false ],
+ [ '2000-01-01T04:59:59.999', 0.001, null, null, null, '2000-01-01T05:00', false ],
+ // month/year wrapping.
+ [ '2012-07-31T12:00', null, null, null, 1440, '2012-08-01T12:00', false ],
+ [ '1968-12-29T12:00', null, null, null, 5760, '1969-01-02T12:00', false ],
+ [ '1970-01-01T00:00', null, null, null, -1440, '1969-12-31T00:00', false ],
+ [ '2012-03-01T00:00', null, null, null, -1440, '2012-02-29T00:00', false ],
+ // stepUp() on '23:59' gives '00:00'.
+ [ '2017-02-07T23:59', null, null, null, 1, '2017-02-08T00:00', false ],
+ [ '2017-02-07T23:59', null, null, null, 3, '2017-02-08T00:02', false ],
+ // Some random step values..
+ [ '2017-02-07T17:40', '0.5', null, null, null, '2017-02-07T17:40:00.500', false ],
+ [ '2017-02-07T17:40', '2', null, null, null, '2017-02-07T17:40:02', false ],
+ [ '2017-02-07T17:40', '0.25', null, null, 4, '2017-02-07T17:40:01', false ],
+ [ '2017-02-07T17:40', '1.1', '2017-02-07T17:00', null, 1, '2017-02-07T17:40:00.200', false ],
+ [ '2017-02-07T17:40', '1.1', '2017-02-07T17:00', null, 2, '2017-02-07T17:40:01.300', false ],
+ [ '2017-02-07T17:40', '1.1', '2017-02-07T17:00', null, 10, '2017-02-07T17:40:10.100', false ],
+ [ '2017-02-07T17:40', '129600', '2017-02-01T00:00', null, 2, '2017-02-10T00:00', false ],
+ // step = 0 isn't allowed (-> step = 1).
+ [ '2017-02-07T17:39', '0', null, null, null, '2017-02-07T17:40', false ],
+ // step < 0 isn't allowed (-> step = 1).
+ [ '2017-02-07T17:39', '-1', null, null, null, '2017-02-07T17:40', false ],
+ // step = NaN isn't allowed (-> step = 1).
+ [ '2017-02-07T17:39', 'foo', null, null, null, '2017-02-07T17:40', false ],
+ // Min values testing.
+ [ '2012-02-02T17:00', '60', 'foo', null, 2, '2012-02-02T17:02', false ],
+ [ '2012-02-02T17:10', '60', '2012-02-02T17:10', null, null, '2012-02-02T17:11', false ],
+ [ '2012-02-02T17:10', '60', '2012-02-02T17:30', null, 1, '2012-02-02T17:30', false ],
+ [ '2012-02-02T17:10', '180', '2012-02-02T17:05', null, null, '2012-02-02T17:11', false ],
+ [ '2012-02-02T17:10', '86400', '2012-02-02T17:05', null, null, '2012-02-03T17:05', false ],
+ [ '2012-02-02T17:10', '129600', '2012-02-01T00:00', null, null, '2012-02-04T00:00', false ],
+ // Max values testing.
+ [ '2012-02-02T17:15', '60', null, 'foo', null, '2012-02-02T17:16', false ],
+ [ '2012-02-02T17:15', null, null, '2012-02-02T17:20', null, '2012-02-02T17:16', false ],
+ [ '2012-02-02T17:15', null, null, '2012-02-02T17:15', null, '2012-02-02T17:15', false ],
+ [ '2012-02-02T17:15', null, null, '2012-02-02T17:13', 4, '2012-02-02T17:15', false ],
+ [ '2012-02-02T20:05', '86400', null, '2012-02-03T20:05', null, '2012-02-03T20:05', false ],
+ [ '2012-02-02T18:00', '129600', null, '2012-02-04T20:00', null, '2012-02-04T06:00', false ],
+ // Step mismatch.
+ [ '2017-02-07T17:19', '120', '2017-02-07T17:10', null, null, '2017-02-07T17:20', false ],
+ [ '2017-02-07T17:19', '120', '2017-02-07T17:10', null, 2, '2017-02-07T17:22', false ],
+ [ '2017-02-07T17:19', '120', '2017-02-07T17:18', '2017-02-07T17:25', null, '2017-02-07T17:20', false ],
+ [ '2017-02-07T17:19', '120', null, null, null, '2017-02-07T17:21', false ],
+ [ '2017-02-07T17:19', '180', null, null, null, '2017-02-07T17:22', false ],
+ [ '2017-02-03T17:19', '172800', '2017-02-02T17:19', '2017-02-10T17:19', null, '2017-02-04T17:19', false ],
+ // Clamping.
+ [ '2017-02-07T17:22', null, null, '2017-02-07T17:11', null, '2017-02-07T17:22', false ],
+ [ '2017-02-07T17:22', '120', '2017-02-07T17:20', '2017-02-07T17:22', null, '2017-02-07T17:22', false ],
+ [ '2017-02-07T17:22', '300', '2017-02-07T17:12', '2017-02-07T17:20', 10, '2017-02-07T17:22', false ],
+ [ '2017-02-07T17:22', '300', '2017-02-07T17:18', '2017-02-07T17:20', 2, '2017-02-07T17:22', false ],
+ [ '2017-02-06T17:22', '600', '2017-02-02T17:00', '2017-02-07T17:20', 15, '2017-02-06T19:50', false ],
+ [ '2017-02-06T17:22', '600', '2017-02-02T17:10', '2017-02-07T17:20', 2, '2017-02-06T17:40', false ],
+ // value = "" (NaN).
+ [ '', null, null, null, null, '1970-01-01T00:01', false ],
+ // With step = 'any'.
+ [ '2017-02-07T17:30', 'any', null, null, 1, null, true ],
+ [ '2017-02-07T17:30', 'ANY', null, null, 1, null, true ],
+ [ '2017-02-07T17:30', 'AnY', null, null, 1, null, true ],
+ [ '2017-02-07T17:30', 'aNy', null, null, 1, null, true ],
+ ]},
];
for (var test of testData) {
diff --git a/dom/ipc/ContentPrefs.cpp b/dom/ipc/ContentPrefs.cpp
index 714c18f76202..6d65b4914cfc 100644
--- a/dom/ipc/ContentPrefs.cpp
+++ b/dom/ipc/ContentPrefs.cpp
@@ -42,6 +42,7 @@ const char* mozilla::dom::ContentPrefs::gInitPrefs[] = {
"dom.ipc.processPriorityManager.backgroundPerceivableGracePeriodMS",
"dom.max_chrome_script_run_time",
"dom.max_script_run_time",
+ "dom.mozBrowserFramesEnabled",
"dom.performance.enable_notify_performance_timing",
"dom.performance.enable_user_timing_logging",
"dom.storage.testing",
diff --git a/dom/plugins/ipc/PPluginModule.ipdl b/dom/plugins/ipc/PPluginModule.ipdl
index 29de2048545c..369f3ecf7182 100644
--- a/dom/plugins/ipc/PPluginModule.ipdl
+++ b/dom/plugins/ipc/PPluginModule.ipdl
@@ -160,7 +160,7 @@ parent:
async ReturnSitesWithData(nsCString[] aSites, uint64_t aCallbackId);
- sync GetKeyState(int32_t aVirtKey)
+ intr GetKeyState(int32_t aVirtKey)
returns (int16_t aState);
intr NPN_SetValue_NPPVpluginRequiresAudioDeviceChanges(bool shouldRegister)
diff --git a/dom/plugins/ipc/PluginModuleChild.cpp b/dom/plugins/ipc/PluginModuleChild.cpp
index 87e8598a502d..ba3cf9f7c311 100644
--- a/dom/plugins/ipc/PluginModuleChild.cpp
+++ b/dom/plugins/ipc/PluginModuleChild.cpp
@@ -2118,7 +2118,7 @@ PMCGetKeyState(int aVirtKey)
PluginModuleChild* chromeInstance = PluginModuleChild::GetChrome();
if (chromeInstance) {
int16_t ret = 0;
- if (chromeInstance->SendGetKeyState(aVirtKey, &ret)) {
+ if (chromeInstance->CallGetKeyState(aVirtKey, &ret)) {
return ret;
}
}
diff --git a/dom/plugins/ipc/PluginModuleParent.cpp b/dom/plugins/ipc/PluginModuleParent.cpp
index dbf11cc1b4b1..84c1925dae0a 100644
--- a/dom/plugins/ipc/PluginModuleParent.cpp
+++ b/dom/plugins/ipc/PluginModuleParent.cpp
@@ -3403,19 +3403,19 @@ PluginModuleChromeParent::RecvProfile(const nsCString& aProfile)
}
mozilla::ipc::IPCResult
-PluginModuleParent::RecvGetKeyState(const int32_t& aVirtKey, int16_t* aRet)
+PluginModuleParent::AnswerGetKeyState(const int32_t& aVirtKey, int16_t* aRet)
{
return IPC_FAIL_NO_REASON(this);
}
mozilla::ipc::IPCResult
-PluginModuleChromeParent::RecvGetKeyState(const int32_t& aVirtKey,
+PluginModuleChromeParent::AnswerGetKeyState(const int32_t& aVirtKey,
int16_t* aRet)
{
#if defined(XP_WIN)
*aRet = ::GetKeyState(aVirtKey);
return IPC_OK();
#else
- return PluginModuleParent::RecvGetKeyState(aVirtKey, aRet);
+ return PluginModuleParent::AnswerGetKeyState(aVirtKey, aRet);
#endif
}
diff --git a/dom/plugins/ipc/PluginModuleParent.h b/dom/plugins/ipc/PluginModuleParent.h
index dc56749701c8..25e251c7452a 100644
--- a/dom/plugins/ipc/PluginModuleParent.h
+++ b/dom/plugins/ipc/PluginModuleParent.h
@@ -213,7 +213,7 @@ protected:
virtual mozilla::ipc::IPCResult RecvProfile(const nsCString& aProfile) override { return IPC_OK(); }
- virtual mozilla::ipc::IPCResult RecvGetKeyState(const int32_t& aVirtKey, int16_t* aRet) override;
+ virtual mozilla::ipc::IPCResult AnswerGetKeyState(const int32_t& aVirtKey, int16_t* aRet) override;
virtual mozilla::ipc::IPCResult RecvReturnClearSiteData(const NPError& aRv,
const uint64_t& aCallbackId) override;
@@ -507,7 +507,7 @@ class PluginModuleChromeParent
RecvProfile(const nsCString& aProfile) override;
virtual mozilla::ipc::IPCResult
- RecvGetKeyState(const int32_t& aVirtKey, int16_t* aRet) override;
+ AnswerGetKeyState(const int32_t& aVirtKey, int16_t* aRet) override;
private:
virtual void
diff --git a/dom/plugins/test/mochitest/mochitest.ini b/dom/plugins/test/mochitest/mochitest.ini
index 9f882bf6b38a..f70137dfeaba 100644
--- a/dom/plugins/test/mochitest/mochitest.ini
+++ b/dom/plugins/test/mochitest/mochitest.ini
@@ -124,7 +124,9 @@ skip-if = true # Bug 596491
[test_pluginstream_asfileonly.html]
[test_pluginstream_err.html]
[test_pluginstream_geturl.html]
+skip-if = true # Bug 1267432
[test_pluginstream_geturlnotify.html]
+skip-if = true # Bug 1267432
[test_pluginstream_newstream.html]
[test_pluginstream_post.html]
[test_pluginstream_poststream.html]
diff --git a/dom/tests/mochitest/general/resource_timing_cross_origin.html b/dom/tests/mochitest/general/resource_timing_cross_origin.html
index c5b906280744..6a82885a74c4 100644
--- a/dom/tests/mochitest/general/resource_timing_cross_origin.html
+++ b/dom/tests/mochitest/general/resource_timing_cross_origin.html
@@ -170,16 +170,16 @@ function finishTests() {
-