зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
6b97f2cda8
Коммит
f97b59258b
|
@ -1894,23 +1894,6 @@ KeyframeEffect::IsMatchForCompositor(
|
|||
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()
|
||||
? KeyframeEffect::MatchForCompositor::Yes
|
||||
: KeyframeEffect::MatchForCompositor::IfNeeded;
|
||||
|
|
|
@ -50,9 +50,7 @@ div {
|
|||
/** Test for bug 1045994 - Add a chrome-only property to inspect if an
|
||||
animation is running on the compositor or not **/
|
||||
|
||||
const omtaEnabled = isOMTAEnabled();
|
||||
const isWebRender =
|
||||
SpecialPowers.DOMWindowUtils.layerManagerType == 'WebRender';
|
||||
var omtaEnabled = isOMTAEnabled();
|
||||
|
||||
function assert_animation_is_running_on_compositor(animation, desc) {
|
||||
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 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>
|
||||
</body>
|
||||
|
|
|
@ -5,7 +5,6 @@ prefs =
|
|||
dom.animations-api.getAnimations.enabled=true
|
||||
dom.animations-api.implicit-keyframes.enabled=true
|
||||
dom.animations-api.timelines.enabled=true
|
||||
gfx.omta.background-color=true
|
||||
layout.css.motion-path.enabled=true
|
||||
layout.css.individual-transform.enabled=true
|
||||
# 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) {
|
||||
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) {
|
||||
case AnimatedValue::COLOR:
|
||||
omtaValue = animatedValue->mColor;
|
||||
break;
|
||||
case AnimatedValue::OPACITY:
|
||||
omtaValue = animatedValue->mOpacity;
|
||||
break;
|
||||
|
@ -121,18 +118,6 @@ CompositorAnimationStorage::SetAnimatedValue(uint64_t aId,
|
|||
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
|
||||
CompositorAnimationStorage::SetAnimatedValue(uint64_t aId,
|
||||
const float& aOpacity)
|
||||
|
@ -534,7 +519,7 @@ CreateCSSValueList(const InfallibleTArray<TransformFunction>& aFunctions)
|
|||
}
|
||||
|
||||
static already_AddRefed<RawServoAnimationValue>
|
||||
ToAnimationValue(nsCSSPropertyID aProperty, const Animatable& aAnimatable)
|
||||
ToAnimationValue(const Animatable& aAnimatable)
|
||||
{
|
||||
RefPtr<RawServoAnimationValue> result;
|
||||
|
||||
|
@ -555,10 +540,6 @@ ToAnimationValue(nsCSSPropertyID aProperty, const Animatable& aAnimatable)
|
|||
case Animatable::Tfloat:
|
||||
result = Servo_AnimationValue_Opacity(aAnimatable.get_float()).Consume();
|
||||
break;
|
||||
case Animatable::Tnscolor:
|
||||
result = Servo_AnimationValue_Color(aProperty,
|
||||
aAnimatable.get_nscolor()).Consume();
|
||||
break;
|
||||
default:
|
||||
MOZ_ASSERT_UNREACHABLE("Unsupported type");
|
||||
}
|
||||
|
@ -599,8 +580,7 @@ AnimationHelper::SetAnimations(
|
|||
}
|
||||
|
||||
if (animation.baseStyle().type() != Animatable::Tnull_t) {
|
||||
aBaseAnimationStyle = ToAnimationValue(animation.property(),
|
||||
animation.baseStyle());
|
||||
aBaseAnimationStyle = ToAnimationValue(animation.baseStyle());
|
||||
}
|
||||
|
||||
AnimData* data = aAnimData.AppendElement();
|
||||
|
@ -625,10 +605,8 @@ AnimationHelper::SetAnimations(
|
|||
|
||||
const InfallibleTArray<AnimationSegment>& segments = animation.segments();
|
||||
for (const AnimationSegment& segment : segments) {
|
||||
startValues.AppendElement(ToAnimationValue(animation.property(),
|
||||
segment.startState()));
|
||||
endValues.AppendElement(ToAnimationValue(animation.property(),
|
||||
segment.endState()));
|
||||
startValues.AppendElement(ToAnimationValue(segment.startState()));
|
||||
endValues.AppendElement(ToAnimationValue(segment.endState()));
|
||||
|
||||
TimingFunction tf = segment.sampleFn();
|
||||
Maybe<ComputedTimingFunction> ctf =
|
||||
|
|
|
@ -55,14 +55,12 @@ struct AnimatedValue {
|
|||
enum {
|
||||
TRANSFORM,
|
||||
OPACITY,
|
||||
COLOR,
|
||||
NONE
|
||||
} mType {NONE};
|
||||
|
||||
union {
|
||||
AnimationTransform mTransform;
|
||||
float mOpacity;
|
||||
nscolor mColor;
|
||||
};
|
||||
|
||||
AnimatedValue(gfx::Matrix4x4&& aTransformInDevSpace,
|
||||
|
@ -82,12 +80,6 @@ struct AnimatedValue {
|
|||
{
|
||||
}
|
||||
|
||||
explicit AnimatedValue(nscolor aValue)
|
||||
: mType(AnimatedValue::COLOR)
|
||||
, mColor(aValue)
|
||||
{
|
||||
}
|
||||
|
||||
~AnimatedValue() {}
|
||||
|
||||
private:
|
||||
|
@ -136,11 +128,6 @@ public:
|
|||
*/
|
||||
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
|
||||
*/
|
||||
|
|
|
@ -633,19 +633,6 @@ ApplyAnimatedValue(Layer* aLayer,
|
|||
|
||||
HostLayer* layerCompositor = aLayer->AsHostLayer();
|
||||
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: {
|
||||
float opacity = Servo_AnimationValue_GetOpacity(aValue);
|
||||
layerCompositor->SetShadowOpacity(opacity);
|
||||
|
@ -722,22 +709,19 @@ SampleAnimations(Layer* aLayer,
|
|||
}
|
||||
case AnimationHelper::SampleResult::Skipped:
|
||||
switch (animations[0].property()) {
|
||||
case eCSSProperty_background_color:
|
||||
case eCSSProperty_opacity: {
|
||||
if (animations[0].property() == eCSSProperty_opacity) {
|
||||
MOZ_ASSERT(
|
||||
layer->AsHostLayer()->GetShadowOpacitySetByAnimation());
|
||||
MOZ_ASSERT(
|
||||
layer->AsHostLayer()->GetShadowOpacitySetByAnimation());
|
||||
#ifdef DEBUG
|
||||
// Disable this assertion until the root cause is fixed in bug
|
||||
// 1459775.
|
||||
// MOZ_ASSERT(FuzzyEqualsMultiplicative(
|
||||
// Servo_AnimationValue_GetOpacity(animationValue),
|
||||
// *(aStorage->GetAnimationOpacity(layer->GetCompositorAnimationsId()))));
|
||||
// Disable this assertion until the root cause is fixed in bug
|
||||
// 1459775.
|
||||
// MOZ_ASSERT(FuzzyEqualsMultiplicative(
|
||||
// Servo_AnimationValue_GetOpacity(animationValue),
|
||||
// *(aStorage->GetAnimationOpacity(layer->GetCompositorAnimationsId()))));
|
||||
#endif
|
||||
}
|
||||
// Even if opacity or background-color animation value has
|
||||
// unchanged, we have to set the shadow base transform value
|
||||
// here since the value might have been changed by APZC.
|
||||
// Even if opacity animation value has unchanged, we have to set
|
||||
// the shadow base transform value here since the value might
|
||||
// have been changed by APZC.
|
||||
HostLayer* layerCompositor = layer->AsHostLayer();
|
||||
layerCompositor->SetShadowBaseTransform(
|
||||
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 mozilla::gfx::IntPoint from "mozilla/gfx/Point.h";
|
||||
using class mozilla::gfx::Matrix4x4 from "mozilla/gfx/Matrix.h";
|
||||
using nscolor from "nsColor.h";
|
||||
using nscoord from "nsCoord.h";
|
||||
using struct nsRect from "nsRect.h";
|
||||
using struct nsPoint from "nsPoint.h";
|
||||
|
@ -161,7 +160,6 @@ union MaybeTimeDuration {
|
|||
union Animatable {
|
||||
null_t;
|
||||
float;
|
||||
nscolor;
|
||||
TransformFunction[];
|
||||
};
|
||||
|
||||
|
@ -567,7 +565,6 @@ union MaybeTransform {
|
|||
|
||||
union OMTAValue {
|
||||
null_t;
|
||||
nscolor;
|
||||
float;
|
||||
Matrix4x4;
|
||||
};
|
||||
|
|
|
@ -438,23 +438,6 @@ SetAnimatable(nsCSSPropertyID 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:
|
||||
aAnimatable = aAnimationValue.GetOpacity();
|
||||
break;
|
||||
|
@ -690,7 +673,7 @@ AddAnimationsForProperty(nsIFrame* aFrame,
|
|||
scaleX,
|
||||
scaleY,
|
||||
hasPerspectiveParent);
|
||||
} else {
|
||||
} else if (aProperty == eCSSProperty_opacity) {
|
||||
data = null_t();
|
||||
}
|
||||
|
||||
|
@ -3546,7 +3529,6 @@ nsDisplaySolidColor::GetLayerState(nsDisplayListBuilder* aBuilder,
|
|||
if (ForceActiveLayers()) {
|
||||
return LAYER_ACTIVE;
|
||||
}
|
||||
|
||||
return LAYER_NONE;
|
||||
}
|
||||
|
||||
|
@ -5040,12 +5022,6 @@ nsDisplayBackgroundColor::GetLayerState(
|
|||
if (ForceActiveLayers() && clip != StyleGeometryBox::Text) {
|
||||
return LAYER_ACTIVE;
|
||||
}
|
||||
|
||||
if (EffectCompositor::HasAnimationsForCompositor(
|
||||
mFrame, eCSSProperty_background_color)) {
|
||||
return LAYER_ACTIVE_FORCE;
|
||||
}
|
||||
|
||||
return LAYER_NONE;
|
||||
}
|
||||
|
||||
|
@ -5073,11 +5049,6 @@ nsDisplayBackgroundColor::BuildLayer(
|
|||
layer->SetBaseTransform(gfx::Matrix4x4::Translation(
|
||||
aContainerParameters.mOffset.x, aContainerParameters.mOffset.y, 0));
|
||||
|
||||
nsDisplayListBuilder::AddAnimationsAndTransitionsToLayer(
|
||||
layer, aBuilder,
|
||||
this, mFrame,
|
||||
eCSSProperty_background_color);
|
||||
|
||||
return layer.forget();
|
||||
}
|
||||
|
||||
|
@ -8600,14 +8571,6 @@ nsDisplayTransform::CanUseAsyncAnimations(nsDisplayListBuilder* aBuilder)
|
|||
return mAllowAsyncAnimation;
|
||||
}
|
||||
|
||||
bool
|
||||
nsDisplayBackgroundColor::CanUseAsyncAnimations(nsDisplayListBuilder* aBuilder)
|
||||
{
|
||||
LayerManager* layerManager = aBuilder->GetWidgetLayerManager();
|
||||
return layerManager &&
|
||||
layerManager->GetBackendType() != layers::LayersBackend::LAYERS_WR;
|
||||
}
|
||||
|
||||
/* static */ auto
|
||||
nsDisplayTransform::ShouldPrerenderTransformedContent(
|
||||
nsDisplayListBuilder* aBuilder,
|
||||
|
|
|
@ -5074,8 +5074,6 @@ public:
|
|||
|
||||
void WriteDebugInfo(std::stringstream& aStream) override;
|
||||
|
||||
bool CanUseAsyncAnimations(nsDisplayListBuilder* aBuilder) override;
|
||||
|
||||
protected:
|
||||
const nsRect mBackgroundRect;
|
||||
RefPtr<mozilla::ComputedStyle> mBackgroundStyle;
|
||||
|
|
|
@ -14,7 +14,6 @@ namespace mozilla {
|
|||
/* static */ const Array<DisplayItemType,
|
||||
nsCSSPropertyIDSet::CompositorAnimatableCount()>
|
||||
LayerAnimationInfo::sDisplayItemTypes = {
|
||||
DisplayItemType::TYPE_BACKGROUND_COLOR,
|
||||
DisplayItemType::TYPE_OPACITY,
|
||||
DisplayItemType::TYPE_TRANSFORM,
|
||||
};
|
||||
|
@ -23,8 +22,6 @@ namespace mozilla {
|
|||
LayerAnimationInfo::GetDisplayItemTypeForProperty(nsCSSPropertyID aProperty)
|
||||
{
|
||||
switch (aProperty) {
|
||||
case eCSSProperty_background_color:
|
||||
return DisplayItemType::TYPE_BACKGROUND_COLOR;
|
||||
case eCSSProperty_opacity:
|
||||
return DisplayItemType::TYPE_OPACITY;
|
||||
case eCSSProperty_transform:
|
||||
|
|
|
@ -34,13 +34,9 @@ struct LayerAnimationInfo {
|
|||
nsCSSPropertyIDSet{ eCSSProperty_transform };
|
||||
static const nsCSSPropertyIDSet opacityProperties =
|
||||
nsCSSPropertyIDSet{ eCSSProperty_opacity };
|
||||
static const nsCSSPropertyIDSet backgroundColorProperties =
|
||||
nsCSSPropertyIDSet{ eCSSProperty_background_color };
|
||||
static const nsCSSPropertyIDSet empty = nsCSSPropertyIDSet();
|
||||
|
||||
switch (aDisplayItemType) {
|
||||
case DisplayItemType::TYPE_BACKGROUND_COLOR:
|
||||
return backgroundColorProperties;
|
||||
case DisplayItemType::TYPE_OPACITY:
|
||||
return opacityProperties;
|
||||
case DisplayItemType::TYPE_TRANSFORM:
|
||||
|
@ -62,8 +58,6 @@ struct LayerAnimationInfo {
|
|||
GetChangeHintFor(DisplayItemType aDisplayItemType)
|
||||
{
|
||||
switch (aDisplayItemType) {
|
||||
case DisplayItemType::TYPE_BACKGROUND_COLOR:
|
||||
return nsChangeHint_RepaintFrame;
|
||||
case DisplayItemType::TYPE_OPACITY:
|
||||
return nsChangeHint_UpdateOpacityLayer;
|
||||
case DisplayItemType::TYPE_TRANSFORM:
|
||||
|
|
|
@ -676,11 +676,6 @@ void Servo_AnimationValue_Serialize(
|
|||
nsCSSPropertyID property,
|
||||
nsAString* buffer);
|
||||
|
||||
nscolor Servo_AnimationValue_GetColor(RawServoAnimationValueBorrowed value,
|
||||
nscolor foregroundColor);
|
||||
RawServoAnimationValueStrong Servo_AnimationValue_Color(nsCSSPropertyID,
|
||||
nscolor);
|
||||
|
||||
float Servo_AnimationValue_GetOpacity(RawServoAnimationValueBorrowed value);
|
||||
RawServoAnimationValueStrong Servo_AnimationValue_Opacity(float);
|
||||
|
||||
|
|
|
@ -120,13 +120,6 @@ AnimationValue::GetOpacity() const
|
|||
return Servo_AnimationValue_GetOpacity(mServo);
|
||||
}
|
||||
|
||||
nscolor
|
||||
AnimationValue::GetColor(nscolor aForegroundColor) const
|
||||
{
|
||||
MOZ_ASSERT(mServo);
|
||||
return Servo_AnimationValue_GetColor(mServo, aForegroundColor);
|
||||
}
|
||||
|
||||
already_AddRefed<const nsCSSValueSharedList>
|
||||
AnimationValue::GetTransformList() const
|
||||
{
|
||||
|
|
|
@ -78,10 +78,6 @@ struct AnimationValue
|
|||
|
||||
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.
|
||||
already_AddRefed<const nsCSSValueSharedList> GetTransformList() const;
|
||||
|
||||
|
|
|
@ -1117,7 +1117,7 @@ nsComputedDOMStyle::DoGetBottom()
|
|||
return GetOffsetWidthFor(eSideBottom);
|
||||
}
|
||||
|
||||
/* static */ void
|
||||
void
|
||||
nsComputedDOMStyle::SetToRGBAColor(nsROCSSPrimitiveValue* aValue,
|
||||
nscolor aColor)
|
||||
{
|
||||
|
|
|
@ -131,7 +131,6 @@ public:
|
|||
|
||||
static already_AddRefed<nsROCSSPrimitiveValue>
|
||||
MatrixToCSSValue(const mozilla::gfx::Matrix4x4& aMatrix);
|
||||
static void SetToRGBAColor(nsROCSSPrimitiveValue* aValue, nscolor aColor);
|
||||
|
||||
static void RegisterPrefChangeCallbacks();
|
||||
static void UnregisterPrefChangeCallbacks();
|
||||
|
@ -429,6 +428,7 @@ private:
|
|||
already_AddRefed<CSSValue> DummyGetter();
|
||||
|
||||
/* Helper functions */
|
||||
void SetToRGBAColor(nsROCSSPrimitiveValue* aValue, nscolor aColor);
|
||||
void SetValueFromComplexColor(nsROCSSPrimitiveValue* aValue,
|
||||
const mozilla::StyleComplexColor& aColor);
|
||||
void SetValueToPositionCoord(const mozilla::Position::Coord& aCoord,
|
||||
|
|
|
@ -422,30 +422,19 @@ const ExpectComparisonTo = {
|
|||
runningOn, desc, expectedComparisonResult,
|
||||
pseudo) {
|
||||
// Check input
|
||||
// FIXME: Auto generate this array.
|
||||
const omtaProperties = [ "transform", "opacity", "background-color" ];
|
||||
const omtaProperties = [ "transform", "opacity" ];
|
||||
if (!omtaProperties.includes(property)) {
|
||||
ok(false, property + " is not an OMTA property");
|
||||
return;
|
||||
}
|
||||
var normalize;
|
||||
var compare;
|
||||
var normalizedToString = JSON.stringify;
|
||||
switch (property) {
|
||||
case "transform":
|
||||
normalize = convertTo3dMatrix;
|
||||
compare = matricesRoughlyEqual;
|
||||
normalizedToString = convert3dMatrixToString;
|
||||
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;
|
||||
}
|
||||
var isTransform = property == "transform";
|
||||
var normalize = isTransform ? convertTo3dMatrix : parseFloat;
|
||||
var compare = isTransform ?
|
||||
matricesRoughlyEqual :
|
||||
function(a, b, error) { return Math.abs(a - b) <= error; };
|
||||
var normalizedToString = isTransform ?
|
||||
convert3dMatrixToString :
|
||||
JSON.stringify;
|
||||
|
||||
// Get actual values
|
||||
var compositorStr =
|
||||
|
|
|
@ -5,7 +5,6 @@ prefs =
|
|||
dom.animations-api.getAnimations.enabled=true
|
||||
dom.animations-api.implicit-keyframes.enabled=true
|
||||
dom.animations-api.timelines.enabled=true
|
||||
gfx.omta.background-color=true
|
||||
layout.css.step-position-jump.enabled=true
|
||||
support-files =
|
||||
animation_utils.js
|
||||
|
|
|
@ -2391,122 +2391,5 @@ addAsyncAnimTest(async function() {
|
|||
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>
|
||||
</html>
|
||||
|
|
|
@ -494,18 +494,6 @@ VARCACHE_PREF(
|
|||
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
|
||||
//---------------------------------------------------------------------------
|
||||
|
|
|
@ -15,8 +15,7 @@ ${helpers.predefined_type(
|
|||
animation_value_type="AnimatedColor",
|
||||
ignored_when_colors_disabled=True,
|
||||
allow_quirks=True,
|
||||
flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER \
|
||||
CAN_ANIMATE_ON_COMPOSITOR",
|
||||
flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
|
||||
)}
|
||||
|
||||
${helpers.predefined_type(
|
||||
|
|
|
@ -797,27 +797,6 @@ pub extern "C" fn Servo_AnimationValue_Serialize(
|
|||
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]
|
||||
pub extern "C" fn Servo_AnimationValue_GetOpacity(value: RawServoAnimationValueBorrowed) -> f32 {
|
||||
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()
|
||||
}
|
||||
|
||||
#[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]
|
||||
pub extern "C" fn Servo_AnimationValue_GetTransform(
|
||||
value: RawServoAnimationValueBorrowed,
|
||||
|
|
Загрузка…
Ссылка в новой задаче