merge mozilla-inbound to mozilla-central a=merge

This commit is contained in:
Carsten "Tomcat" Book 2016-04-11 11:46:21 +02:00
Родитель ae68f12f69 99a1a632e3
Коммит 99758da759
27 изменённых файлов: 277 добавлений и 61 удалений

Просмотреть файл

@ -1,7 +1,6 @@
[DEFAULT] [DEFAULT]
tags = devtools tags = devtools
subsuite = devtools subsuite = devtools
skip-if = e10s && debug # bug 1252283
support-files = support-files =
doc_body_animation.html doc_body_animation.html
doc_end_delay.html doc_end_delay.html

Просмотреть файл

@ -154,6 +154,7 @@ skip-if = e10s # Bug 1067145 - e10s responsiveview
[browser_telemetry_toolboxtabs_webconsole.js] [browser_telemetry_toolboxtabs_webconsole.js]
[browser_templater_basic.js] [browser_templater_basic.js]
[browser_toolbar_basic.js] [browser_toolbar_basic.js]
skip-if = (e10s && debug) # Bug 1253035
[browser_toolbar_tooltip.js] [browser_toolbar_tooltip.js]
[browser_toolbar_webconsole_errors_count.js] [browser_toolbar_webconsole_errors_count.js]
skip-if = e10s # The developertoolbar error count isn't correct with e10s skip-if = e10s # The developertoolbar error count isn't correct with e10s

Просмотреть файл

@ -36,7 +36,7 @@ public:
void List(FILE* out = stdout, int32_t aIndent = 0) const override; void List(FILE* out = stdout, int32_t aIndent = 0) const override;
#endif #endif
void AddValue(nsCSSProperty aProperty, StyleAnimationValue &aStartValue) void AddValue(nsCSSProperty aProperty, const StyleAnimationValue &aStartValue)
{ {
PropertyValuePair v = { aProperty, aStartValue }; PropertyValuePair v = { aProperty, aStartValue };
mPropertyValuePairs.AppendElement(v); mPropertyValuePairs.AppendElement(v);
@ -44,14 +44,13 @@ public:
nsCachedStyleData::GetBitForSID(nsCSSProps::kSIDTable[aProperty]); nsCachedStyleData::GetBitForSID(nsCSSProps::kSIDTable[aProperty]);
} }
// Caller must fill in returned value. void AddValue(nsCSSProperty aProperty, StyleAnimationValue&& aStartValue)
StyleAnimationValue* AddEmptyValue(nsCSSProperty aProperty)
{ {
PropertyValuePair *p = mPropertyValuePairs.AppendElement(); PropertyValuePair *p = mPropertyValuePairs.AppendElement();
p->mProperty = aProperty; p->mProperty = aProperty;
p->mValue = Move(aStartValue);
mStyleBits |= mStyleBits |=
nsCachedStyleData::GetBitForSID(nsCSSProps::kSIDTable[aProperty]); nsCachedStyleData::GetBitForSID(nsCSSProps::kSIDTable[aProperty]);
return &p->mValue;
} }
struct PropertyValuePair { struct PropertyValuePair {

Просмотреть файл

@ -598,14 +598,12 @@ KeyframeEffectReadOnly::ComposeStyle(RefPtr<AnimValuesStyleRule>& aStyleRule,
aStyleRule = new AnimValuesStyleRule(); aStyleRule = new AnimValuesStyleRule();
} }
StyleAnimationValue* val = aStyleRule->AddEmptyValue(prop.mProperty);
// Special handling for zero-length segments // Special handling for zero-length segments
if (segment->mToKey == segment->mFromKey) { if (segment->mToKey == segment->mFromKey) {
if (computedTiming.mProgress.Value() < 0) { if (computedTiming.mProgress.Value() < 0) {
*val = segment->mFromValue; aStyleRule->AddValue(prop.mProperty, segment->mFromValue);
} else { } else {
*val = segment->mToValue; aStyleRule->AddValue(prop.mProperty, segment->mToValue);
} }
continue; continue;
} }
@ -618,14 +616,17 @@ KeyframeEffectReadOnly::ComposeStyle(RefPtr<AnimValuesStyleRule>& aStyleRule,
positionInSegment, positionInSegment,
computedTiming.mBeforeFlag); computedTiming.mBeforeFlag);
#ifdef DEBUG StyleAnimationValue val;
bool result = if (StyleAnimationValue::Interpolate(prop.mProperty,
#endif segment->mFromValue,
StyleAnimationValue::Interpolate(prop.mProperty, segment->mToValue,
segment->mFromValue, valuePosition, val)) {
segment->mToValue, aStyleRule->AddValue(prop.mProperty, Move(val));
valuePosition, *val); } else if (valuePosition < 0.5) {
MOZ_ASSERT(result, "interpolate must succeed now"); aStyleRule->AddValue(prop.mProperty, segment->mFromValue);
} else {
aStyleRule->AddValue(prop.mProperty, segment->mToValue);
}
} }
} }

Просмотреть файл

@ -1,5 +1,5 @@
[DEFAULT] [DEFAULT]
skip-if = e10s && debug && (os == 'win' || os == 'mac') # Bug 1252677 for Windows, Bug 1252348 for Mac skip-if = (e10s && debug && os == 'win') # Bug 1252677
support-files = support-files =
android.json android.json
file_drawImage_document_domain.html file_drawImage_document_domain.html

Просмотреть файл

@ -7,7 +7,7 @@
var canvas = document.getElementById('canvas'); var canvas = document.getElementById('canvas');
var ctx = canvas.getContext('2d'); var ctx = canvas.getContext('2d');
ctx.filter = 'drop-shadow(0 10px black)'; ctx.filter = 'drop-shadow(0 10px #000)';
ctx.globalAlpha = 0.5; ctx.globalAlpha = 0.5;
ctx.fillStyle = '#0f0'; ctx.fillStyle = '#0f0';
ctx.fillRect(25, 25, 50, 40); ctx.fillRect(25, 25, 50, 40);

Просмотреть файл

@ -3,7 +3,7 @@ default-preferences pref(canvas.filters.enabled,true)
== default-color.html ref.html == default-color.html ref.html
== drop-shadow.html ref.html == drop-shadow.html ref.html
== drop-shadow-transformed.html ref.html == drop-shadow-transformed.html ref.html
== global-alpha.html global-alpha-ref.html fuzzy-if(azureSkia,1,1500) == global-alpha.html global-alpha-ref.html
== global-composite-operation.html global-composite-operation-ref.html == global-composite-operation.html global-composite-operation-ref.html
== liveness.html ref.html == liveness.html ref.html
== multiple-drop-shadows.html shadow-ref.html == multiple-drop-shadows.html shadow-ref.html

Просмотреть файл

@ -10,8 +10,12 @@ var ctx = canvas.getContext('2d');
ctx.font = '20px sans-serif'; ctx.font = '20px sans-serif';
ctx.filter = 'drop-shadow(0 .5em black)'; ctx.filter = 'drop-shadow(0 .5em black)';
ctx.fillStyle = '#0f0'; ctx.fillStyle = '#0f0';
ctx.fillRect(25, 25, 25, 40); ctx.fillRect(25, 25, 50, 40);
canvas.style.fontSize = '5px'; canvas.style.fontSize = '5px';
ctx.font = '4em sans-serif'; ctx.font = '4em sans-serif';
ctx.filter = 'drop-shadow(0 .5em black)'; ctx.filter = 'drop-shadow(0 .5em black)';
</script>
</body>
</html>

Просмотреть файл

