Backed out 8 changesets (bug 1267510) for causing unacceptably frequent failures in animation mochitests a=backout

Backed out changeset 2a2c42608ff0 (bug 1267510)
Backed out changeset 4cdb7f5b6f7c (bug 1267510)
Backed out changeset e89ec30077a0 (bug 1267510)
Backed out changeset 884243ce4287 (bug 1267510)
Backed out changeset 130a231c5acc (bug 1267510)
Backed out changeset 1ace442f6123 (bug 1267510)
Backed out changeset 058ad3199edb (bug 1267510)
Backed out changeset a7d18185f28d (bug 1267510)

--HG--
rename : testing/web-platform/tests/web-animations/timing-model/timelines/default-document-timeline.html => testing/web-platform/tests/web-animations/interfaces/AnimationTimeline/document-timeline.html
rename : testing/web-platform/tests/web-animations/interfaces/DocumentTimeline/idlharness.html => testing/web-platform/tests/web-animations/interfaces/AnimationTimeline/idlharness.html
This commit is contained in:
Wes Kocher 2016-06-27 11:49:06 -07:00
parent 43613b3e84
commit cd463132d8
13 changed files with 57 additions and 157 deletions

View File

@ -36,31 +36,6 @@ DocumentTimeline::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
return DocumentTimelineBinding::Wrap(aCx, this, aGivenProto);
}
/* static */ already_AddRefed<DocumentTimeline>
DocumentTimeline::Constructor(const GlobalObject& aGlobal,
const DOMHighResTimeStamp& aOriginTime,
ErrorResult& aRv)
{
nsIDocument* doc = AnimationUtils::GetCurrentRealmDocument(aGlobal.Context());
if (!doc) {
aRv.Throw(NS_ERROR_FAILURE);
return nullptr;
}
TimeDuration originTime = TimeDuration::FromMilliseconds(aOriginTime);
if (originTime == TimeDuration::Forever() ||
originTime == -TimeDuration::Forever()) {
nsAutoString inputOriginTime;
inputOriginTime.AppendFloat(aOriginTime);
aRv.ThrowTypeError<dom::MSG_TIME_VALUE_OUT_OF_RANGE>(
NS_LITERAL_STRING("Origin time"));
return nullptr;
}
RefPtr<DocumentTimeline> timeline = new DocumentTimeline(doc, originTime);
return timeline.forget();
}
Nullable<TimeDuration>
DocumentTimeline::GetCurrentTime() const
{
@ -113,9 +88,7 @@ DocumentTimeline::ToTimelineTime(const TimeStamp& aTimeStamp) const
return result;
}
result.SetValue(aTimeStamp
- timing->GetNavigationStartTimeStamp()
- mOriginTime);
result.SetValue(aTimeStamp - timing->GetNavigationStartTimeStamp());
return result;
}
@ -231,7 +204,7 @@ DocumentTimeline::ToTimeStamp(const TimeDuration& aTimeDuration) const
return result;
}
result = timing->GetNavigationStartTimeStamp() + aTimeDuration + mOriginTime;
result = timing->GetNavigationStartTimeStamp() + aTimeDuration;
return result;
}

View File

@ -10,7 +10,6 @@
#include "mozilla/TimeStamp.h"
#include "AnimationTimeline.h"
#include "nsIDocument.h"
#include "nsDOMNavigationTiming.h" // for DOMHighResTimeStamp
#include "nsRefreshDriver.h"
struct JSContext;
@ -29,11 +28,10 @@ class DocumentTimeline final
, public nsARefreshObserver
{
public:
DocumentTimeline(nsIDocument* aDocument, const TimeDuration& aOriginTime)
explicit DocumentTimeline(nsIDocument* aDocument)
: AnimationTimeline(aDocument->GetParentObject())
, mDocument(aDocument)
, mIsObservingRefreshDriver(false)
, mOriginTime(aOriginTime)
{
}
@ -52,11 +50,6 @@ public:
virtual JSObject* WrapObject(JSContext* aCx,
JS::Handle<JSObject*> aGivenProto) override;
static already_AddRefed<DocumentTimeline>
Constructor(const GlobalObject& aGlobal,
const DOMHighResTimeStamp& aOriginTime,
ErrorResult& aRv);
// AnimationTimeline methods
virtual Nullable<TimeDuration> GetCurrentTime() const override;
@ -91,8 +84,6 @@ protected:
// iframe).
mutable TimeStamp mLastRefreshDriverTime;
bool mIsObservingRefreshDriver;
TimeDuration mOriginTime;
};
} // namespace dom

