The idea is to make the function small enough that it's fast to inline and
optimize by the compiler. For that:
* Move some complex bits of matches_simple_selector into functions so
that the compiler can put them out of line if it wants.
* Rename a function to be more descriptive and not force it to be
inline (that wasn't measured afaict, comes from the :nth-child(of)
implementation).
Depends on D180591
Differential Revision: https://phabricator.services.mozilla.com/D180592
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, just like what we do for clip-path in Bug 1512883.
Also drop the normalization of SVGPathData in AnimationInfo when
preparing offset-path for compositor animations. It's useless because we
"always" do normalization in SVGPathData::animate().
Differential Revision: https://phabricator.services.mozilla.com/D180284
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:
1. Update offset-path-interpolation-006.html to make sure the start value
and the end value have `at <position>`. `offset-path` doesn't set center
as default for `at <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.
2. We still have some failures in offset-path-interpolation-006.html
beacuse we don't clamp the negative radius/radii and the negative
border-radius. We will handle it in the following patches.
3. We will add `<coord-box>` in the later patch.
4. Adding Deserialize and Serialize is necessary for compositor
animations.
Differential Revision: https://phabricator.services.mozilla.com/D179627
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 behaviors for now.
This bug is for offset-path and we will use it in the following patches.
We should fix them in Bug 1837340.
Differential Revision: https://phabricator.services.mozilla.com/D179626
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: "ShapeType" means this property uses filled shapes or outline
shapes. For outline shapes, we ignore fill-rule. This is from the
concept of `<outline-shape>` and `<filled-shape>` in
https://github.com/w3c/csswg-drafts/issues/3468#issue-393916361
No behavir change in this patch, just add the ability for offset-path to
ignore `<fill-rule>` when combining all basic shapes into offset-path.
Differential Revision: https://phabricator.services.mozilla.com/D179625
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.
Differential Revision: https://phabricator.services.mozilla.com/D179624
Layer insertion may change the order of styles, so we may need to fully
invalidate.
Without this change, bug 1838045 makes
layer-statement-before-import.html fail.
Differential Revision: https://phabricator.services.mozilla.com/D180929
Lazily create the rule list since most style rules won't have child
rules.
Remaining failures in the cssom tests are tracked in other bugs.
Differential Revision: https://phabricator.services.mozilla.com/D180649
Lazily create the rule list since most style rules won't have child
rules.
Remaining failures in the cssom tests are tracked in other bugs.
Differential Revision: https://phabricator.services.mozilla.com/D180649
At least when the containers are different.
For now check that by doing a somewhat simplified test (checking
sibling-ness).
The new flag can be useful to optimize container query restyles on
resizes too, in the future.
Differential Revision: https://phabricator.services.mozilla.com/D179268
For non-adopted sheets, use the owner tree. Those are always good to go.
For constructed stylesheets, try to find the most likely candidate. It's
not perfect but it's likely to always be correct in practice.
We could ask for the specific host instead, though that can get rather
annoying in practice.
Differential Revision: https://phabricator.services.mozilla.com/D180347
The CSS properties in the list are all shipped. Since we still don't support use
counter for developing CSS properties since this bug opens, I assume this
feature is not critical. Hence the removal of the comment.
Differential Revision: https://phabricator.services.mozilla.com/D180771
Fix some bugs caught by css/cssom/shorthand-values. In particular:
* Make the shorthand order match the spec.
* Omit values when we can.
Fix a subtest that wasn't correct. Shorthands can be serialized as long
as !important matches in all components.
Differential Revision: https://phabricator.services.mozilla.com/D180466
It was an extra layer of abstraction that we needed when stylo and the
old style system co-existed, but we no longer need it, and can just
merge them.
This will make upcoming CSS nesting changes to the object model easier.
Differential Revision: https://phabricator.services.mozilla.com/D180439
This patch adds the ability to parse most CSS filters without a context.
OffscreenCanvas can use this on worker threads to provide support for
filter operations.
Differential Revision: https://phabricator.services.mozilla.com/D179994
Added NaN/inf serialization of <number> and changed calc() code to not
remove NaN/infinity in code using it.
This change is unfortunately imperfect as some things using <number>
still refuse to serialize NaN/infinity for some reason (scale()?), but
this bug/patch is just for <number> so leaving that out of scope for
this.
Also added new WPT test file for number NaN/inf serialization based
on existing serialization tests (all pass already!).
5 other WPT subtests now newly pass.
Differential Revision: https://phabricator.services.mozilla.com/D178587
Apply some clang-tidy suggestions while I was going through the
ServoStyleConstsInlines while at it.
Remove one 0x test because it's tested on the same test and causes a
harness error.
Differential Revision: https://phabricator.services.mozilla.com/D180331