Граф коммитов

14716 Коммитов

Автор SHA1 Сообщение Дата
Emily McDonough 99e10c5f8a Bug 1833471 Part 1 - Implement @page pseudo-class parsing and rule handling r=emilio
This currently will not match page-rules based on any selectors with any
pseudo-classes present.

Differential Revision: https://phabricator.services.mozilla.com/D178252
2023-06-21 23:37:46 +00:00
Norisz Fay 9e2d68a917 Backed out 3 changesets (bug 1833471) for causing failures on cssom-ruleTypeAndOrder.html, page-rule-declarations-000.html
Backed out changeset 69c9504ac848 (bug 1833471)
Backed out changeset e76595d749fb (bug 1833471)
Backed out changeset fd4e99d77a6b (bug 1833471)
2023-06-22 01:01:20 +03:00
Emily McDonough a18b6d735d Bug 1833471 Part 1 - Implement @page pseudo-class parsing and rule handling r=emilio
This currently will not match page-rules based on any selectors with any
pseudo-classes present.

Differential Revision: https://phabricator.services.mozilla.com/D178252
2023-06-21 19:02:23 +00:00
Jonathan Kew 695f595aef Bug 1839432 - Fix serialization of quoted family names for OffscreenCanvas font attribute. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D181535
2023-06-21 13:37:30 +00:00
Mike Hommey d8456fd716 Bug 1836230 - Update bindgen to 0.66.1. r=emilio,supply-chain-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D179656
2023-06-21 08:52:22 +00:00
Narcis Beleuzu 15227435c3 Backed out 3 changesets (bug 1833471) for wpt failure on page-rule-declarations-000.html . CLOSED TREE
Backed out changeset 547eef705668 (bug 1833471)
Backed out changeset e21e18f3f729 (bug 1833471)
Backed out changeset 16164bf63457 (bug 1833471)
2023-06-21 11:24:49 +03:00
Emilio Cobos Álvarez 3a086ed3a7 Bug 1838627 - Refactor InspectorUtils APIs that just forward to CSSStyleRule, and expose desugared selectors on them. r=nchevobbe,webidl,firefox-style-system-reviewers,smaug,devtools-reviewers,boris
Differential Revision: https://phabricator.services.mozilla.com/D181109
2023-06-21 07:14:57 +00:00
Emily McDonough 7025ca8885 Bug 1833471 Part 1 - Implement @page pseudo-class parsing and rule handling r=emilio
This currently will not match page-rules based on any selectors with any
pseudo-classes present.

Differential Revision: https://phabricator.services.mozilla.com/D178252
2023-06-21 02:13:01 +00:00
Markus Stange d118d24b6b Bug 1839081 - Inline eq_atom. r=emilio
In a profile of querySelectorAll with a class selector, I noticed a
non-inlined call to `eq_atom` from `style::gecko::snapshot_helpers::has_class_or_part`.

This was in a local build on arm64 macOS with `--enable-release` but without PGO.

Before: https://share.firefox.dev/3pduJ2j
After: https://share.firefox.dev/3Nhv0JH

Differential Revision: https://phabricator.services.mozilla.com/D181345
2023-06-19 21:44:16 +00:00
Emilio Cobos Álvarez caae6da5e7 Bug 1837818 - Remove special selector-matching case in matches_simple_selector. r=boris
This doesn't regress stylebench.

Depends on D180592

Differential Revision: https://phabricator.services.mozilla.com/D180593
2023-06-19 09:51:38 +00:00
Emilio Cobos Álvarez e92382018b Bug 1837818 - Minor selector matching tweaks. r=boris
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
2023-06-16 17:24:01 +00:00
Emilio Cobos Álvarez c27a7a2b3e Bug 1835068 - Parse relative selectors for nesting. r=dshin
Make parsing test not depend on under-specified serialization details,
see https://github.com/w3c/csswg-drafts/issues/8970.

Differential Revision: https://phabricator.services.mozilla.com/D181125
2023-06-16 15:29:59 +00:00
Emilio Cobos Álvarez 698a78bf91 Bug 1838670 - Match parent selector like :scope. r=zrhoffman
https://drafts.csswg.org/css-nesting-1/#nest-selector:

    When used in any other context, it represents the same elements as
    :scope in that context (unless otherwise defined).

