Closed Bug 1842277 Opened 9 months ago Closed 9 months ago

Make xywh() compute to the equivalent inset() function

Categories

(Core :: CSS Parsing and Computation, defect, P3)

defect

Tracking

()

RESOLVED FIXED
117 Branch
Tracking Status
firefox117 --- fixed

People

(Reporter: boris, Assigned: boris)

References

(Blocks 1 open bug, )

Details

Attachments

(2 files)

Per https://drafts.csswg.org/css-shapes-1/#basic-shape-computed-values, we should make inset()/xywh()/rect() compute to the equivalent inset() function

Type: enhancement → defect
Depends on: 1841235
Blocks: 1841235
No longer depends on: 1841235
Assignee: nobody → boris.chiou

Per spec
https://drafts.csswg.org/css-shapes-1/#basic-shape-computed-values, and
the spec issue, https://github.com/w3c/csswg-drafts/issues/9053,
all <basic-shape-rect> functions compute to the equivalent inset() function.
i.e.
xywh(x y w h) computes to
inset(y calc(100% - x - w) calc(100% - y - h) x)

Also, tweak the test, offset-path-shape-xywh-003, because the original
xywh(10% 10% 80% 80%) has to calculate calc(100% - calc(10% + 80%)),
whose result is Percentage(0.099999964) in Rust code, and then it makes us
compute an imprecision inset rect when building the gfx::path, so the result
becomes fuzzy because of the sub-pixel translation.

So change it to xywh(10% 10% 90% 90%) to avoid adding fuzzy tolerance.

Now xywh() and inset() should be interpolable, so add some tests for it.

Also, we have a lot of interpolation tests for motion in WPT, so it's
unnecessary to have the similar tests in test_transitions_per_property.html.

Pushed by bchiou@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/19f42d47ba8d
Compute <basic-shape-rect> to the equivalent inset() function. r=devtools-reviewers,emilio
https://hg.mozilla.org/integration/autoland/rev/86b90f83c914
Add tests for basic-shape-rect and drop duplicate tests from test_transitions_per_property.html. r=emilio
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/41004 for changes under testing/web-platform/tests
Status: NEW → RESOLVED
Closed: 9 months ago
Resolution: --- → FIXED
Target Milestone: --- → 117 Branch
Upstream PR merged by moz-wptsync-bot
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: