Skip to content

Commit

Permalink
[css-logical] split logical shorthand relative prioritization animati…
Browse files Browse the repository at this point in the history
…on test off from css/css-logical/animation-001.html as a dedicated tentative test

https://bugs.webkit.org/show_bug.cgi?id=278910
rdar://135006627

Reviewed by NOBODY (OOPS!).

Given the `logical` keyword for the `margin` shorthand, and other relative shorthands, is not stable yet,
as discussed in w3c/csswg-drafts#1282, we split off the test in
`css/css-logical/animation-001.html` that relies on this feature and make a new test file marked `.tentative`.

* LayoutTests/imported/w3c/web-platform-tests/css/css-logical/animation-001-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-logical/animation-001.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-logical/animations/logical-shorthand-relative-prioritization-by-number-of-components.tentative-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-logical/animations/logical-shorthand-relative-prioritization-by-number-of-components.tentative.html: Added.
  • Loading branch information
graouts committed Aug 30, 2024
1 parent 8319c48 commit dd293f9
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ PASS Logical properties in animations respect the direction
PASS Physical properties win over logical properties in object notation
PASS Physical properties win over logical properties in array notation
PASS Physical properties with variables win over logical properties
FAIL Logical shorthands follow the usual prioritization based on number of component longhands assert_equals: expected "300px" but got "0px"
PASS Physical longhands win over logical shorthands
PASS Logical longhands win over physical shorthands
PASS Physical shorthands win over logical shorthands
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,23 +101,6 @@
assert_equals(getComputedStyle(div).height, '250px');
}, 'Physical properties with variables win over logical properties');

test(t => {
const div = addDiv(t);
const anim = div.animate(
{
marginInlineStart: '100px',
marginInline: '200px',
margin: 'logical 300px',
},
{ duration: 1, easing: 'step-start' }
);
assert_equals(getComputedStyle(div).marginLeft, '100px');
assert_equals(getComputedStyle(div).marginRight, '200px');
assert_equals(getComputedStyle(div).marginTop, '300px');
assert_equals(getComputedStyle(div).marginBottom, '300px');
}, 'Logical shorthands follow the usual prioritization based on number of'
+ ' component longhands');

test(t => {
const div = addDiv(t);
const anim = div.animate(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

FAIL Logical shorthands follow the usual prioritization based on number of component longhands assert_equals: expected "300px" but got "0px"

Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!doctype html>
<meta charset=utf-8>
<title>Logical shorthands follow the usual prioritization based on number of component longhands</title>
<link rel="help" href="https://drafts.csswg.org/web-animations-1/#calculating-computed-keyframes">
<meta name="assert" content="Shorthand properties with fewer longhand components override those with more longhand components (e.g. border-top overrides border-color).">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../../css-animations/support/testcommon.js"></script>

<div id="log"></div>
<script>
'use strict';

test(t => {
const div = addDiv(t);
const anim = div.animate(
{
marginInlineStart: '100px',
marginInline: '200px',
margin: 'logical 300px',
},
{ duration: 1, easing: 'step-start' }
);
assert_equals(getComputedStyle(div).marginLeft, '100px');
assert_equals(getComputedStyle(div).marginRight, '200px');
assert_equals(getComputedStyle(div).marginTop, '300px');
assert_equals(getComputedStyle(div).marginBottom, '300px');
}, 'Logical shorthands follow the usual prioritization based on number of'
+ ' component longhands');

</script>

0 comments on commit dd293f9

Please sign in to comment.