Differential Revision: https://phabricator.services.mozilla.com/D181119
2023-06-16 15:22:31 +00:00
Jonathan Kew bc3b00d427 Bug 1838658 - patch 1 - Handle the 'small-caps' variant when OffscreenCanvas is parsing and serializing the 'font' attribute. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D181147
2023-06-16 08:40:39 +00:00
Zach Hoffman 630bf3eec6 Bug 1837351 - Skip positional pseudo-class matching during invalidation r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D180769
2023-06-16 03:33:18 +00:00
Boris Chiou 4b8c77479a Bug 1837305 - Part 6: Update AnimationValue for offset-path. r=emilio
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
2023-06-15 00:04:00 +00:00
Boris Chiou 0307742927 Bug 1837305 - Part 5: Add coord-box to offset-path property. r=devtools-reviewers,emilio
This patch makes sure the syntax of `offset-path` is:
  `offset-path: none | <offset-path> || <coord-box>`.

Differential Revision: https://phabricator.services.mozilla.com/D179628
2023-06-15 00:03:59 +00:00
Boris Chiou 38cbd14258 Bug 1837305 - Part 4: Update OffsetPath to use BasicShape in style system. r=devtools-reviewers,emilio
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
2023-06-15 00:03:59 +00:00
Boris Chiou 0620a0a751 Bug 1837305 - Part 3: Use PositionOrAuto for "at <position>" in circle and ellipse. r=emilio
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
2023-06-15 00:03:59 +00:00
Boris Chiou b9b5dc541e Bug 1837305 - Part 2: Add ShapeType for BasicShape parser. r=emilio
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
2023-06-15 00:03:59 +00:00
Boris Chiou 8e1a7c8124 Bug 1837305 - Part 1: Rework GenericBasicShape. r=devtools-reviewers,emilio
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
2023-06-15 00:03:59 +00:00
Emilio Cobos Álvarez 66b8b0e218 Bug 1837762 - Add a query-selector fast path for attribute selectors in the rightmost compound. r=boris
Differential Revision: https://phabricator.services.mozilla.com/D180553
2023-06-14 21:43:29 +00:00
Emilio Cobos Álvarez 5113cc40e0 Bug 1837734 - Speed up / specialize attribute selector-matching. r=boris
Inline the attribute lookup code, and only branch on the attribute selector
type if we have found an attribute.

Differential Revision: https://phabricator.services.mozilla.com/D180531
2023-06-14 21:08:22 +00:00
Emilio Cobos Álvarez 8bf8754b43 Bug 1837734 - Remove unused TElement::has_attr. r=boris
Differential Revision: https://phabricator.services.mozilla.com/D180530
2023-06-14 21:08:22 +00:00
Emilio Cobos Álvarez 2cb3884430 Bug 1837734 - Remove the never_matches field from attr selectors. r=boris
It's an extra branch which in practice we almost never take, plus extra
checks during parsing.

Differential Revision: https://phabricator.services.mozilla.com/D180529
2023-06-14 21:08:22 +00:00
Emilio Cobos Álvarez c1cb078eee Bug 1837734 - Add a way to optimize the "attribute in no namespace exists" check. r=boris
Go through the slow path by default. No behavior change.

Differential Revision: https://phabricator.services.mozilla.com/D180528
2023-06-14 21:08:21 +00:00
Emilio Cobos Álvarez f6d857bdb5 Bug 1837734 - Don't recompute quirks mode -> case sensitivity over and over. r=boris
The only reason we pass the quirks mode around is to compute the case
sensitivity, but we can just pass the later.

Differential Revision: https://phabricator.services.mozilla.com/D180527
2023-06-14 21:08:21 +00:00
Emilio Cobos Álvarez dbe7784f1b Bug 1838404 - Fix style invalidation on layer rule insertion. r=dholbert
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
2023-06-14 20:50:16 +00:00
Emilio Cobos Álvarez 8c3ee86d6d Bug 1835062 - Make CSSStyleRule a GroupRule. r=smaug,dshin
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
2023-06-14 09:36:22 +00:00
Stanca Serban 69dbeee335 Backed out changeset 4c6c30b03e25 (bug 1835062) for causing multiple failures in browser_parsable_css.js. CLOSED TREE 2023-06-14 04:55:44 +03:00
Emilio Cobos Álvarez 36eff8b4d7 Bug 1835062 - Make CSSStyleRule a GroupRule. r=smaug,dshin
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
2023-06-14 00:18:40 +00:00
Emilio Cobos Álvarez 38cbc55c27 Bug 1835179 - Container units should prevent us from sharing style by rule node. r=dshin
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
2023-06-13 22:58:49 +00:00
Emilio Cobos Álvarez 5cfe60ce40 Bug 1836755 - Improve behavior of :host in InspectorUtils.selectorMatchesElement. r=jdescottes,layout-reviewers,dshin
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
2023-06-13 22:43:09 +00:00
Ting-Yu Lin beef887207 Bug 1577358 - Remove obsolete comment to add use counter for developing CSS properties. r=emilio DONTBUILD
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
2023-06-13 17:08:13 +00:00
David Shin 42c39f4b16 Bug 1835037: Move `ANCHORS_RELATIVE_SELECTOR` out of nsINode flags. r=emilio
Move the flag to ComputedValueFlags, like `CONSIDERED_RELATIVE_SELECTOR`.