@ -159,3 +159,6 @@ pref(canvas.customfocusring.enabled,true) skip-if(B2G) skip-if(cocoaWidget) skip
== capturestream.html wrapper.html?green.png == capturestream.html wrapper.html?green.png
fuzzy-if(azureSkiaGL,1,2) fuzzy-if(Android,3,40) fuzzy-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu),1,1) == 1177726-text-stroke-bounds.html 1177726-text-stroke-bounds-ref.html fuzzy-if(azureSkiaGL,1,2) fuzzy-if(Android,3,40) fuzzy-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu),1,1) == 1177726-text-stroke-bounds.html 1177726-text-stroke-bounds-ref.html
# Canvas Filter Reftests
include filters/reftest.list

Просмотреть файл

@ -4112,14 +4112,32 @@ bool HTMLMediaElement::CanActivateAutoplay()
// being paused. We also activate autopaly when playing a media source since // being paused. We also activate autopaly when playing a media source since
// the data download is controlled by the script and there is no way to // the data download is controlled by the script and there is no way to
// evaluate MediaDecoder::CanPlayThrough(). // evaluate MediaDecoder::CanPlayThrough().
return !mPausedForInactiveDocumentOrChannel &&
mAutoplaying && if (!HasAttr(kNameSpaceID_None, nsGkAtoms::autoplay) || !mAutoplayEnabled) {
mPaused && return false;
((mDecoder && mReadyState >= nsIDOMHTMLMediaElement::HAVE_ENOUGH_DATA) || }
mSrcStream || mMediaSource) &&
HasAttr(kNameSpaceID_None, nsGkAtoms::autoplay) && if (!mAutoplaying) {
mAutoplayEnabled && return false;
!IsEditable(); }
if (IsEditable()) {
return false;
}
if (!mPaused) {
return false;
}
if (mPausedForInactiveDocumentOrChannel) {
return false;
}
bool hasData =
(mDecoder && mReadyState >= nsIDOMHTMLMediaElement::HAVE_ENOUGH_DATA) ||
mSrcStream || mMediaSource;
return hasData;
} }
void HTMLMediaElement::CheckAutoplayDataReady() void HTMLMediaElement::CheckAutoplayDataReady()

Просмотреть файл

