[motion-1] Support "<basic-shape> || <coord-box>" for offset-path in the style system
Categories
(Core :: CSS Parsing and Computation, enhancement)
Tracking
()
Tracking | Status | |
---|---|---|
firefox116 | --- | fixed |
People
(Reporter: boris, Assigned: boris)
References
(Blocks 2 open bugs)
Details
(Keywords: dev-doc-complete)
Attachments
(6 files)
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review |
I split the patches for style system part from Bug 1598156 to avoid making Bug 1598156 too large.
Assignee | ||
Comment 1•1 year ago
|
||
The definition of <basic-shape>
includes other types of basic shapes,
e.g. path(), xywh(), rect(). So we put them together to match the spec.
However, some properties only use the subset of basic shapes, so we use
the bitflags to choose the supported basic shape at the parse time.
Also, remove StyleBasicShapeType because no one uses it.
Only refactoring in this patch.
Assignee | ||
Comment 2•1 year ago
|
||
For outline shapes, fill-rule should be ignored. We add the flag in
the parser of BasicShape, so offset-path can use this flag to ignore
fill-rule.
Note: "IgnoreFillRule" means the fill-rule is still in the function
syntax, but we don't use it. Alwasy using the default fill-rule so we don't
serialize it and it doesn't affect the interpolation.
No behavir change in this patch.
Assignee | ||
Comment 3•1 year ago
|
||
The omitted postion has special meaning for offset-path. It defaults to using
offset-position as the circle/ellipse center if the explicit center is
not given. Just like what we do for ray(), here we also use
PositionOrAuto for it.
We omit this component if it is not given when serializing offet-path,
and preserve the value even if it specifies the default value, for the
same reason.
For shape-outside and clip-path, we don't change their behavior for now.
This patch is for offset-path and we will use it in the following patches.
Note: No behavior change on shape-outside and clip-path in this patch.
We may update them per the spec issue:
https://github.com/w3c/csswg-drafts/issues/8695
Assignee | ||
Comment 4•1 year ago
|
||
We rewrite the data structure of OffsetPath to support all basic shapes.
However, We don't build the gfx::Path for basic shapes other than path()
for now because the current caching mechanism (on the main thread) doesn't
work for basic shapes. It's layout dependent.
Note:
- Update offset-path-interpolation-006.html to make sure the start value
and the end value haveat <position>
.offset-path
doesn't set center
as default forat <position>
, so if any of the values omits the
at <position>
, we expect they are not interpolated in Gecko.
This is different from Blink, they still use center as the default value
for interpolation. - We will add
<coord-box>
in the next patch.
Assignee | ||
Comment 5•1 year ago
|
||
We are using NonNegative now for offset-path, so just like clip-path, we
have to make sure we don't get the negative radius for circle and ellipse,
and don't get the negative border-radius for inset. Therefore, we have to
convert the computed value into animated value when doing interpolation,
and then clamp the value to make sure it is always >= 0 when converting
it back to computed value.
Assignee | ||
Comment 6•1 year ago
|
||
This patch makes sure the syntax of offset-path
is:
offset-path: none | <offset-path> || <coord-box>
.
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Comment 9•1 year ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/0d5498dd11fd
https://hg.mozilla.org/mozilla-central/rev/6f345b692ecb
https://hg.mozilla.org/mozilla-central/rev/bc7a93717f74
https://hg.mozilla.org/mozilla-central/rev/deff1184821d
https://hg.mozilla.org/mozilla-central/rev/92077688f5e5
https://hg.mozilla.org/mozilla-central/rev/dd8c4852148d
Comment 11•1 year ago
|
||
MDN doc updates for this feature can be tracked via this issue: https://github.com/mdn/content/issues/27747.
Thank you Boris for the help and reviews!
Description
•