Backed out 2 changesets (bug 1504065) for failing Win reftest at child-in-animating-element-display-none.html on a CLOSED TREE
Backed out changeset 129188370231 (bug 1504065) Backed out changeset 359e81b35cfb (bug 1504065)
This commit is contained in:
@@ -1894,23 +1894,6 @@ KeyframeEffect::IsMatchForCompositor(
|
|||||||
return KeyframeEffect::MatchForCompositor::NoAndBlockThisProperty;
|
return KeyframeEffect::MatchForCompositor::NoAndBlockThisProperty;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aProperty == eCSSProperty_background_color) {
|
|
||||||
if (!StaticPrefs::gfx_omta_background_color()) {
|
|
||||||
return KeyframeEffect::MatchForCompositor::No;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (nsIContent* content = aFrame->GetContent()) {
|
|
||||||
RefPtr<layers::LayerManager> layerManager =
|
|
||||||
nsContentUtils::LayerManagerForContent(content);
|
|
||||||
if (layerManager &&
|
|
||||||
layerManager->GetBackendType() == layers::LayersBackend::LAYERS_WR) {
|
|
||||||
// Bug 1510030: We don't yet support background-color animations on the
|
|
||||||
// compositor for WebRender.
|
|
||||||
return KeyframeEffect::MatchForCompositor::No;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return mAnimation->IsPlaying()
|
return mAnimation->IsPlaying()
|
||||||
? KeyframeEffect::MatchForCompositor::Yes
|
? KeyframeEffect::MatchForCompositor::Yes
|
||||||
: KeyframeEffect::MatchForCompositor::IfNeeded;
|
: KeyframeEffect::MatchForCompositor::IfNeeded;
|
||||||
|
|||||||
@@ -50,9 +50,7 @@ div {
|
|||||||
/** Test for bug 1045994 - Add a chrome-only property to inspect if an
|
/** Test for bug 1045994 - Add a chrome-only property to inspect if an
|
||||||
animation is running on the compositor or not **/
|
animation is running on the compositor or not **/
|
||||||
|
|
||||||
const omtaEnabled = isOMTAEnabled();
|
var omtaEnabled = isOMTAEnabled();
|
||||||
const isWebRender =
|
|
||||||
SpecialPowers.DOMWindowUtils.layerManagerType == 'WebRender';
|
|
||||||
|
|
||||||
function assert_animation_is_running_on_compositor(animation, desc) {
|
function assert_animation_is_running_on_compositor(animation, desc) {
|
||||||
assert_equals(animation.isRunningOnCompositor, omtaEnabled,
|
assert_equals(animation.isRunningOnCompositor, omtaEnabled,
|
||||||
@@ -990,41 +988,5 @@ promise_test(async t => {
|
|||||||
'Transform animation on table element should be running on the compositor');
|
'Transform animation on table element should be running on the compositor');
|
||||||
}, 'Transform animation on table element runs on the compositor');
|
}, 'Transform animation on table element runs on the compositor');
|
||||||
|
|
||||||
promise_test(async t => {
|
|
||||||
const div = addDiv(t);
|
|
||||||
const animation = div.animate({ backgroundColor: ['blue', 'green'] },
|
|
||||||
100 * MS_PER_SEC);
|
|
||||||
|
|
||||||
await waitForAnimationReadyToRestyle(animation);
|
|
||||||
await waitForPaints();
|
|
||||||
|
|
||||||
if (!isWebRender) {
|
|
||||||
assert_animation_is_running_on_compositor(animation,
|
|
||||||
'background-color animation should be running on the compositor');
|
|
||||||
} else {
|
|
||||||
assert_animation_is_not_running_on_compositor(animation,
|
|
||||||
'background-color animation is not yet able to run on the compositor ' +
|
|
||||||
'on WebRender');
|
|
||||||
}
|
|
||||||
}, 'backgound-color animation runs on the compositor');
|
|
||||||
|
|
||||||
promise_test(async t => {
|
|
||||||
await SpecialPowers.pushPrefEnv({
|
|
||||||
set: [["gfx.omta.background-color", false]]
|
|
||||||
});
|
|
||||||
|
|
||||||
const div = addDiv(t);
|
|
||||||
const animation = div.animate({ backgroundColor: ['blue', 'green'] },
|
|
||||||
100 * MS_PER_SEC);
|
|
||||||
|
|
||||||
await waitForAnimationReadyToRestyle(animation);
|
|
||||||
await waitForPaints();
|
|
||||||
|
|
||||||
assert_animation_is_not_running_on_compositor(animation,
|
|
||||||
'background-color animation should NOT be running on the compositor ' +
|
|
||||||
'if the pref is disabled');
|
|
||||||
}, 'backgound-color animation does not run on the compositor if the pref ' +
|
|
||||||
'is disabled');
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ prefs =
|
|||||||
dom.animations-api.getAnimations.enabled=true
|
dom.animations-api.getAnimations.enabled=true
|
||||||
dom.animations-api.implicit-keyframes.enabled=true
|
dom.animations-api.implicit-keyframes.enabled=true
|
||||||
dom.animations-api.timelines.enabled=true
|
dom.animations-api.timelines.enabled=true
|
||||||
gfx.omta.background-color=true
|
|
||||||
layout.css.motion-path.enabled=true
|
layout.css.motion-path.enabled=true
|
||||||
layout.css.individual-transform.enabled=true
|
layout.css.individual-transform.enabled=true
|
||||||
# Support files for chrome tests that we want to load over HTTP need
|
# Support files for chrome tests that we want to load over HTTP need
|
||||||
|
|||||||
@@ -3720,14 +3720,6 @@ nsDOMWindowUtils::GetOMTAStyle(Element* aElement,
|
|||||||
if (value.type() == OMTAValue::TMatrix4x4) {
|
if (value.type() == OMTAValue::TMatrix4x4) {
|
||||||
cssValue = nsComputedDOMStyle::MatrixToCSSValue(value.get_Matrix4x4());
|
cssValue = nsComputedDOMStyle::MatrixToCSSValue(value.get_Matrix4x4());
|
||||||
}
|
}
|
||||||
} else if (aProperty.EqualsLiteral("background-color")) {
|
|
||||||
OMTAValue value = GetOMTAValue(frame,
|
|
||||||
DisplayItemType::TYPE_BACKGROUND_COLOR,
|
|
||||||
GetWebRenderBridge());
|
|
||||||
if (value.type() == OMTAValue::Tnscolor) {
|
|
||||||
cssValue = new nsROCSSPrimitiveValue;
|
|
||||||
nsComputedDOMStyle::SetToRGBAColor(cssValue, value.get_nscolor());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -55,9 +55,6 @@ CompositorAnimationStorage::GetOMTAValue(const uint64_t& aId) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch (animatedValue->mType) {
|
switch (animatedValue->mType) {
|
||||||
case AnimatedValue::COLOR:
|
|
||||||
omtaValue = animatedValue->mColor;
|
|
||||||
break;
|
|
||||||
case AnimatedValue::OPACITY:
|
case AnimatedValue::OPACITY:
|
||||||
omtaValue = animatedValue->mOpacity;
|
omtaValue = animatedValue->mOpacity;
|
||||||
break;
|
break;
|
||||||
@@ -121,18 +118,6 @@ CompositorAnimationStorage::SetAnimatedValue(uint64_t aId,
|
|||||||
dontCare);
|
dontCare);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
CompositorAnimationStorage::SetAnimatedValue(uint64_t aId, nscolor aColor)
|
|
||||||
{
|
|
||||||
MOZ_ASSERT(CompositorThreadHolder::IsInCompositorThread());
|
|
||||||
auto count = mAnimatedValues.Count();
|
|
||||||
AnimatedValue* value = mAnimatedValues.LookupOrAdd(aId, aColor);
|
|
||||||
if (count == mAnimatedValues.Count()) {
|
|
||||||
MOZ_ASSERT(value->mType == AnimatedValue::COLOR);
|
|
||||||
value->mColor = aColor;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
CompositorAnimationStorage::SetAnimatedValue(uint64_t aId,
|
CompositorAnimationStorage::SetAnimatedValue(uint64_t aId,
|
||||||
const float& aOpacity)
|
const float& aOpacity)
|
||||||
@@ -534,7 +519,7 @@ CreateCSSValueList(const InfallibleTArray<TransformFunction>& aFunctions)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static already_AddRefed<RawServoAnimationValue>
|
static already_AddRefed<RawServoAnimationValue>
|
||||||
ToAnimationValue(nsCSSPropertyID aProperty, const Animatable& aAnimatable)
|
ToAnimationValue(const Animatable& aAnimatable)
|
||||||
{
|
{
|
||||||
RefPtr<RawServoAnimationValue> result;
|
RefPtr<RawServoAnimationValue> result;
|
||||||
|
|
||||||
@@ -555,10 +540,6 @@ ToAnimationValue(nsCSSPropertyID aProperty, const Animatable& aAnimatable)
|
|||||||
case Animatable::Tfloat:
|
case Animatable::Tfloat:
|
||||||
result = Servo_AnimationValue_Opacity(aAnimatable.get_float()).Consume();
|
result = Servo_AnimationValue_Opacity(aAnimatable.get_float()).Consume();
|
||||||
break;
|
break;
|
||||||
case Animatable::Tnscolor:
|
|
||||||
result = Servo_AnimationValue_Color(aProperty,
|
|
||||||
aAnimatable.get_nscolor()).Consume();
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
MOZ_ASSERT_UNREACHABLE("Unsupported type");
|
MOZ_ASSERT_UNREACHABLE("Unsupported type");
|
||||||
}
|
}
|
||||||
@@ -599,8 +580,7 @@ AnimationHelper::SetAnimations(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (animation.baseStyle().type() != Animatable::Tnull_t) {
|
if (animation.baseStyle().type() != Animatable::Tnull_t) {
|
||||||
aBaseAnimationStyle = ToAnimationValue(animation.property(),
|
aBaseAnimationStyle = ToAnimationValue(animation.baseStyle());
|
||||||
animation.baseStyle());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
AnimData* data = aAnimData.AppendElement();
|
AnimData* data = aAnimData.AppendElement();
|
||||||
@@ -625,10 +605,8 @@ AnimationHelper::SetAnimations(
|
|||||||
|
|
||||||
const InfallibleTArray<AnimationSegment>& segments = animation.segments();
|
const InfallibleTArray<AnimationSegment>& segments = animation.segments();
|
||||||
for (const AnimationSegment& segment : segments) {
|
for (const AnimationSegment& segment : segments) {
|
||||||
startValues.AppendElement(ToAnimationValue(animation.property(),
|
startValues.AppendElement(ToAnimationValue(segment.startState()));
|
||||||
segment.startState()));
|
endValues.AppendElement(ToAnimationValue(segment.endState()));
|
||||||
endValues.AppendElement(ToAnimationValue(animation.property(),
|
|
||||||
segment.endState()));
|
|
||||||
|
|
||||||
TimingFunction tf = segment.sampleFn();
|
TimingFunction tf = segment.sampleFn();
|
||||||
Maybe<ComputedTimingFunction> ctf =
|
Maybe<ComputedTimingFunction> ctf =
|
||||||
|
|||||||
@@ -55,14 +55,12 @@ struct AnimatedValue {
|
|||||||
enum {
|
enum {
|
||||||
TRANSFORM,
|
TRANSFORM,
|
||||||
OPACITY,
|
OPACITY,
|
||||||
COLOR,
|
|
||||||
NONE
|
NONE
|
||||||
} mType {NONE};
|
} mType {NONE};
|
||||||
|
|
||||||
union {
|
union {
|
||||||
AnimationTransform mTransform;
|
AnimationTransform mTransform;
|
||||||
float mOpacity;
|
float mOpacity;
|
||||||
nscolor mColor;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
AnimatedValue(gfx::Matrix4x4&& aTransformInDevSpace,
|
AnimatedValue(gfx::Matrix4x4&& aTransformInDevSpace,
|
||||||
@@ -82,12 +80,6 @@ struct AnimatedValue {
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
explicit AnimatedValue(nscolor aValue)
|
|
||||||
: mType(AnimatedValue::COLOR)
|
|
||||||
, mColor(aValue)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
~AnimatedValue() {}
|
~AnimatedValue() {}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -136,11 +128,6 @@ public:
|
|||||||
*/
|
*/
|
||||||
void SetAnimatedValue(uint64_t aId, const float& aOpacity);
|
void SetAnimatedValue(uint64_t aId, const float& aOpacity);
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the animation color based on the unique id
|
|
||||||
*/
|
|
||||||
void SetAnimatedValue(uint64_t aId, nscolor aColor);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the animated value if a given id can map to its animated value
|
* Return the animated value if a given id can map to its animated value
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -633,19 +633,6 @@ ApplyAnimatedValue(Layer* aLayer,
|
|||||||
|
|
||||||
HostLayer* layerCompositor = aLayer->AsHostLayer();
|
HostLayer* layerCompositor = aLayer->AsHostLayer();
|
||||||
switch (aProperty) {
|
switch (aProperty) {
|
||||||
case eCSSProperty_background_color: {
|
|
||||||
// We don't support 'color' animations on the compositor yet so we never
|
|
||||||
// meet currentColor on the compositor.
|
|
||||||
nscolor color = Servo_AnimationValue_GetColor(aValue, NS_RGBA(0, 0, 0, 0));
|
|
||||||
aLayer->AsColorLayer()->SetColor(gfx::Color::FromABGR(color));
|
|
||||||
aStorage->SetAnimatedValue(aLayer->GetCompositorAnimationsId(), color);
|
|
||||||
|
|
||||||
layerCompositor->SetShadowOpacity(aLayer->GetOpacity());
|
|
||||||
layerCompositor->SetShadowOpacitySetByAnimation(false);
|
|
||||||
layerCompositor->SetShadowBaseTransform(aLayer->GetBaseTransform());
|
|
||||||
layerCompositor->SetShadowTransformSetByAnimation(false);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case eCSSProperty_opacity: {
|
case eCSSProperty_opacity: {
|
||||||
float opacity = Servo_AnimationValue_GetOpacity(aValue);
|
float opacity = Servo_AnimationValue_GetOpacity(aValue);
|
||||||
layerCompositor->SetShadowOpacity(opacity);
|
layerCompositor->SetShadowOpacity(opacity);
|
||||||
@@ -722,9 +709,7 @@ SampleAnimations(Layer* aLayer,
|
|||||||
}
|
}
|
||||||
case AnimationHelper::SampleResult::Skipped:
|
case AnimationHelper::SampleResult::Skipped:
|
||||||
switch (animations[0].property()) {
|
switch (animations[0].property()) {
|
||||||
case eCSSProperty_background_color:
|
|
||||||
case eCSSProperty_opacity: {
|
case eCSSProperty_opacity: {
|
||||||
if (animations[0].property() == eCSSProperty_opacity) {
|
|
||||||
MOZ_ASSERT(
|
MOZ_ASSERT(
|
||||||
layer->AsHostLayer()->GetShadowOpacitySetByAnimation());
|
layer->AsHostLayer()->GetShadowOpacitySetByAnimation());
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
@@ -734,10 +719,9 @@ SampleAnimations(Layer* aLayer,
|
|||||||
// Servo_AnimationValue_GetOpacity(animationValue),
|
// Servo_AnimationValue_GetOpacity(animationValue),
|
||||||
// *(aStorage->GetAnimationOpacity(layer->GetCompositorAnimationsId()))));
|
// *(aStorage->GetAnimationOpacity(layer->GetCompositorAnimationsId()))));
|
||||||
#endif
|
#endif
|
||||||
}
|
// Even if opacity animation value has unchanged, we have to set
|
||||||
// Even if opacity or background-color animation value has
|
// the shadow base transform value here since the value might
|
||||||
// unchanged, we have to set the shadow base transform value
|
// have been changed by APZC.
|
||||||
// here since the value might have been changed by APZC.
|
|
||||||
HostLayer* layerCompositor = layer->AsHostLayer();
|
HostLayer* layerCompositor = layer->AsHostLayer();
|
||||||
layerCompositor->SetShadowBaseTransform(
|
layerCompositor->SetShadowBaseTransform(
|
||||||
layer->GetBaseTransform());
|
layer->GetBaseTransform());
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ using struct mozilla::gfx::Color from "mozilla/gfx/2D.h";
|
|||||||
using struct mozilla::gfx::Point3D from "mozilla/gfx/Point.h";
|
using struct mozilla::gfx::Point3D from "mozilla/gfx/Point.h";
|
||||||
using mozilla::gfx::IntPoint from "mozilla/gfx/Point.h";
|
using mozilla::gfx::IntPoint from "mozilla/gfx/Point.h";
|
||||||
using class mozilla::gfx::Matrix4x4 from "mozilla/gfx/Matrix.h";
|
using class mozilla::gfx::Matrix4x4 from "mozilla/gfx/Matrix.h";
|
||||||
using nscolor from "nsColor.h";
|
|
||||||
using nscoord from "nsCoord.h";
|
using nscoord from "nsCoord.h";
|
||||||
using struct nsRect from "nsRect.h";
|
using struct nsRect from "nsRect.h";
|
||||||
using struct nsPoint from "nsPoint.h";
|
using struct nsPoint from "nsPoint.h";
|
||||||
@@ -161,7 +160,6 @@ union MaybeTimeDuration {
|
|||||||
union Animatable {
|
union Animatable {
|
||||||
null_t;
|
null_t;
|
||||||
float;
|
float;
|
||||||
nscolor;
|
|
||||||
TransformFunction[];
|
TransformFunction[];
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -567,7 +565,6 @@ union MaybeTransform {
|
|||||||
|
|
||||||
union OMTAValue {
|
union OMTAValue {
|
||||||
null_t;
|
null_t;
|
||||||
nscolor;
|
|
||||||
float;
|
float;
|
||||||
Matrix4x4;
|
Matrix4x4;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -438,23 +438,6 @@ SetAnimatable(nsCSSPropertyID aProperty,
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch (aProperty) {
|
switch (aProperty) {
|
||||||
case eCSSProperty_background_color: {
|
|
||||||
// We don't support color animation on the compositor yet so that we can
|
|
||||||
// resolve currentColor at this moment.
|
|
||||||
nscolor foreground;
|
|
||||||
if (aFrame->Style()->RelevantLinkVisited()) {
|
|
||||||
if (ComputedStyle* styleIfVisited =
|
|
||||||
aFrame->Style()->GetStyleIfVisited()) {
|
|
||||||
foreground = styleIfVisited->StyleColor()->mColor;
|
|
||||||
} else {
|
|
||||||
foreground = aFrame->Style()->StyleColor()->mColor;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
foreground = aFrame->Style()->StyleColor()->mColor;
|
|
||||||
}
|
|
||||||
aAnimatable = aAnimationValue.GetColor(foreground);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case eCSSProperty_opacity:
|
case eCSSProperty_opacity:
|
||||||
aAnimatable = aAnimationValue.GetOpacity();
|
aAnimatable = aAnimationValue.GetOpacity();
|
||||||
break;
|
break;
|
||||||
@@ -690,7 +673,7 @@ AddAnimationsForProperty(nsIFrame* aFrame,
|
|||||||
scaleX,
|
scaleX,
|
||||||
scaleY,
|
scaleY,
|
||||||
hasPerspectiveParent);
|
hasPerspectiveParent);
|
||||||
} else {
|
} else if (aProperty == eCSSProperty_opacity) {
|
||||||
data = null_t();
|
data = null_t();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3546,7 +3529,6 @@ nsDisplaySolidColor::GetLayerState(nsDisplayListBuilder* aBuilder,
|
|||||||
if (ForceActiveLayers()) {
|
if (ForceActiveLayers()) {
|
||||||
return LAYER_ACTIVE;
|
return LAYER_ACTIVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return LAYER_NONE;
|
return LAYER_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5040,12 +5022,6 @@ nsDisplayBackgroundColor::GetLayerState(
|
|||||||
if (ForceActiveLayers() && clip != StyleGeometryBox::Text) {
|
if (ForceActiveLayers() && clip != StyleGeometryBox::Text) {
|
||||||
return LAYER_ACTIVE;
|
return LAYER_ACTIVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (EffectCompositor::HasAnimationsForCompositor(
|
|
||||||
mFrame, eCSSProperty_background_color)) {
|
|
||||||
return LAYER_ACTIVE_FORCE;
|
|
||||||
}
|
|
||||||
|
|
||||||
return LAYER_NONE;
|
return LAYER_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5073,11 +5049,6 @@ nsDisplayBackgroundColor::BuildLayer(
|
|||||||
layer->SetBaseTransform(gfx::Matrix4x4::Translation(
|
layer->SetBaseTransform(gfx::Matrix4x4::Translation(
|
||||||
aContainerParameters.mOffset.x, aContainerParameters.mOffset.y, 0));
|
aContainerParameters.mOffset.x, aContainerParameters.mOffset.y, 0));
|
||||||
|
|
||||||
nsDisplayListBuilder::AddAnimationsAndTransitionsToLayer(
|
|
||||||
layer, aBuilder,
|
|
||||||
this, mFrame,
|
|
||||||
eCSSProperty_background_color);
|
|
||||||
|
|
||||||
return layer.forget();
|
return layer.forget();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -8600,14 +8571,6 @@ nsDisplayTransform::CanUseAsyncAnimations(nsDisplayListBuilder* aBuilder)
|
|||||||
return mAllowAsyncAnimation;
|
return mAllowAsyncAnimation;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
|
||||||
nsDisplayBackgroundColor::CanUseAsyncAnimations(nsDisplayListBuilder* aBuilder)
|
|
||||||
{
|
|
||||||
LayerManager* layerManager = aBuilder->GetWidgetLayerManager();
|
|
||||||
return layerManager &&
|
|
||||||
layerManager->GetBackendType() != layers::LayersBackend::LAYERS_WR;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* static */ auto
|
/* static */ auto
|
||||||
nsDisplayTransform::ShouldPrerenderTransformedContent(
|
nsDisplayTransform::ShouldPrerenderTransformedContent(
|
||||||
nsDisplayListBuilder* aBuilder,
|
nsDisplayListBuilder* aBuilder,
|
||||||
|
|||||||
@@ -5074,8 +5074,6 @@ public:
|
|||||||
|
|
||||||
void WriteDebugInfo(std::stringstream& aStream) override;
|
void WriteDebugInfo(std::stringstream& aStream) override;
|
||||||
|
|
||||||
bool CanUseAsyncAnimations(nsDisplayListBuilder* aBuilder) override;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
const nsRect mBackgroundRect;
|
const nsRect mBackgroundRect;
|
||||||
RefPtr<mozilla::ComputedStyle> mBackgroundStyle;
|
RefPtr<mozilla::ComputedStyle> mBackgroundStyle;
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ namespace mozilla {
|
|||||||
/* static */ const Array<DisplayItemType,
|
/* static */ const Array<DisplayItemType,
|
||||||
nsCSSPropertyIDSet::CompositorAnimatableCount()>
|
nsCSSPropertyIDSet::CompositorAnimatableCount()>
|
||||||
LayerAnimationInfo::sDisplayItemTypes = {
|
LayerAnimationInfo::sDisplayItemTypes = {
|
||||||
DisplayItemType::TYPE_BACKGROUND_COLOR,
|
|
||||||
DisplayItemType::TYPE_OPACITY,
|
DisplayItemType::TYPE_OPACITY,
|
||||||
DisplayItemType::TYPE_TRANSFORM,
|
DisplayItemType::TYPE_TRANSFORM,
|
||||||
};
|
};
|
||||||
@@ -23,8 +22,6 @@ namespace mozilla {
|
|||||||
LayerAnimationInfo::GetDisplayItemTypeForProperty(nsCSSPropertyID aProperty)
|
LayerAnimationInfo::GetDisplayItemTypeForProperty(nsCSSPropertyID aProperty)
|
||||||
{
|
{
|
||||||
switch (aProperty) {
|
switch (aProperty) {
|
||||||
case eCSSProperty_background_color:
|
|
||||||
return DisplayItemType::TYPE_BACKGROUND_COLOR;
|
|
||||||
case eCSSProperty_opacity:
|
case eCSSProperty_opacity:
|
||||||
return DisplayItemType::TYPE_OPACITY;
|
return DisplayItemType::TYPE_OPACITY;
|
||||||
case eCSSProperty_transform:
|
case eCSSProperty_transform:
|
||||||
|
|||||||
@@ -34,13 +34,9 @@ struct LayerAnimationInfo {
|
|||||||
nsCSSPropertyIDSet{ eCSSProperty_transform };
|
nsCSSPropertyIDSet{ eCSSProperty_transform };
|
||||||
static const nsCSSPropertyIDSet opacityProperties =
|
static const nsCSSPropertyIDSet opacityProperties =
|
||||||
nsCSSPropertyIDSet{ eCSSProperty_opacity };
|
nsCSSPropertyIDSet{ eCSSProperty_opacity };
|
||||||
static const nsCSSPropertyIDSet backgroundColorProperties =
|
|
||||||
nsCSSPropertyIDSet{ eCSSProperty_background_color };
|
|
||||||
static const nsCSSPropertyIDSet empty = nsCSSPropertyIDSet();
|
static const nsCSSPropertyIDSet empty = nsCSSPropertyIDSet();
|
||||||
|
|
||||||
switch (aDisplayItemType) {
|
switch (aDisplayItemType) {
|
||||||
case DisplayItemType::TYPE_BACKGROUND_COLOR:
|
|
||||||
return backgroundColorProperties;
|
|
||||||
case DisplayItemType::TYPE_OPACITY:
|
case DisplayItemType::TYPE_OPACITY:
|
||||||
return opacityProperties;
|
return opacityProperties;
|
||||||
case DisplayItemType::TYPE_TRANSFORM:
|
case DisplayItemType::TYPE_TRANSFORM:
|
||||||
@@ -62,8 +58,6 @@ struct LayerAnimationInfo {
|
|||||||
GetChangeHintFor(DisplayItemType aDisplayItemType)
|
GetChangeHintFor(DisplayItemType aDisplayItemType)
|
||||||
{
|
{
|
||||||
switch (aDisplayItemType) {
|
switch (aDisplayItemType) {
|
||||||
case DisplayItemType::TYPE_BACKGROUND_COLOR:
|
|
||||||
return nsChangeHint_RepaintFrame;
|
|
||||||
case DisplayItemType::TYPE_OPACITY:
|
case DisplayItemType::TYPE_OPACITY:
|
||||||
return nsChangeHint_UpdateOpacityLayer;
|
return nsChangeHint_UpdateOpacityLayer;
|
||||||
case DisplayItemType::TYPE_TRANSFORM:
|
case DisplayItemType::TYPE_TRANSFORM:
|
||||||
|
|||||||
@@ -676,11 +676,6 @@ void Servo_AnimationValue_Serialize(
|
|||||||
nsCSSPropertyID property,
|
nsCSSPropertyID property,
|
||||||
nsAString* buffer);
|
nsAString* buffer);
|
||||||
|
|
||||||
nscolor Servo_AnimationValue_GetColor(RawServoAnimationValueBorrowed value,
|
|
||||||
nscolor foregroundColor);
|
|
||||||
RawServoAnimationValueStrong Servo_AnimationValue_Color(nsCSSPropertyID,
|
|
||||||
nscolor);
|
|
||||||
|
|
||||||
float Servo_AnimationValue_GetOpacity(RawServoAnimationValueBorrowed value);
|
float Servo_AnimationValue_GetOpacity(RawServoAnimationValueBorrowed value);
|
||||||
RawServoAnimationValueStrong Servo_AnimationValue_Opacity(float);
|
RawServoAnimationValueStrong Servo_AnimationValue_Opacity(float);
|
||||||
|
|
||||||
|
|||||||
@@ -120,13 +120,6 @@ AnimationValue::GetOpacity() const
|
|||||||
return Servo_AnimationValue_GetOpacity(mServo);
|
return Servo_AnimationValue_GetOpacity(mServo);
|
||||||
}
|
}
|
||||||
|
|
||||||
nscolor
|
|
||||||
AnimationValue::GetColor(nscolor aForegroundColor) const
|
|
||||||
{
|
|
||||||
MOZ_ASSERT(mServo);
|
|
||||||
return Servo_AnimationValue_GetColor(mServo, aForegroundColor);
|
|
||||||
}
|
|
||||||
|
|
||||||
already_AddRefed<const nsCSSValueSharedList>
|
already_AddRefed<const nsCSSValueSharedList>
|
||||||
AnimationValue::GetTransformList() const
|
AnimationValue::GetTransformList() const
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -78,10 +78,6 @@ struct AnimationValue
|
|||||||
|
|
||||||
float GetOpacity() const;
|
float GetOpacity() const;
|
||||||
|
|
||||||
// Returns nscolor value in this AnimationValue.
|
|
||||||
// Currently only background-color is supported.
|
|
||||||
nscolor GetColor(nscolor aForegroundColor) const;
|
|
||||||
|
|
||||||
// Return the transform list as a RefPtr.
|
// Return the transform list as a RefPtr.
|
||||||
already_AddRefed<const nsCSSValueSharedList> GetTransformList() const;
|
already_AddRefed<const nsCSSValueSharedList> GetTransformList() const;
|
||||||
|
|
||||||
|
|||||||
@@ -1117,7 +1117,7 @@ nsComputedDOMStyle::DoGetBottom()
|
|||||||
return GetOffsetWidthFor(eSideBottom);
|
return GetOffsetWidthFor(eSideBottom);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* static */ void
|
void
|
||||||
nsComputedDOMStyle::SetToRGBAColor(nsROCSSPrimitiveValue* aValue,
|
nsComputedDOMStyle::SetToRGBAColor(nsROCSSPrimitiveValue* aValue,
|
||||||
nscolor aColor)
|
nscolor aColor)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -131,7 +131,6 @@ public:
|
|||||||
|
|
||||||
static already_AddRefed<nsROCSSPrimitiveValue>
|
static already_AddRefed<nsROCSSPrimitiveValue>
|
||||||
MatrixToCSSValue(const mozilla::gfx::Matrix4x4& aMatrix);
|
MatrixToCSSValue(const mozilla::gfx::Matrix4x4& aMatrix);
|
||||||
static void SetToRGBAColor(nsROCSSPrimitiveValue* aValue, nscolor aColor);
|
|
||||||
|
|
||||||
static void RegisterPrefChangeCallbacks();
|
static void RegisterPrefChangeCallbacks();
|
||||||
static void UnregisterPrefChangeCallbacks();
|
static void UnregisterPrefChangeCallbacks();
|
||||||
@@ -429,6 +428,7 @@ private:
|
|||||||
already_AddRefed<CSSValue> DummyGetter();
|
already_AddRefed<CSSValue> DummyGetter();
|
||||||
|
|
||||||
/* Helper functions */
|
/* Helper functions */
|
||||||
|
void SetToRGBAColor(nsROCSSPrimitiveValue* aValue, nscolor aColor);
|
||||||
void SetValueFromComplexColor(nsROCSSPrimitiveValue* aValue,
|
void SetValueFromComplexColor(nsROCSSPrimitiveValue* aValue,
|
||||||
const mozilla::StyleComplexColor& aColor);
|
const mozilla::StyleComplexColor& aColor);
|
||||||
void SetValueToPositionCoord(const mozilla::Position::Coord& aCoord,
|
void SetValueToPositionCoord(const mozilla::Position::Coord& aCoord,
|
||||||
|
|||||||
@@ -422,30 +422,19 @@ const ExpectComparisonTo = {
|
|||||||
runningOn, desc, expectedComparisonResult,
|
runningOn, desc, expectedComparisonResult,
|
||||||
pseudo) {
|
pseudo) {
|
||||||
// Check input
|
// Check input
|
||||||
// FIXME: Auto generate this array.
|
const omtaProperties = [ "transform", "opacity" ];
|
||||||
const omtaProperties = [ "transform", "opacity", "background-color" ];
|
|
||||||
if (!omtaProperties.includes(property)) {
|
if (!omtaProperties.includes(property)) {
|
||||||
ok(false, property + " is not an OMTA property");
|
ok(false, property + " is not an OMTA property");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var normalize;
|
var isTransform = property == "transform";
|
||||||
var compare;
|
var normalize = isTransform ? convertTo3dMatrix : parseFloat;
|
||||||
var normalizedToString = JSON.stringify;
|
var compare = isTransform ?
|
||||||
switch (property) {
|
matricesRoughlyEqual :
|
||||||
case "transform":
|
function(a, b, error) { return Math.abs(a - b) <= error; };
|
||||||
normalize = convertTo3dMatrix;
|
var normalizedToString = isTransform ?
|
||||||
compare = matricesRoughlyEqual;
|
convert3dMatrixToString :
|
||||||
normalizedToString = convert3dMatrixToString;
|
JSON.stringify;
|
||||||
break;
|
|
||||||
case "opacity":
|
|
||||||
normalize = parseFloat;
|
|
||||||
compare = function(a, b, error) { return Math.abs(a - b) <= error; };
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
normalize = function(value) { return value; };
|
|
||||||
compare = function(a, b, error) { return a == b; };
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get actual values
|
// Get actual values
|
||||||
var compositorStr =
|
var compositorStr =
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ prefs =
|
|||||||
dom.animations-api.getAnimations.enabled=true
|
dom.animations-api.getAnimations.enabled=true
|
||||||
dom.animations-api.implicit-keyframes.enabled=true
|
dom.animations-api.implicit-keyframes.enabled=true
|
||||||
dom.animations-api.timelines.enabled=true
|
dom.animations-api.timelines.enabled=true
|
||||||
gfx.omta.background-color=true
|
|
||||||
layout.css.step-position-jump.enabled=true
|
layout.css.step-position-jump.enabled=true
|
||||||
support-files =
|
support-files =
|
||||||
animation_utils.js
|
animation_utils.js
|
||||||
|
|||||||
@@ -2391,122 +2391,5 @@ addAsyncAnimTest(async function() {
|
|||||||
done_div();
|
done_div();
|
||||||
});
|
});
|
||||||
|
|
||||||
if (SpecialPowers.DOMWindowUtils.layerManagerType != 'WebRender') {
|
|
||||||
// Normal background-color animation.
|
|
||||||
addAsyncAnimTest(async function() {
|
|
||||||
new_div("background-color: rgb(255, 0, 0); " +
|
|
||||||
"transition: background-color 10s linear");
|
|
||||||
await waitForPaintsFlushed();
|
|
||||||
|
|
||||||
gDiv.style.backgroundColor = "rgb(0, 255, 0)";
|
|
||||||
await waitForPaintsFlushed();
|
|
||||||
|
|
||||||
omta_is("background-color", "rgb(255, 0, 0)", RunningOn.Compositor,
|
|
||||||
"background-color transition runs on compositor thread");
|
|
||||||
|
|
||||||
advance_clock(5000);
|
|
||||||
omta_is("background-color", "rgb(128, 128, 0)", RunningOn.Compositor,
|
|
||||||
"background-color on compositor at 5s");
|
|
||||||
|
|
||||||
done_div();
|
|
||||||
});
|
|
||||||
|
|
||||||
// background-color animation with currentColor.
|
|
||||||
addAsyncAnimTest(async function() {
|
|
||||||
new_div("color: rgb(255, 0, 0); " +
|
|
||||||
"background-color: currentColor; " +
|
|
||||||
"transition: background-color 10s linear");
|
|
||||||
await waitForPaintsFlushed();
|
|
||||||
|
|
||||||
gDiv.style.backgroundColor = "rgb(0, 255, 0)";
|
|
||||||
await waitForPaintsFlushed();
|
|
||||||
|
|
||||||
omta_is("background-color", "rgb(255, 0, 0)", RunningOn.Compositor,
|
|
||||||
"background-color transition starting with current-color runs on " +
|
|
||||||
"compositor thread");
|
|
||||||
|
|
||||||
advance_clock(5000);
|
|
||||||
omta_is("background-color", "rgb(128, 128, 0)", RunningOn.Compositor,
|
|
||||||
"background-color on compositor at 5s");
|
|
||||||
|
|
||||||
done_div();
|
|
||||||
});
|
|
||||||
|
|
||||||
// Tests that a background-color animation from inherited currentColor to
|
|
||||||
// a normal color on the compositor is updated when the parent color is
|
|
||||||
// changed.
|
|
||||||
addAsyncAnimTest(async function() {
|
|
||||||
new_div("");
|
|
||||||
const parent = document.createElement("div");
|
|
||||||
gDiv.parentNode.insertBefore(parent, gDiv);
|
|
||||||
parent.style.color = "rgb(255, 0, 0)";
|
|
||||||
parent.appendChild(gDiv);
|
|
||||||
|
|
||||||
gDiv.animate({ backgroundColor: [ "currentColor", "rgb(0, 255, 0)" ] }, 1000);
|
|
||||||
|
|
||||||
await waitForPaintsFlushed();
|
|
||||||
|
|
||||||
omta_is("background-color", "rgb(255, 0, 0)", RunningOn.Compositor,
|
|
||||||
"background-color animation starting with current-color runs on " +
|
|
||||||
"compositor thread");
|
|
||||||
|
|
||||||
advance_clock(500);
|
|
||||||
|
|
||||||
omta_is("background-color", "rgb(128, 128, 0)", RunningOn.Compositor,
|
|
||||||
"background-color on compositor at 5s");
|
|
||||||
|
|
||||||
// Change the parent's color in the middle of the animation.
|
|
||||||
parent.style.color = "rgb(0, 0, 255)";
|
|
||||||
await waitForPaintsFlushed();
|
|
||||||
|
|
||||||
omta_is("background-color", "rgb(0, 128, 128)", RunningOn.Compositor,
|
|
||||||
"background-color on compositor is reflected by the parent's " +
|
|
||||||
"color change");
|
|
||||||
|
|
||||||
done_div();
|
|
||||||
parent.remove();
|
|
||||||
});
|
|
||||||
|
|
||||||
// Tests that a background-color animation from currentColor to a normal color
|
|
||||||
// on <a> element is updated when the link is visited.
|
|
||||||
addAsyncAnimTest(async function() {
|
|
||||||
[ gDiv ] = new_element("a", "display: block");
|
|
||||||
gDiv.setAttribute("href", "not-exist.html");
|
|
||||||
gDiv.classList.add("visited");
|
|
||||||
|
|
||||||
const extraStyle = document.createElement('style');
|
|
||||||
document.head.appendChild(extraStyle);
|
|
||||||
extraStyle.sheet.insertRule(".visited:visited { color: rgb(0, 0, 255); }", 0);
|
|
||||||
extraStyle.sheet.insertRule(".visited:link { color: rgb(255, 0, 0); }", 1);
|
|
||||||
|
|
||||||
gDiv.animate({ backgroundColor: [ "currentColor", "rgb(0, 255, 0)" ] }, 1000);
|
|
||||||
await waitForPaintsFlushed();
|
|
||||||
|
|
||||||
omta_is("background-color", "rgb(255, 0, 0)", RunningOn.Compositor,
|
|
||||||
"background-color animation starting with current-color runs on " +
|
|
||||||
"compositor thread");
|
|
||||||
|
|
||||||
advance_clock(500);
|
|
||||||
|
|
||||||
omta_is("background-color", "rgb(128, 128, 0)", RunningOn.Compositor,
|
|
||||||
"background-color on compositor at 5s");
|
|
||||||
|
|
||||||
gDiv.setAttribute("href", window.top.location.href);
|
|
||||||
await waitForVisitedLinkColoring(gDiv, "color", "rgb(0, 0, 255)");
|
|
||||||
await waitForPaintsFlushed();
|
|
||||||
|
|
||||||
// `omta_is` checks that the result on the compositor equals to the value by
|
|
||||||
// getComputedValue() but getComputedValue lies for visited link values so
|
|
||||||
// we use getOMTAStyle directly instead.
|
|
||||||
is(SpecialPowers.DOMWindowUtils.getOMTAStyle(gDiv, "background-color"),
|
|
||||||
"rgb(0, 128, 128)",
|
|
||||||
"background-color on <a> element after the link is visited");
|
|
||||||
|
|
||||||
extraStyle.remove();
|
|
||||||
done_element();
|
|
||||||
gDiv = null;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -494,18 +494,6 @@ VARCACHE_PREF(
|
|||||||
RelaxedAtomicBool, false
|
RelaxedAtomicBool, false
|
||||||
)
|
)
|
||||||
|
|
||||||
#ifdef RELEASE_OR_BETA
|
|
||||||
# define PREF_VALUE false
|
|
||||||
#else
|
|
||||||
# define PREF_VALUE true
|
|
||||||
#endif
|
|
||||||
VARCACHE_PREF(
|
|
||||||
"gfx.omta.background-color",
|
|
||||||
gfx_omta_background_color,
|
|
||||||
bool, PREF_VALUE
|
|
||||||
)
|
|
||||||
#undef PREF_VALUE
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
// HTML5 parser prefs
|
// HTML5 parser prefs
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -15,8 +15,7 @@ ${helpers.predefined_type(
|
|||||||
animation_value_type="AnimatedColor",
|
animation_value_type="AnimatedColor",
|
||||||
ignored_when_colors_disabled=True,
|
ignored_when_colors_disabled=True,
|
||||||
allow_quirks=True,
|
allow_quirks=True,
|
||||||
flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER \
|
flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
|
||||||
CAN_ANIMATE_ON_COMPOSITOR",
|
|
||||||
)}
|
)}
|
||||||
|
|
||||||
${helpers.predefined_type(
|
${helpers.predefined_type(
|
||||||
|
|||||||
@@ -797,27 +797,6 @@ pub extern "C" fn Servo_AnimationValue_Serialize(
|
|||||||
debug_assert!(rv.is_ok());
|
debug_assert!(rv.is_ok());
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
|
||||||
pub extern "C" fn Servo_AnimationValue_GetColor(
|
|
||||||
value: RawServoAnimationValueBorrowed,
|
|
||||||
foreground_color: structs::nscolor,
|
|
||||||
) -> structs::nscolor {
|
|
||||||
use style::gecko::values::convert_nscolor_to_rgba;
|
|
||||||
use style::gecko::values::convert_rgba_to_nscolor;
|
|
||||||
use style::values::animated::ToAnimatedValue;
|
|
||||||
use style::values::computed::color::Color as ComputedColor;
|
|
||||||
|
|
||||||
let value = AnimationValue::as_arc(&value);
|
|
||||||
match **value {
|
|
||||||
AnimationValue::BackgroundColor(color) => {
|
|
||||||
let computed: ComputedColor = ToAnimatedValue::from_animated_value(color);
|
|
||||||
let foreground_color = convert_nscolor_to_rgba(foreground_color);
|
|
||||||
convert_rgba_to_nscolor(&computed.to_rgba(foreground_color))
|
|
||||||
}
|
|
||||||
_ => panic!("Other color properties are not supported yet"),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn Servo_AnimationValue_GetOpacity(value: RawServoAnimationValueBorrowed) -> f32 {
|
pub extern "C" fn Servo_AnimationValue_GetOpacity(value: RawServoAnimationValueBorrowed) -> f32 {
|
||||||
let value = AnimationValue::as_arc(&value);
|
let value = AnimationValue::as_arc(&value);
|
||||||
@@ -833,30 +812,6 @@ pub extern "C" fn Servo_AnimationValue_Opacity(opacity: f32) -> RawServoAnimatio
|
|||||||
Arc::new(AnimationValue::Opacity(opacity)).into_strong()
|
Arc::new(AnimationValue::Opacity(opacity)).into_strong()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
|
||||||
pub extern "C" fn Servo_AnimationValue_Color(
|
|
||||||
color_property: nsCSSPropertyID,
|
|
||||||
color: structs::nscolor
|
|
||||||
) -> RawServoAnimationValueStrong {
|
|
||||||
use style::gecko::values::convert_nscolor_to_rgba;
|
|
||||||
use style::values::animated::color::RGBA as AnimatedRGBA;
|
|
||||||
|
|
||||||
let property = LonghandId::from_nscsspropertyid(color_property)
|
|
||||||
.expect("We don't have shorthand property animation value");
|
|
||||||
|
|
||||||
let rgba = convert_nscolor_to_rgba(color);
|
|
||||||
|
|
||||||
let animatedRGBA = AnimatedRGBA::new(rgba.red_f32(),
|
|
||||||
rgba.green_f32(),
|
|
||||||
rgba.blue_f32(),
|
|
||||||
rgba.alpha_f32());
|
|
||||||
match property {
|
|
||||||
LonghandId::BackgroundColor =>
|
|
||||||
Arc::new(AnimationValue::BackgroundColor(animatedRGBA.into())).into_strong(),
|
|
||||||
_ => panic!("Should be background-color property"),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn Servo_AnimationValue_GetTransform(
|
pub extern "C" fn Servo_AnimationValue_GetTransform(
|
||||||
value: RawServoAnimationValueBorrowed,
|
value: RawServoAnimationValueBorrowed,
|
||||||
|
|||||||
Reference in New Issue
Block a user