View File

@ -37,7 +37,6 @@ support-files =
document-timeline/file_document-timeline.html
mozilla/file_deferred_start.html
mozilla/file_disabled_properties.html
mozilla/file_document-timeline-origin-time-range.html
mozilla/file_hide_and_show.html
mozilla/file_partial_keyframes.html
style/file_animation-seeking-with-current-time.html
@ -83,7 +82,6 @@ skip-if = buildapp == 'mulet'
[mozilla/test_deferred_start.html]
skip-if = (toolkit == 'gonk' && debug)
[mozilla/test_disabled_properties.html]
[mozilla/test_document-timeline-origin-time-range.html]
[mozilla/test_hide_and_show.html]
[mozilla/test_partial_keyframes.html]
[style/test_animation-seeking-with-current-time.html]

View File

@ -1,26 +0,0 @@
<!doctype html>
<meta charset=utf-8>
<script src="../testcommon.js"></script>
<body>
<script>
'use strict';
// If the originTime parameter passed to the DocumentTimeline exceeds
// the range of the internal storage type (a signed 64-bit integer number
// of ticks--a platform-dependent unit) then we should throw.
// Infinity isn't allowed as an origin time value and clamping to just
// inside the allowed range will just mean we overflow elsewhere.
test(function(t) {
assert_throws({name: 'TypeError'},
function() { new DocumentTimeline(Number.MAX_SAFE_INTEGER); });
}, 'Calculated current time is positive infinity');
test(function(t) {
assert_throws({name: 'TypeError'},
function() { new DocumentTimeline(-1 * Number.MAX_SAFE_INTEGER); });
}, 'Calculated current time is negative infinity');
done();
</script>
</body>

View File

@ -1,14 +0,0 @@
<!doctype html>
<meta charset=utf-8>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
'use strict';
setup({explicit_done: true});
SpecialPowers.pushPrefEnv(
{ "set": [["dom.animations-api.core.enabled", true]]},
function() {
window.open("file_document-timeline-origin-time-range.html");
});
</script>

View File

@ -3241,7 +3241,7 @@ DocumentTimeline*
nsDocument::Timeline()
{
if (!mDocumentTimeline) {
mDocumentTimeline = new DocumentTimeline(this, TimeDuration(0));
mDocumentTimeline = new DocumentTimeline(this);
}
return mDocumentTimeline;

View File

@ -98,5 +98,4 @@ MSG_DEF(MSG_INVALID_EASING_ERROR, 1, JSEXN_TYPEERR, "Invalid easing '{0}'.")
MSG_DEF(MSG_USELESS_SETTIMEOUT, 1, JSEXN_TYPEERR, "Useless {0} call (missing quotes around argument?)")
MSG_DEF(MSG_TOKENLIST_NO_SUPPORTED_TOKENS, 2, JSEXN_TYPEERR, "{0} attribute of <{1}> does not define any supported tokens")
MSG_DEF(MSG_CACHE_STREAM_CLOSED, 0, JSEXN_TYPEERR, "Response body is a cache file stream that has already been closed.")
MSG_DEF(MSG_TIME_VALUE_OUT_OF_RANGE, 1, JSEXN_TYPEERR, "{0} is outside the supported range for time values.")
MSG_DEF(MSG_ONLY_IF_CACHED_WITHOUT_SAME_ORIGIN, 1, JSEXN_TYPEERR, "Request mode '{0}' was used, but request cache mode 'only-if-cached' can only be used with request mode 'same-origin'.")

View File

@ -10,7 +10,8 @@
* liability, trademark and document use rules apply.
*/
[Func="nsDocument::IsWebAnimationsEnabled",
Constructor (DOMHighResTimeStamp originTime)]
// Not yet implemented:
// [Constructor (DOMHighResTimeStamp originTime)]
[Func="nsDocument::IsWebAnimationsEnabled"]
interface DocumentTimeline : AnimationTimeline {
};

View File

@ -36087,12 +36087,10 @@
},
"local_changes": {
"deleted": [
"WebCryptoAPI/generateKey/successes.worker.js",
"WebCryptoAPI/generateKey/failures.worker.js",
"web-animations/interfaces/AnimationTimeline/document-timeline.html",
"WebCryptoAPI/generateKey/test_failures.html",
"WebCryptoAPI/generateKey/test_successes.html",
"web-animations/interfaces/AnimationTimeline/idlharness.html",
"WebCryptoAPI/generateKey/successes.worker.js"
"WebCryptoAPI/generateKey/test_successes.html"
],
"deleted_reftests": {},
"items": {
@ -36374,7 +36372,7 @@
"XMLHttpRequest/xmlhttprequest-sync-not-hang-scriptloader.html": [
{
"path": "XMLHttpRequest/xmlhttprequest-sync-not-hang-scriptloader.html",
"url": "/XMLHttpRequest/xmlhttprequest-sync-not-hang-scriptloader.html"
"url": "/XMLHttpRequest/xmlhttprequest-sync-not-hang-scriptloader.html"
}
],
"editing/run/justifycenter.html": [
@ -36391,24 +36389,6 @@
"url": "/editing/run/multitest.html"
}
],
"web-animations/interfaces/DocumentTimeline/constructor.html": [
{
"path": "web-animations/interfaces/DocumentTimeline/constructor.html",
"url": "/web-animations/interfaces/DocumentTimeline/constructor.html"
}
],
"web-animations/interfaces/DocumentTimeline/idlharness.html": [
{
"path": "web-animations/interfaces/DocumentTimeline/idlharness.html",
"url": "/web-animations/interfaces/DocumentTimeline/idlharness.html"
}
],
"web-animations/timing-model/timelines/default-document-timeline.html": [
{
"path": "web-animations/timing-model/timelines/default-document-timeline.html",
"url": "/web-animations/timing-model/timelines/default-document-timeline.html"
}
],
"webaudio/the-audio-api/the-audioparam-interface/setTargetAtTime-after-event-within-block.html": [
{
"path": "webaudio/the-audio-api/the-audioparam-interface/setTargetAtTime-after-event-within-block.html",

View File

@ -0,0 +1,6 @@
[idlharness.html]
type: testharness
prefs: [dom.animations-api.core.enabled:true]
[AnimationTimeline must be primary interface of document.timeline]
expected: FAIL

View File

@ -1,7 +1,6 @@
<!doctype html>
<meta charset=utf-8>
<title>Default document timeline tests</title>
<link rel="help" href="https://w3c.github.io/web-animations/#the-documents-default-timeline">
<title>Web Animations API: DocumentTimeline tests</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
@ -17,9 +16,15 @@ test(function() {
'document.timeline returns a different object for each document');
assert_not_equals(iframe.contentDocument.timeline, null,
'document.timeline on an iframe is not null');
}, 'document.timeline identity tests');
},
'document.timeline identity tests',
{
help: 'http://dev.w3.org/fxtf/web-animations/#the-document-timeline',
assert: [ 'Each document has a timeline called the document timeline' ],
author: 'Brian Birtles'
});
promise_test(function(t) {
async_test(function(t) {
assert_true(document.timeline.currentTime > 0,
'document.timeline.currentTime is positive');
// document.timeline.currentTime should be set even before document
@ -35,14 +40,31 @@ promise_test(function(t) {
// We can't just compare document.timeline.currentTime to
// window.performance.now() because currentTime is only updated on a sample
// so we use requestAnimationFrame instead.
return window.requestAnimationFrame(t.step_func(function(rafTime) {
window.requestAnimationFrame(t.step_func(function(rafTime) {
assert_equals(document.timeline.currentTime, rafTime,
'document.timeline.currentTime matches' +
' requestAnimationFrame time');
t.done();
}));
}, 'document.timeline.currentTime value tests');
},
'document.timeline.currentTime value tests',
{
help: [
'http://dev.w3.org/fxtf/web-animations/#the-global-clock',
'http://dev.w3.org/fxtf/web-animations/#the-document-timeline'
],
assert: [
'The global clock is a source of monotonically increasing time values',
'The time values of the document timeline are calculated as a fixed' +
' offset from the global clock',
'the zero time corresponds to the navigationStart moment',
'the time value of each document timeline must be equal to the time ' +
'passed to animation frame request callbacks for that browsing context'
],
author: 'Brian Birtles'
});
promise_test(function(t) {
async_test(function(t) {
var valueAtStart = document.timeline.currentTime;
var timeAtStart = window.performance.now();
while (window.performance.now() - timeAtStart < 100) {
@ -50,10 +72,18 @@ promise_test(function(t) {
}
assert_equals(document.timeline.currentTime, valueAtStart,
'document.timeline.currentTime does not change within a script block');
return window.requestAnimationFrame(t.step_func(function() {
window.requestAnimationFrame(t.step_func(function() {
assert_true(document.timeline.currentTime > valueAtStart,
'document.timeline.currentTime increases between script blocks');
t.done();
}));
}, 'document.timeline.currentTime liveness tests');
},
'document.timeline.currentTime liveness tests',
{
help: 'http://dev.w3.org/fxtf/web-animations/#script-execution-and-live-updates-to-the-model',
assert: [ 'The value returned by the currentTime attribute of a' +
' document timeline will not change within a script block' ],
author: 'Brian Birtles'
});
</script>

View File

@ -6,13 +6,11 @@
<script src="/resources/WebIDLParser.js"></script>
<script src="/resources/idlharness.js"></script>
<div id="log"></div>
<script type="text/plain" id="AnimationTimeline-IDL">
<script type="text/plain" id="DocumentTimeline-IDL">
interface AnimationTimeline {
readonly attribute double? currentTime;
};
</script>
<script type="text/plain" id="DocumentTimeline-IDL">
[Constructor (DOMHighResTimeStamp originTime)]
interface DocumentTimeline : AnimationTimeline {
};
</script>
@ -22,8 +20,6 @@ interface DocumentTimeline : AnimationTimeline {
var idlArray;
test(function() {
idlArray = new IdlArray();
idlArray.add_untested_idls(
document.getElementById('AnimationTimeline-IDL').textContent);
idlArray.add_idls(
document.getElementById('DocumentTimeline-IDL').textContent);
idlArray.add_objects( { DocumentTimeline: ['document.timeline'] } );

View File

@ -1,34 +0,0 @@
<!DOCTYPE html>
<meta charset=utf-8>
<title>DocumentTimeline constructor tests</title>
<link rel="help" href="https://w3c.github.io/web-animations/#the-documenttimeline-interface">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../../testcommon.js"></script>
<body>
<div id="log"></div>
<script>
"use strict";
test(function(t) {
var timeline = new DocumentTimeline(0);
assert_times_equal(timeline.currentTime, document.timeline.currentTime);
}, 'zero origin time');
test(function(t) {
var timeline = new DocumentTimeline(10 * MS_PER_SEC);
assert_times_equal(timeline.currentTime,
(document.timeline.currentTime - 10 * MS_PER_SEC));
}, 'positive origin time');
test(function(t) {
var timeline = new DocumentTimeline(-10 * MS_PER_SEC);
assert_times_equal(timeline.currentTime,
(document.timeline.currentTime + 10 * MS_PER_SEC));
}, 'negative origin time');
</script>
</body>