@ -814,6 +814,7 @@ WebMTrackDemuxer::WebMTrackDemuxer(WebMDemuxer* aParent,
uint32_t aTrackNumber) uint32_t aTrackNumber)
: mParent(aParent) : mParent(aParent)
, mType(aType) , mType(aType)
, mNeedKeyframe(true)
{ {
mInfo = mParent->GetTrackInfo(aType, aTrackNumber); mInfo = mParent->GetTrackInfo(aType, aTrackNumber);
MOZ_ASSERT(mInfo); MOZ_ASSERT(mInfo);
@ -840,6 +841,7 @@ WebMTrackDemuxer::Seek(media::TimeUnit aTime)
mSamples.Reset(); mSamples.Reset();
mParent->SeekInternal(aTime); mParent->SeekInternal(aTime);
mParent->GetNextPacket(mType, &mSamples); mParent->GetNextPacket(mType, &mSamples);
mNeedKeyframe = true;
// Check what time we actually seeked to. // Check what time we actually seeked to.
if (mSamples.GetSize() > 0) { if (mSamples.GetSize() > 0) {
@ -875,6 +877,10 @@ WebMTrackDemuxer::GetSamples(int32_t aNumSamples)
if (!sample) { if (!sample) {
break; break;
} }
if (mNeedKeyframe && !sample->mKeyframe) {
continue;
}
mNeedKeyframe = false;
samples->mSamples.AppendElement(sample); samples->mSamples.AppendElement(sample);
aNumSamples--; aNumSamples--;
} }
@ -951,6 +957,7 @@ WebMTrackDemuxer::Reset()
{ {
mSamples.Reset(); mSamples.Reset();
media::TimeIntervals buffered = GetBuffered(); media::TimeIntervals buffered = GetBuffered();
mNeedKeyframe = true;
if (buffered.Length()) { if (buffered.Length()) {
WEBM_DEBUG("Seek to start point: %f", buffered.Start(0).ToSeconds()); WEBM_DEBUG("Seek to start point: %f", buffered.Start(0).ToSeconds());
mParent->SeekInternal(buffered.Start(0)); mParent->SeekInternal(buffered.Start(0));

Просмотреть файл

@ -242,6 +242,7 @@ private:
TrackInfo::TrackType mType; TrackInfo::TrackType mType;
UniquePtr<TrackInfo> mInfo; UniquePtr<TrackInfo> mInfo;
Maybe<media::TimeUnit> mNextKeyframeTime; Maybe<media::TimeUnit> mNextKeyframeTime;
bool mNeedKeyframe;
// Queued samples extracted by the demuxer, but not yet returned. // Queued samples extracted by the demuxer, but not yet returned.
MediaRawDataQueue mSamples; MediaRawDataQueue mSamples;

Просмотреть файл

@ -1931,7 +1931,7 @@ Layer::PrintInfo(std::stringstream& aStream, const char* aPrefix)
if (1.0 != mOpacity) { if (1.0 != mOpacity) {
aStream << nsPrintfCString(" [opacity=%g]", mOpacity).get(); aStream << nsPrintfCString(" [opacity=%g]", mOpacity).get();
} }
if (GetContentFlags() & CONTENT_OPAQUE) { if (IsOpaque()) {
aStream << " [opaqueContent]"; aStream << " [opaqueContent]";
} }
if (GetContentFlags() & CONTENT_COMPONENT_ALPHA) { if (GetContentFlags() & CONTENT_COMPONENT_ALPHA) {

Просмотреть файл

@ -1501,6 +1501,12 @@ public:
return !GetLocalVisibleRegion().IsEmpty() || Extend3DContext(); return !GetLocalVisibleRegion().IsEmpty() || Extend3DContext();
} }
/**
* Return true if current layer content is opaque.
* It does not guarantee that layer content is always opaque.
*/
virtual bool IsOpaque() { return GetContentFlags() & CONTENT_OPAQUE; }
/** /**
* Returns the product of the opacities of this layer and all ancestors up * Returns the product of the opacities of this layer and all ancestors up
* to and excluding the nearest ancestor that has UseIntermediateSurface() set. * to and excluding the nearest ancestor that has UseIntermediateSurface() set.

Просмотреть файл

@ -581,6 +581,27 @@ ImageHost::GetImageSize() const
return IntSize(); return IntSize();
} }
bool
ImageHost::IsOpaque()
{
const TimedImage* img = ChooseImage();
if (!img) {
return false;
}
if (img->mPictureRect.width == 0 ||
img->mPictureRect.height == 0 ||
!img->mTextureHost) {
return false;
}
gfx::SurfaceFormat format = img->mTextureHost->GetFormat();
if (gfx::IsOpaque(format)) {
return true;
}
return false;
}
already_AddRefed<TexturedEffect> already_AddRefed<TexturedEffect>
ImageHost::GenEffect(const gfx::Filter& aFilter) ImageHost::GenEffect(const gfx::Filter& aFilter)
{ {

Просмотреть файл

@ -115,6 +115,8 @@ public:
BIAS_POSITIVE, BIAS_POSITIVE,
}; };
bool IsOpaque();
protected: protected:
struct TimedImage { struct TimedImage {
RefPtr<TextureHost> mTextureHost; RefPtr<TextureHost> mTextureHost;

Просмотреть файл

@ -15,6 +15,7 @@
#include "mozilla/gfx/Rect.h" // for Rect #include "mozilla/gfx/Rect.h" // for Rect
#include "mozilla/layers/Compositor.h" // for Compositor #include "mozilla/layers/Compositor.h" // for Compositor
#include "mozilla/layers/Effects.h" // for EffectChain #include "mozilla/layers/Effects.h" // for EffectChain
#include "mozilla/layers/ImageHost.h" // for ImageHost
#include "mozilla/layers/TextureHost.h" // for TextureHost, etc #include "mozilla/layers/TextureHost.h" // for TextureHost, etc
#include "mozilla/mozalloc.h" // for operator delete #include "mozilla/mozalloc.h" // for operator delete
#include "nsAString.h" #include "nsAString.h"
@ -50,7 +51,7 @@ ImageLayerComposite::SetCompositableHost(CompositableHost* aHost)
{ {
switch (aHost->GetType()) { switch (aHost->GetType()) {
case CompositableType::IMAGE: case CompositableType::IMAGE:
mImageHost = aHost; mImageHost = static_cast<ImageHost*>(aHost);
return true; return true;
default: default:
return false; return false;
@ -78,6 +79,16 @@ ImageLayerComposite::GetLayer()
return this; return this;
} }
void
ImageLayerComposite::SetLayerManager(LayerManagerComposite* aManager)
{
LayerComposite::SetLayerManager(aManager);
mManager = aManager;
if (mImageHost) {
mImageHost->SetCompositor(mCompositor);
}
}
void void
ImageLayerComposite::RenderLayer(const IntRect& aClipRect) ImageLayerComposite::RenderLayer(const IntRect& aClipRect)
{ {
@ -143,6 +154,20 @@ ImageLayerComposite::ComputeEffectiveTransforms(const gfx::Matrix4x4& aTransform
ComputeEffectiveTransformForMaskLayers(aTransformToSurface); ComputeEffectiveTransformForMaskLayers(aTransformToSurface);
} }
bool
ImageLayerComposite::IsOpaque()
{
if (!mImageHost ||
!mImageHost->IsAttached()) {
return false;
}
if (mScaleMode == ScaleMode::STRETCH) {
return mImageHost->IsOpaque();
}
return false;
}
CompositableHost* CompositableHost*
ImageLayerComposite::GetCompositableHost() ImageLayerComposite::GetCompositableHost()
{ {

Просмотреть файл

@ -43,14 +43,7 @@ public:
virtual Layer* GetLayer() override; virtual Layer* GetLayer() override;
virtual void SetLayerManager(LayerManagerComposite* aManager) override virtual void SetLayerManager(LayerManagerComposite* aManager) override;
{
LayerComposite::SetLayerManager(aManager);
mManager = aManager;
if (mImageHost) {
mImageHost->SetCompositor(mCompositor);
}
}
virtual void RenderLayer(const gfx::IntRect& aClipRect) override; virtual void RenderLayer(const gfx::IntRect& aClipRect) override;
@ -66,6 +59,8 @@ public:
virtual const char* Name() const override { return "ImageLayerComposite"; } virtual const char* Name() const override { return "ImageLayerComposite"; }
virtual bool IsOpaque() override;
protected: protected:
virtual void PrintInfo(std::stringstream& aStream, const char* aPrefix) override; virtual void PrintInfo(std::stringstream& aStream, const char* aPrefix) override;
@ -73,7 +68,7 @@ private:
gfx::Filter GetEffectFilter(); gfx::Filter GetEffectFilter();
private: private:
RefPtr<CompositableHost> mImageHost; RefPtr<ImageHost> mImageHost;
}; };
} // namespace layers } // namespace layers

Просмотреть файл

@ -362,7 +362,7 @@ LayerManagerComposite::PostProcessLayers(Layer* aLayer,
if (integerTranslation && if (integerTranslation &&
!aLayer->HasMaskLayers() && !aLayer->HasMaskLayers() &&
aLayer->IsOpaqueForVisibility()) { aLayer->IsOpaqueForVisibility()) {
if (aLayer->GetContentFlags() & Layer::CONTENT_OPAQUE) { if (aLayer->IsOpaque()) {
localOpaque.OrWith(composite->GetFullyRenderedRegion()); localOpaque.OrWith(composite->GetFullyRenderedRegion());
} }
localOpaque.MoveBy(*integerTranslation); localOpaque.MoveBy(*integerTranslation);

Просмотреть файл

@ -531,7 +531,6 @@ SurfaceTextureHost::SetCompositor(Compositor* aCompositor)
gfx::SurfaceFormat gfx::SurfaceFormat
SurfaceTextureHost::GetFormat() const SurfaceTextureHost::GetFormat() const
{ {
MOZ_ASSERT(mTextureSource);
return mTextureSource ? mTextureSource->GetFormat() : gfx::SurfaceFormat::UNKNOWN; return mTextureSource ? mTextureSource->GetFormat() : gfx::SurfaceFormat::UNKNOWN;
} }

Просмотреть файл

@ -2,17 +2,15 @@
skip-if = buildapp == 'b2g' || os == 'android' skip-if = buildapp == 'b2g' || os == 'android'
support-files = support-files =
animationPolling.js animationPolling.js
animated-gif.gif
iframe.html iframe.html
imgutils.js imgutils.js
ref-iframe.html ref-iframe.html
[test_animation.html] [test_animation.html]
disabled = bug 1100497
[test_animation2.html] [test_animation2.html]
disabled = bug 1101415
[test_bug415761.html] [test_bug415761.html]
skip-if = os != "win" || os_version == "6.2" skip-if = os != "win" || os_version == "6.2"
support-files = support-files =
bug415761.ico bug415761.ico
[test_undisplayed_iframe.html] [test_undisplayed_iframe.html]
disabled = bug 1060869

Просмотреть файл

@ -50,4 +50,4 @@ skip == test_bug641198.html animation2a-finalframe.gif # Disabled; see bug 1120
# won't be in the text of the contents themselves. --$(boundary)\r\n means # won't be in the text of the contents themselves. --$(boundary)\r\n means
# "Here is the beginning of a boundary," and --$(boundary)-- means "All done # "Here is the beginning of a boundary," and --$(boundary)-- means "All done
# sending you parts.") # sending you parts.")
skip-if(B2G||browserIsRemote) HTTP == webcam.html blue.gif # bug 773482 skip-if(B2G) HTTP == webcam.html blue.gif # bug 773482

Просмотреть файл

@ -373,6 +373,12 @@ public:
} }
StyleAnimationValue(const StyleAnimationValue& aOther) StyleAnimationValue(const StyleAnimationValue& aOther)
: mUnit(eUnit_Null) { *this = aOther; } : mUnit(eUnit_Null) { *this = aOther; }
StyleAnimationValue(StyleAnimationValue&& aOther)
: mUnit(aOther.mUnit)
, mValue(aOther.mValue)
{
aOther.mUnit = eUnit_Null;
}
enum IntegerConstructorType { IntegerConstructor }; enum IntegerConstructorType { IntegerConstructor };
StyleAnimationValue(int32_t aInt, Unit aUnit, IntegerConstructorType); StyleAnimationValue(int32_t aInt, Unit aUnit, IntegerConstructorType);
enum CoordConstructorType { CoordConstructor }; enum CoordConstructorType { CoordConstructor };

Просмотреть файл

@ -100,6 +100,9 @@ class Taskcluster(LogMixin):
content_length = os.path.getsize(filename) content_length = os.path.getsize(filename)
self.info("Uploading to S3: filename=%s mimetype=%s length=%s" % ( self.info("Uploading to S3: filename=%s mimetype=%s length=%s" % (
filename, mime_type, content_length)) filename, mime_type, content_length))
# reclaim the task to avoid "claim-expired" errors
self.taskcluster_queue.reclaimTask(
task['status']['taskId'], task['status']['runs'][-1]['runId'])
artifact = self.taskcluster_queue.createArtifact( artifact = self.taskcluster_queue.createArtifact(
task['status']['taskId'], task['status']['taskId'],
task['status']['runs'][-1]['runId'], task['status']['runs'][-1]['runId'],

Просмотреть файл

@ -28389,10 +28389,6 @@
"path": "web-animations/animatable/animate.html", "path": "web-animations/animatable/animate.html",
"url": "/web-animations/animatable/animate.html" "url": "/web-animations/animatable/animate.html"
}, },
{
"path": "web-animations/animation-effect-timing/delay.html",
"url": "/web-animations/animation-effect-timing/delay.html"
},
{ {
"path": "web-animations/animation-effect-timing/direction.html", "path": "web-animations/animation-effect-timing/direction.html",
"url": "/web-animations/animation-effect-timing/direction.html" "url": "/web-animations/animation-effect-timing/direction.html"
@ -28421,6 +28417,10 @@
"path": "web-animations/animation-effect-timing/iterations.html", "path": "web-animations/animation-effect-timing/iterations.html",
"url": "/web-animations/animation-effect-timing/iterations.html" "url": "/web-animations/animation-effect-timing/iterations.html"
}, },
{
"path": "web-animations/animation-model/animation-types/discrete-animation.html",
"url": "/web-animations/animation-model/animation-types/discrete-animation.html"
},
{ {
"path": "web-animations/animation-timeline/document-timeline.html", "path": "web-animations/animation-timeline/document-timeline.html",
"url": "/web-animations/animation-timeline/document-timeline.html" "url": "/web-animations/animation-timeline/document-timeline.html"

Просмотреть файл

@ -1,15 +1,7 @@
[event-progress.htm] [event-progress.htm]
type: testharness type: testharness
expected: expected:
if debug and (os == "win") and (version == "5.1.2600") and (processor == "x86") and (bits == 32): OK if (asan or debug) and (os == "linux"): OK
if debug and (os == "linux") and (version == "Ubuntu 12.04") and (processor == "x86_64") and (bits == 64): OK if debug and (os == "mac"): OK
if debug and (os == "linux") and (version == "Ubuntu 12.04") and (processor == "x86") and (bits == 32): OK if debug and (os == "win"): OK
if debug and (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): OK
if debug and (os == "mac") and (version == "OS X 10.10.2") and (processor == "x86_64") and (bits == 64): OK
if debug and (os == "mac") and (version == "OS X 10.6.8") and (processor == "x86_64") and (bits == 64): OK
if debug and (os == "win") and (version == "6.1.7601") and (processor == "x86") and (bits == 32): OK
if debug and (os == "mac") and (version == "OS X 10.8") and (processor == "x86_64") and (bits == 64): OK
if debug and (os == "win") and (version == "10.0.10240") and (processor == "x86_64") and (bits == 64): OK
if debug and not e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): OK
if debug and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): OK
TIMEOUT TIMEOUT

Просмотреть файл

@ -0,0 +1,136 @@
<!DOCTYPE html>
<meta charset=utf-8>
<title>Tests for discrete animation</title>
<link rel="help" href="http://w3c.github.io/web-animations/#animatable-as-string-section">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../../testcommon.js"></script>
<link rel="stylesheet" href="/resources/testharness.css">
<body>
<div id="log"></div>
<script>
'use strict';
test(function(t) {
var div = createDiv(t);
var anim = div.animate({ fontStyle: [ 'normal', 'italic' ] },
{ duration: 1000, fill: 'forwards' });
assert_equals(getComputedStyle(div).fontStyle, 'normal',
'Animation produces \'from\' value at start of interval');
anim.currentTime = anim.effect.getComputedTiming().duration / 2 - 1;
assert_equals(getComputedStyle(div).fontStyle, 'normal',
'Animation produces \'from\' value just before the middle of'
+ ' the interval');
anim.currentTime++;
assert_equals(getComputedStyle(div).fontStyle, 'italic',
'Animation produces \'to\' value at exact middle of'
+ ' the interval');
anim.finish();
assert_equals(getComputedStyle(div).fontStyle, 'italic',
'Animation produces \'to\' value during forwards fill');
}, 'Test animating discrete values');
test(function(t) {
var div = createDiv(t);
var originalHeight = getComputedStyle(div).height;
var anim = div.animate({ height: [ 'auto', '200px' ] },
{ duration: 1000, fill: 'forwards' });
assert_equals(getComputedStyle(div).height, originalHeight,
'Animation produces \'from\' value at start of interval');
anim.currentTime = anim.effect.getComputedTiming().duration / 2 - 1;
assert_equals(getComputedStyle(div).height, originalHeight,
'Animation produces \'from\' value just before the middle of'
+ ' the interval');
anim.currentTime++;
assert_equals(getComputedStyle(div).height, '200px',
'Animation produces \'to\' value at exact middle of'
+ ' the interval');
anim.finish();
assert_equals(getComputedStyle(div).height, '200px',
'Animation produces \'to\' value during forwards fill');
}, 'Test discrete animation is used when interpolation fails');
test(function(t) {
var div = createDiv(t);
var originalHeight = getComputedStyle(div).height;
var anim = div.animate({ height: [ 'auto',
'200px',
'300px',
'auto',
'400px' ] },
{ duration: 1000, fill: 'forwards' });
// There are five values, so there are four pairs to try to interpolate.
// We test at the middle of each pair.
assert_equals(getComputedStyle(div).height, originalHeight,
'Animation produces \'from\' value at start of interval');
anim.currentTime = 125;
assert_equals(getComputedStyle(div).height, '200px',
'First non-interpolable pair uses discrete interpolation');
anim.currentTime += 250;
assert_equals(getComputedStyle(div).height, '250px',
'Second interpolable pair uses linear interpolation');
anim.currentTime += 250;
assert_equals(getComputedStyle(div).height, originalHeight,
'Third non-interpolable pair uses discrete interpolation');
anim.currentTime += 250;
assert_equals(getComputedStyle(div).height, '400px',
'Fourth non-interpolable pair uses discrete interpolation');
}, 'Test discrete animation is used only for pairs of values that cannot'
+ ' be interpolated');
test(function(t) {
var div = createDiv(t);
var originalHeight = getComputedStyle(div).height;
// Easing: http://cubic-bezier.com/#.68,0,1,.01
// With this curve, we don't reach the 50% point until about 95% of
// the time has expired.
var anim = div.animate({ fontStyle: [ 'italic', 'oblique' ] },
{ duration: 1000, fill: 'forwards',
easing: 'cubic-bezier(0.68,0,1,0.01)' });
assert_equals(getComputedStyle(div).fontStyle, 'italic',
'Animation produces \'from\' value at start of interval');
anim.currentTime = 940;
assert_equals(getComputedStyle(div).fontStyle, 'italic',
'Animation produces \'from\' value at 94% of the iteration'
+ ' time');
anim.currentTime = 960;
assert_equals(getComputedStyle(div).fontStyle, 'oblique',
'Animation produces \'to\' value at 96% of the iteration'
+ ' time');
}, 'Test the 50% switch point for discrete animation is based on the'
+ ' effect easing');
test(function(t) {
var div = createDiv(t);
var originalHeight = getComputedStyle(div).height;
// Easing: http://cubic-bezier.com/#.68,0,1,.01
// With this curve, we don't reach the 50% point until about 95% of
// the time has expired.
var anim = div.animate([ { fontStyle: 'italic',
easing: 'cubic-bezier(0.68,0,1,0.01)' },
{ fontStyle: 'oblique' } ],
{ duration: 1000, fill: 'forwards' });
assert_equals(getComputedStyle(div).fontStyle, 'italic',
'Animation produces \'from\' value at start of interval');
anim.currentTime = 940;
assert_equals(getComputedStyle(div).fontStyle, 'italic',
'Animation produces \'from\' value at 94% of the iteration'
+ ' time');
anim.currentTime = 960;
assert_equals(getComputedStyle(div).fontStyle, 'oblique',
'Animation produces \'to\' value at 96% of the iteration'
+ ' time');
}, 'Test the 50% switch point for discrete animation is based on the'
+ ' keyframe easing');
</script>