Skip to content

Avoid false-negative in logical alias animation test #53212

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Calme1709
Copy link
Contributor

The spec (https://drafts.csswg.org/web-animations-1/#ref-for-computed-keyframes) states that the following steps should be used to resolve conflicts between animated properties:

  1. Longhand properties override shorthand properties (e.g. border-top-color overrides border-top).

  2. Shorthand properties with fewer longhand components override those with more longhand components (e.g. border-top overrides border-color).

  3. Physical properties override logical properties.

  4. For shorthand properties with an equal number of longhand components, properties whose IDL name (see the CSS property to IDL attribute algorithm [CSSOM]) appears earlier when sorted in ascending order by the Unicode codepoints that make up each IDL name, override those who appear later.

Before this change the test used marginInline and margin, expecting margin to win as it was a physical property where marginInline is a logical alias, however according to the spec, marginInline should actually win as it has fewer longhands (only 2 compared to margin's 4).

To properly test this we need to use two shorthands with the same number of longhands (and ideally where the logical shorthand would be favoured by step 4 above to avoid a false positive). 'border-block-start' and 'border-top' fit this criteria.

The spec
(https://drafts.csswg.org/web-animations-1/#ref-for-computed-keyframes)
states that the following steps should be used to resolve conflicts
between animated properties:

1. Longhand properties override shorthand properties (e.g.
   border-top-color overrides border-top).

2. Shorthand properties with fewer longhand components override those
   with more longhand components (e.g. border-top overrides border-color).

3. Physical properties override logical properties.

4. For shorthand properties with an equal number of longhand components,
   properties whose IDL name (see the CSS property to IDL attribute
   algorithm [CSSOM]) appears earlier when sorted in ascending order by
   the Unicode codepoints that make up each IDL name, override those who
   appear later.

Before this change the test used marginInline and margin, expecting
margin to win as it was a physical property where marginInline is a
logical alias, however according to the spec, marginInline should
actually win as it has fewer longhands (only 2 compared to margin's 4).

To properly test this we need to use two shorthands with the same number
of longhands (and ideally where the logical shorthand would be favoured
by step 4 above to avoid a false positive). 'border-block-start' and
'border-top' fit this criteria.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants