[css-shapes-1] Implement xywh() function
Categories
(Core :: CSS Parsing and Computation, enhancement)
Tracking
()
Tracking | Status | |
---|---|---|
firefox117 | --- | fixed |
People
(Reporter: sebo, Assigned: boris)
References
(Blocks 3 open bugs, )
Details
(Keywords: dev-doc-complete)
Attachments
(5 files)
The CSS Shapes 1 specification defines an xywh()
function to create a rectangular shape.
This bug is meant to implement that function.
Sebastian
Assignee | ||
Comment 1•2 years ago
|
||
wpt
- https://searchfox.org/mozilla-central/source/testing/web-platform/tests/css/css-images/object-view-box-xywh.html
- https://searchfox.org/mozilla-central/source/testing/web-platform/tests/css/css-images/object-view-box-xywh-percentage.html
- https://searchfox.org/mozilla-central/source/testing/web-platform/tests/css/css-images/object-view-box-interpolation.html
- and in the parsing test, https://searchfox.org/mozilla-central/source/testing/web-platform/tests/css/css-images/object-view-box-parsing.html
Assignee | ||
Updated•2 years ago
|
Comment 3•1 year ago
|
||
(In reply to Boris Chiou [:boris] from comment #2)
We may have to support this as well for motion-1.
In particular, this is required for these WPTs which contribute to the interop-2023 "Motion Path" focus area:
https://wpt.fyi/results/css/motion/offset-path-shape-xywh-001.html
https://wpt.fyi/results/css/motion/offset-path-shape-xywh-002.html
Both of those tests use offset-path: xywh(...)
.
Assignee | ||
Comment 4•1 year ago
|
||
And it seems like there is no test case of rect()
and xywh()
for clip-path
in WPT. (But there are tests of shape()
for clip-path
in WPT.) So I will add some tests of xywh()
for clip-path as well in this bug.
Assignee | ||
Comment 5•1 year ago
|
||
Also, add layout.css.basic-shape-xywh.enabled and enable it on Nightly
Assignee | ||
Comment 6•1 year ago
|
||
And rename some functions, e.g. BuildInsetPath as BuildRectPath and
ComputeInsetRadii as ComputeRectRadii, because we would like to use it for
inset()/xywh()/rect(). All of them define the similar rectangles.
Also, tweak the tests:
- tweak offset-path-shape-xywh-001.html to avoid the element just at
the bottom-right corner of path because there is no tangent angle at this
point. Its direction angle could be 90deg or 180deg, depends on the
implementation. - tweak offset-path-shape-xywh-002.html and
offset-path-shape-xywh-002-ref.html together because it seems the
original ref file is incorrect. The test was added by Blink and the
implementation of xywh() in Blink uses the height of the reference box to
resolve the precentage value of the width of the transformed box.
It doesn't make sense because we should use the width of the reference box
to resolve it. So tweak the test and its reference file together
based on Gecko's result.
Assignee | ||
Comment 7•1 year ago
|
||
The fuzzy in the test happens on the round because we use the different way
to draw the round of clip-path (compared to border-radius property) in
the render backend, so there are some tiny differences.
Assignee | ||
Comment 8•1 year ago
|
||
We would like to use these function for all rectangular shape, i.e.
inset()/xywh()/rect(). So rename them to avoid confusion.
No behavior change.
Assignee | ||
Comment 9•1 year ago
|
||
Comment 10•1 year ago
|
||
Pushed by bchiou@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/66865edf765b Support xywh() in style. r=emilio https://hg.mozilla.org/integration/autoland/rev/7bb336a7878e Rename inset as rect in ShapeUtils. r=emilio https://hg.mozilla.org/integration/autoland/rev/fb419d8b4ca6 Support xywh() for offset-path. r=emilio https://hg.mozilla.org/integration/autoland/rev/0aa826684137 Support xywh() for clip-path. r=emilio https://hg.mozilla.org/integration/autoland/rev/98306fe9e124 Add test to make sure the animations of offset-path:xywh() run on the compositor. r=hiro
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/40925 for changes under testing/web-platform/tests
Comment 12•1 year ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/66865edf765b
https://hg.mozilla.org/mozilla-central/rev/7bb336a7878e
https://hg.mozilla.org/mozilla-central/rev/fb419d8b4ca6
https://hg.mozilla.org/mozilla-central/rev/0aa826684137
https://hg.mozilla.org/mozilla-central/rev/98306fe9e124
Upstream PR merged by moz-wptsync-bot
Comment 14•1 year ago
|
||
MDN doc updates for this feature can be tracked via this issue: https://github.com/mdn/content/issues/28286 (in review).
Thank you for your help, Boris!
Description
•