Differential Revision: https://phabricator.services.mozilla.com/D180726
2023-06-13 13:21:42 +00:00
Emilio Cobos Álvarez 783ae49252 Bug 1837962 - Clean up Context::for_non_inherited_property. r=layout-reviewers,AlaskanEmily
We don't ever check the particular property, so it can just be a
boolean.

Differential Revision: https://phabricator.services.mozilla.com/D180680
2023-06-12 19:42:23 +00:00
Emilio Cobos Álvarez af7d5e8b3b Bug 1837692 - Fix rebase conflict with bug 1837664.
MANUAL PUSH: Trivial build fix CLOSED TREE.
2023-06-12 18:45:19 +02:00
Emilio Cobos Álvarez e12833a476 Bug 1837692 - Do not snap -webkit-text-stroke-width to dev pixels. r=jfkthame
Introduce LineWidth (which doesn't snap) and let BorderSideWidth
wrap it and actually do the snapping.

Differential Revision: https://phabricator.services.mozilla.com/D180688
2023-06-12 14:57:53 +00:00
Emilio Cobos Álvarez 1d2f69fc15 Bug 1837664 - Improve border-image shorthand serialization, and annotate more passes. CLOSED TREE 2023-06-12 12:09:58 -04:00
Emilio Cobos Álvarez 1806936bd6 Bug 1835407 - Don't allow to share style by rule node for links. r=dholbert
(Regardless of visitedness)

Differential Revision: https://phabricator.services.mozilla.com/D180353
2023-06-12 10:21:15 +00:00
Emilio Cobos Álvarez 9331a654a0 Bug 1837664 - Improve border shorthand serialization. r=boris,devtools-reviewers
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
2023-06-12 10:20:46 +00:00
Emilio Cobos Álvarez 28c6afd3ce Bug 1837664 - Minor clean-ups to border shorthand parsing. r=boris
This doesn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D180465
2023-06-10 23:23:35 +00:00
Emilio Cobos Álvarez 77f1717931 Bug 1836848 - Avoid selecting zero-resolution images in image-set. r=dholbert
Fairly straight-forward. This fixes the two tests mentioned in comment 0
which aren't still in the repo.

Differential Revision: https://phabricator.services.mozilla.com/D180414
2023-06-09 17:42:08 +00:00
Emilio Cobos Álvarez bbac0f99e8 Bug 1837638 - Merge CSSStyleRule and BindingStyleRule. r=dholbert
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
2023-06-09 17:16:34 +00:00
Andrew Osmond b45d20e3ac Bug 1792758 - Part 1. Add method to parse CSS filters without context for workers. r=emilio
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
2023-06-09 13:38:40 +00:00
CanadaHonk 85d2f0234e Bug 1834164 - Serialize NaN and infinity numbers r=emilio
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
2023-06-08 21:22:19 +00:00
Emilio Cobos Álvarez 7d40adb9a1 Bug 1836564 - Forbid negative CSS resolutions at parse time. r=dholbert
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
2023-06-08 16:57:31 +00:00
Ting-Yu Lin 463b02aca1 Bug 1837292 - Make flex-flow serialization interoperable. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D180270
2023-06-08 16:37:21 +00:00
Emilio Cobos Álvarez 20cac1714b Bug 1837273 - Remove viewport rule code. r=Oriol
Turns out Servo doesn't need this either, see
https://github.com/servo/servo/pull/29850.

Differential Revision: https://phabricator.services.mozilla.com/D180264
2023-06-08 11:20:53 +00:00
Emilio Cobos Álvarez fb308bcf11 Bug 1835923 - Unify parallel and sequential traversal scheduling. r=smaug
Use in_place_scope_fifo to spawn work into the thread pool while doing
work in the main thread.

Differential Revision: https://phabricator.services.mozilla.com/D179492
2023-06-08 08:29:55 +00:00