Bug 1559231 - Make offset-anchor animatable. r=birtles

Per the spec issue, https://github.com/w3c/csswg-drafts/issues/3482,
we update the wpt to keep the percentage in `calc()` for `offset-anchor`.

Differential Revision: https://phabricator.services.mozilla.com/D39552

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Boris Chiou 2019-08-02 00:47:09 +00:00
Родитель 9463547bb3
Коммит 4dbc9ab7ef
6 изменённых файлов: 16 добавлений и 78 удалений

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

@ -218,7 +218,6 @@ exports.ANIMATION_TYPE_FOR_LONGHANDS = [
"min-block-size", "min-block-size",
"-moz-min-font-size-ratio", "-moz-min-font-size-ratio",
"min-inline-size", "min-inline-size",
"offset-anchor",
"padding-block-end", "padding-block-end",
"padding-block-start", "padding-block-start",
"padding-inline-end", "padding-inline-end",
@ -283,6 +282,7 @@ exports.ANIMATION_TYPE_FOR_LONGHANDS = [
"mask-position-y", "mask-position-y",
"mask-size", "mask-size",
"object-position", "object-position",
"offset-anchor",
"offset-path", "offset-path",
"offset-rotate", "offset-rotate",
"order", "order",

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

@ -374,6 +374,11 @@ if (IsCSSPropertyPrefEnabled("layout.css.motion-path.enabled")) {
supported_properties["offset-rotate"] = supported_properties["offset-rotate"] =
[ test_angle_transition, [ test_angle_transition,
test_offset_rotate_transition ]; test_offset_rotate_transition ];
// Note: offset-anchor supports "auto | <position>", and the tests for
// `auto` are already in wpt, so we don't test it here again.
supported_properties["offset-anchor"] =
[ test_background_position_transition ];
} }
if (IsCSSPropertyPrefEnabled("layout.css.clip-path-path.enabled")) { if (IsCSSPropertyPrefEnabled("layout.css.clip-path-path.enabled")) {

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

@ -427,7 +427,7 @@ ${helpers.predefined_type(
"PositionOrAuto", "PositionOrAuto",
"computed::PositionOrAuto::auto()", "computed::PositionOrAuto::auto()",
engines="gecko", engines="gecko",
animation_value_type="none", animation_value_type="ComputedValue",
gecko_pref="layout.css.motion-path.enabled", gecko_pref="layout.css.motion-path.enabled",
spec="https://drafts.fxtf.org/motion-1/#offset-anchor-property", spec="https://drafts.fxtf.org/motion-1/#offset-anchor-property",
servo_restyle_damage="reflow_out_of_flow" servo_restyle_damage="reflow_out_of_flow"

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

@ -45,13 +45,16 @@ impl<H, V> Position<H, V> {
/// This is used by <offset-anchor> for now. /// This is used by <offset-anchor> for now.
/// https://drafts.fxtf.org/motion-1/#offset-anchor-property /// https://drafts.fxtf.org/motion-1/#offset-anchor-property
#[derive( #[derive(
Animate,
Clone, Clone,
ComputeSquaredDistance,
Copy, Copy,
Debug, Debug,
MallocSizeOf, MallocSizeOf,
Parse, Parse,
PartialEq, PartialEq,
SpecifiedValueInfo, SpecifiedValueInfo,
ToAnimatedZero,
ToComputedValue, ToComputedValue,
ToCss, ToCss,
ToResolvedValue, ToResolvedValue,

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

@ -1,70 +0,0 @@
[offset-anchor-interpolation.html]
[Animation between "220px 240px" and "300px 400px" at progress -1]
expected: FAIL
[Animation between "220px 240px" and "300px 400px" at progress 0]
expected: FAIL
[Animation between "220px 240px" and "300px 400px" at progress 0.125]
expected: FAIL
[Animation between "220px 240px" and "300px 400px" at progress 0.875]
expected: FAIL
[Animation between "220px 240px" and "300px 400px" at progress 1]
expected: FAIL
[Animation between "220px 240px" and "300px 400px" at progress 2]
expected: FAIL
[Animation between "left 480px top 400px" and "right -140% bottom -60%" at progress -1]
expected: FAIL
[Animation between "left 480px top 400px" and "right -140% bottom -60%" at progress 0]
expected: FAIL
[Animation between "left 480px top 400px" and "right -140% bottom -60%" at progress 0.125]
expected: FAIL
[Animation between "left 480px top 400px" and "right -140% bottom -60%" at progress 0.875]
expected: FAIL
[Animation between "left 480px top 400px" and "right -140% bottom -60%" at progress 1]
expected: FAIL
[Animation between "left 480px top 400px" and "right -140% bottom -60%" at progress 2]
expected: FAIL
[Animation between "left top" and "left 8px bottom 20%" at progress -1]
expected: FAIL
[Animation between "left top" and "left 8px bottom 20%" at progress 0]
expected: FAIL
[Animation between "left top" and "left 8px bottom 20%" at progress 0.125]
expected: FAIL
[Animation between "left top" and "left 8px bottom 20%" at progress 0.875]
expected: FAIL
[Animation between "left top" and "left 8px bottom 20%" at progress 1]
expected: FAIL
[Animation between "left top" and "left 8px bottom 20%" at progress 2]
expected: FAIL
[Animation between "right 10px top 20%" and "auto" at progress -1]
expected: FAIL
[Animation between "right 10px top 20%" and "auto" at progress 0]
expected: FAIL
[Animation between "right 10px top 20%" and "auto" at progress 0.125]
expected: FAIL
[Animation between "right 10px top 20%" and "auto" at progress 0.875]
expected: FAIL
[Animation between "right 10px top 20%" and "auto" at progress 0.4]
expected: FAIL

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

@ -42,7 +42,7 @@
to: 'right -140% bottom -60%', to: 'right -140% bottom -60%',
}, [ }, [
{at: -1, expect: 'calc(960px - 240%) calc(800px - 160%)'}, {at: -1, expect: 'calc(960px - 240%) calc(800px - 160%)'},
{at: 0, expect: 'left 480px top 400px'}, {at: 0, expect: 'left calc(0% + 480px) top calc(0% + 400px)'},
{at: 0.125, expect: 'calc(420px + 30%) calc(350px + 20%)'}, {at: 0.125, expect: 'calc(420px + 30%) calc(350px + 20%)'},
{at: 0.875, expect: 'calc(210% + 60px) calc(140% + 50px)'}, {at: 0.875, expect: 'calc(210% + 60px) calc(140% + 50px)'},
{at: 1, expect: 'right -140% bottom -60%'}, {at: 1, expect: 'right -140% bottom -60%'},
@ -54,12 +54,12 @@
from: 'left top', from: 'left top',
to: 'left 8px bottom 20%', to: 'left 8px bottom 20%',
}, [ }, [
{at: -1, expect: '-8px -80%'}, {at: -1, expect: 'calc(0% - 8px) -80%'},
{at: 0, expect: 'left top'}, {at: 0, expect: 'left top'},
{at: 0.125, expect: '1px 10%'}, {at: 0.125, expect: 'calc(0% + 1px) 10%'},
{at: 0.875, expect: '7px 70%'}, {at: 0.875, expect: 'calc(0% + 7px) 70%'},
{at: 1, expect: 'left 8px bottom 20%'}, {at: 1, expect: 'left calc(0% + 8px) bottom 20%'},
{at: 2, expect: '16px 160%'} {at: 2, expect: 'calc(0% + 16px) 160%'}
]); ]);
test_no_interpolation({ test_no_interpolation({