mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-17 15:25:52 +00:00
Bug 1455999 - Drop isStyleByServo() in dom/animation/. r=birtles
We have already dropped the old style sytem. MozReview-Commit-ID: I4RUlLHLAxr --HG-- extra : rebase_source : d2f1bacd0c938da760ee37288c5df331de489f40
This commit is contained in:
parent
59c7ccd500
commit
374e5b3e07
@ -24,11 +24,6 @@ div {
|
||||
<script>
|
||||
'use strict';
|
||||
|
||||
// Stylo matches the spec more closely wrt serialization of specified calc().
|
||||
//
|
||||
// See https://github.com/w3c/csswg-drafts/issues/1731
|
||||
const isStylo = SpecialPowers.DOMWindowUtils.isStyledByServo;
|
||||
|
||||
var gTests = [
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
@ -571,7 +566,7 @@ var gTests = [
|
||||
frames: { left: ['calc(10em + 10px)', 'calc(10em + 10%)'] },
|
||||
expected: [ { property: 'left',
|
||||
values: [ valueFormat(0, 'calc(110px)', 'replace', 'linear'),
|
||||
valueFormat(1, isStylo ? 'calc(10% + 100px)' : 'calc(100px + 10%)', 'replace') ] } ]
|
||||
valueFormat(1, 'calc(10% + 100px)', 'replace') ] } ]
|
||||
},
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
@ -590,7 +585,7 @@ var gTests = [
|
||||
frames: { left: ['10px', 'calc(var(--var-100px) / 2 - 10%)'] },
|
||||
expected: [ { property: 'left',
|
||||
values: [ valueFormat(0, '10px', 'replace', 'linear'),
|
||||
valueFormat(1, isStylo ? 'calc(-10% + 50px)' : 'calc(50px + -10%)', 'replace') ] } ]
|
||||
valueFormat(1, 'calc(-10% + 50px)', 'replace') ] } ]
|
||||
},
|
||||
{ desc: 'CSS variables in shorthands are resolved to their corresponding'
|
||||
+ ' values',
|
||||
|
@ -164,7 +164,6 @@ function tweakExpectedRestyleCount(aAnimation, aExpectedRestyleCount) {
|
||||
var omtaEnabled = isOMTAEnabled();
|
||||
|
||||
var isAndroid = !!navigator.userAgent.includes("Android");
|
||||
var isServo = isStyledByServo();
|
||||
var hasConformantPromiseHandling;
|
||||
|
||||
function add_task_if_omta_enabled(test) {
|
||||
@ -1270,24 +1269,12 @@ waitForAllPaints(() => {
|
||||
// Apply another animation style
|
||||
div.style.animation = 'background-color 110s';
|
||||
var markers = await observeStyling(1);
|
||||
if (isServo) {
|
||||
// There should be two restyles.
|
||||
// 1) Animation-only restyle for before applying the new animation style
|
||||
// 2) Animation-only restyle for after applying the new animation style
|
||||
is(markers.length, 2,
|
||||
'Applying animation style with different duration ' +
|
||||
'should restyle twice');
|
||||
} else {
|
||||
// There should be three restyles.
|
||||
// 1) Animation-only restyle for before applying the new animation style
|
||||
// 2) Restyle for applying the new animation style
|
||||
// Note: In gecko styling for animations is not separated.
|
||||
// 3) Restyle triggered by updating an existing animation (specifically
|
||||
// the animation-duration)
|
||||
is(markers.length, 3,
|
||||
'Applying animation style with different duration ' +
|
||||
'should restyles three times');
|
||||
}
|
||||
// There should be two restyles.
|
||||
// 1) Animation-only restyle for before applying the new animation style
|
||||
// 2) Animation-only restyle for after applying the new animation style
|
||||
is(markers.length, 2,
|
||||
'Applying animation style with different duration ' +
|
||||
'should restyle twice');
|
||||
await ensureElementRemoval(div);
|
||||
});
|
||||
|
||||
@ -1728,15 +1715,9 @@ waitForAllPaints(() => {
|
||||
|
||||
div.style.setProperty('color', 'blue', '');
|
||||
var markers = await observeStyling(5);
|
||||
if (isServo) {
|
||||
is(markers.length, 0,
|
||||
'The opacity animation keeps running on the compositor when ' +
|
||||
'color style is changed');
|
||||
} else {
|
||||
todo_is(markers.length, 0,
|
||||
'Bug 1307341 The opacity animation keeps running on the ' +
|
||||
'compositor when color style is changed');
|
||||
}
|
||||
is(markers.length, 0,
|
||||
'The opacity animation keeps running on the compositor when ' +
|
||||
'color style is changed');
|
||||
await ensureElementRemoval(div);
|
||||
}
|
||||
);
|
||||
@ -1794,16 +1775,9 @@ waitForAllPaints(() => {
|
||||
is(div.getAnimations().length, 0, 'There should be no animation');
|
||||
});
|
||||
|
||||
if (isServo) {
|
||||
is(markers.length, 1, // For discarding the throttled animation.
|
||||
'Element.getAnimations() should flush throttled animation style so ' +
|
||||
'that the throttled animation is discarded');
|
||||
} else {
|
||||
is(markers.length, 2, // One is done through UpdateOnlyAnimationStyles(),
|
||||
// the other is for discarding the animation.
|
||||
'Element.getAnimations() should flush throttled animation style that ' +
|
||||
'the throttled animation is discarded');
|
||||
}
|
||||
is(markers.length, 1, // For discarding the throttled animation.
|
||||
'Element.getAnimations() should flush throttled animation style so ' +
|
||||
'that the throttled animation is discarded');
|
||||
|
||||
await ensureElementRemoval(div);
|
||||
});
|
||||
|
@ -84,10 +84,6 @@ promise_test(t => {
|
||||
}, 'Forcing an animation targetting an element in a document without a'
|
||||
+ ' browsing context to play does not cause style to update');
|
||||
|
||||
// Following is an additional Gecko-specific test to confirm the behavior
|
||||
// when we have an element with an animation restyle and then move it to
|
||||
// a document without a pres shell.
|
||||
|
||||
promise_test(t => {
|
||||
let anim;
|
||||
return getXHRDoc(t).then(xhrdoc => {
|
||||
@ -101,15 +97,8 @@ promise_test(t => {
|
||||
xhrdoc.body.appendChild(div);
|
||||
// We should skip applying animation styles to elements in documents
|
||||
// without a pres shell.
|
||||
//
|
||||
// The Gecko style backend, however, does not do this. Since we expect the
|
||||
// Gecko style backend to be obsolete in the near future, we only perform
|
||||
// this check when the Servo backend is in use.
|
||||
let isServo = SpecialPowers.DOMWindowUtils.isStyledByServo;
|
||||
if (isServo) {
|
||||
assert_equals(getComputedStyle(div).opacity, '1',
|
||||
'Style should NOT be updated');
|
||||
}
|
||||
assert_equals(getComputedStyle(div).opacity, '1',
|
||||
'Style should NOT be updated');
|
||||
});
|
||||
}, 'Moving an element with a pending animation restyle to a document without'
|
||||
+ ' a browsing context resets animation style');
|
||||
|
@ -8,8 +8,6 @@
|
||||
<script>
|
||||
"use strict";
|
||||
|
||||
const isGecko = !isStyledByServo();
|
||||
|
||||
// Tests that we correctly extract the underlying value when the animation
|
||||
// type is 'discrete'.
|
||||
const discreteTests = [
|
||||
@ -33,11 +31,6 @@ const discreteTests = [
|
||||
{ computedOffset: 1, alignContent: "normal" }
|
||||
],
|
||||
explanation: "Test for 0% keyframe only",
|
||||
// The value of 100% should be 'normal',
|
||||
// but we are not supporting underlying value for Gecko.
|
||||
// https://bugzilla.mozilla.org/show_bug.cgi?id=1295401
|
||||
// So, we skip this test case.
|
||||
skip: isGecko
|
||||
},
|
||||
{
|
||||
stylesheet: {
|
||||
@ -48,11 +41,6 @@ const discreteTests = [
|
||||
{ computedOffset: 1, alignContent: "flex-end" }
|
||||
],
|
||||
explanation: "Test for 100% keyframe only",
|
||||
// The value of 0% should be 'normal',
|
||||
// but we are not supporting underlying value for Gecko.
|
||||
// https://bugzilla.mozilla.org/show_bug.cgi?id=1295401
|
||||
// So, we skip this test case.
|
||||
skip: isGecko
|
||||
},
|
||||
{
|
||||
stylesheet: {
|
||||
@ -94,11 +82,6 @@ const discreteTests = [
|
||||
],
|
||||
explanation: "Test for no 0%/100% keyframes " +
|
||||
"and 'inherit' specified on target element",
|
||||
// The value of 0%/100% should be 'normal',
|
||||
// but we are not supporting underlying value for Gecko.
|
||||
// https://bugzilla.mozilla.org/show_bug.cgi?id=1295401
|
||||
// So, we skip this test case.
|
||||
skip: isGecko
|
||||
},
|
||||
{
|
||||
stylesheet: {
|
||||
|
@ -363,13 +363,6 @@ function isOMTAEnabled() {
|
||||
SpecialPowers.getBoolPref(OMTAPrefKey);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the document is styled by servo.
|
||||
*/
|
||||
function isStyledByServo() {
|
||||
return SpecialPowers.DOMWindowUtils.isStyledByServo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Append an SVG element to the target element.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user