| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Remove packages that were moved to external repo
* Add workspace dependencies pointing to 2023-06-14 branch
* Fix servo-tidy.toml errors
* Update commit to include #31346
* Update commit to include servo/stylo#2
* Move css-properties.json lookup to target/doc/stylo
* Remove dependency on vendored mako in favour of pypi dependency
This also removes etc/ci/generate_workflow.py, which has been unused
since at least 9e71bd6a7010d6e5723831696ae0ebe26b47682f.
* Add temporary code to debug Windows test failures
* Fix failures on Windows due to custom target dir
* Update commit to include servo/stylo#3
* Fix license in tests/unit/style/build.rs
* Document how to build with local Stylo in Cargo.toml
|
|
|
|
|
| |
* Revert remaining changes from Stylo split-into-commits branch
* Do the minimum amount of formatting to appease mach test-tidy
|
|
|
|
|
|
|
|
|
|
| |
This is part of the preparation for splitting stylo into a separate
crate. We have made various changes to selectors includings:
1. Bumping the rust edition
2. Fixing typos and updating links
In addition to reverting those changes, this PR pulls in some changes to
selectors we seem to have missed in the process of updates.
|
|
|
|
|
| |
This is part of getting Servo using an version of style closer to
upstream. This change reverts some changes we made to `to_shmem` and
`to_shmem_derive` in order to reduce our diff with upstream stylo.
|
| |
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
Go through the slow path by default. No behavior change.
Differential Revision: https://phabricator.services.mozilla.com/D180528
|
|
|
|
|
|
| |
Move the flag to ComputedValueFlags, like `CONSIDERED_RELATIVE_SELECTOR`.
Differential Revision: https://phabricator.services.mozilla.com/D180726
|
|
|
|
|
|
|
|
| |
$ find servo -name '*.rs' | xargs rustup run nightly rustfmt
Depends on D179380
Differential Revision: https://phabricator.services.mozilla.com/D179381
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`:has()` in selector matching
For any element that anchors a `:has()` selector (i.e. Matches a selector that
contains a `:has()` on its rightmost side), we prevent style sharing altogether,
as evaluation of the `:has()` selector is required in the first place to
determine style sharing.
On the other hand, any element matching a rule containing `:has()` without
anchoring it can do style sharing for siblings, but not cousins.
Differential Revision: https://phabricator.services.mozilla.com/D176836
|
|
|
|
|
|
|
|
| |
If this happens again, it might be worth not matching rather than
potentially crashing. Though I guess crashing is a very good way getting
it reported soon...
Differential Revision: https://phabricator.services.mozilla.com/D178921
|
|
|
|
|
|
| |
selectors
Differential Revision: https://phabricator.services.mozilla.com/D178920
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
declarations
Plumb everything up. This factors out declaration and rule parsing so
we share the code with the regular declaration parser.
This could be made a bit nicer in the future. We need to decide what to
do for @page and @keyframe (it seems conditional rules inside ought to
work, but that's not so easy because per spec we create a nested style
rule).
But this is a first pass that passes a good chunk of the tests. There
are other fixups to cssom, and I think some of the tests we fail are
actually wrong...
Differential Revision: https://phabricator.services.mozilla.com/D178266
|
|
|
|
|
|
|
|
| |
Unlike the `ParseRelative` flag, which turns on relative selector parsing for
that parsing level only, the newly added `DISALLOW_RELATIVE_SELECTOR` flag
propagates through nested parsing calls.
Differential Revision: https://phabricator.services.mozilla.com/D176807
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
More nesting plumbing. Still does nothing because we don't parse the
nested rules.
Should be trivial to prove this patch doesn't change any behavior so
far, but I want to land it on its own because it can have performance
implications.
This follows the pattern of what we do with other rules like layers and
container conditions, that is, keep the ancestor selectors in a stack,
and poke at the last one in order to replace the ancestor.
This changes the behavior of replace_parent_selector as with the newer
version of the spec, stuff like:
div {
.foo {
stuff
}
}
Should work as `div .foo`. A test is added for this case.
Differential Revision: https://phabricator.services.mozilla.com/D176560
|
|
|
|
| |
Differential Revision: https://phabricator.services.mozilla.com/D175028
|
|
|
|
|
|
| |
Trivial, comment-only
Differential Revision: https://phabricator.services.mozilla.com/D174474
|
|
|
|
| |
Differential Revision: https://phabricator.services.mozilla.com/D172019
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
:nth-child(... of <selector list>)
There are separate filters for IDs, classes, attribute local names, and
element state.
Also, we invalidate siblings of elements matched against the selector
list of :nth-child(... of <selector list>) by marking matched elements
with NODE_HAS_SLOW_SELECTOR_NTH_OF.
The only remaining invalidation case invalidation case is
`:nth-child(An+B of :has())` (bug 1818155), which should not block
shipping `layout.css.nth-child-of.enabled`, because :has(...) is still
being implemented (bug 418039).
Depends on D172352
Differential Revision: https://phabricator.services.mozilla.com/D171936
|
|
|
|
|
|
|
|
|
|
|
|
| |
Because restyle events cannot be posted for non-element nodes like the
shadow root, a child's siblings are restyled directly if its parent has
NODE_HAS_SLOW_SELECTOR or NODE_HAS_SLOW_SELECTOR_LATER_SIBLINGS but that
parent is the shadow root.
Drive-by, but braces were also added to some single-line "if" statements
in RestyleManager.
Differential Revision: https://phabricator.services.mozilla.com/D172352
|
| |
|
|
|
|
| |
Differential Revision: https://phabricator.services.mozilla.com/D171358
|
|
|
|
|
|
|
|
|
|
|
|
| |
Added WebIDL interfaces as per spec, added some necessary changes to support maplike and setlike structures to be accessed from C++.
Added `::highlight(foo)` pseudo element to CSS engine.
Implemented Highlight as new kind of `Selection` using `HighlightType::eHighlight`. This implies Selections being added/removed during runtime (one `Selection` object per highlight identifier), therefore a dynamic container for highlight `Selection` objects was added to `nsFrameSelection`. Also, the painting code queries the highlight style for highlight Selections.
Implementation is currently hidden behind a pref `dom.customHighlightAPI.enabled`.
Differential Revision: https://phabricator.services.mozilla.com/D164203
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This parses the ampersand as a parent selector behind an
(off-by-default) selectors feature.
The plan is to call replace_parent_selector while we're doing the
CascadeData rebuilds, which is where we can have all the ancestor
nesting information.
No behavior change.
Differential Revision: https://phabricator.services.mozilla.com/D167237
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Use new changes from cssparser and use the new lab/lch/oklab/oklch color
formats.
Introduced a new color type AbsoluteColor. It represents any kind of
color that has absolute numerical values. It is also tied to a color
space and therefore can be trivially converted to another color space.
Differential Revision: https://phabricator.services.mozilla.com/D163579
|
|
|
|
|
|
| |
It can be reused for the Is, Where, and Negation components.
Differential Revision: https://phabricator.services.mozilla.com/D166267
|
|
|
|
|
|
|
|
|
| |
This patch fixes a bug introduced by bug 1808228/D166266, where, if an
element does not initially match :nth-child(An+B of selector list) or
:nth-last-child(An+B of selector list), changing a sibling or ancestor
will not invalidate that element.
Differential Revision: https://phabricator.services.mozilla.com/D166982
|
|
|
|
|
|
|
|
|
|
|
|
| |
:nth-last-child(An+B of selector list)
Since we have been using a single hash map to cache all :nth-child
indices (with no selector list), each different selector will need its
own cache.
As a side note, this patch does not address invalidation.
Differential Revision: https://phabricator.services.mozilla.com/D166266
|
|
|
|
|
|
|
| |
Drive-by, but selector_list_specificity() was also renamed to
max_selector_list_specificity().
Differential Revision: https://phabricator.services.mozilla.com/D166263
|
|
|
|
|
|
|
|
|
| |
list) and :nth-last-child(An+B of selector list)
:nth-{,last-}child parsing is disabled by default for now by pref
layout.css.nth-child-of.enabled.
Differential Revision: https://phabricator.services.mozilla.com/D165895
|
|
|
|
|
|
|
|
| |
This makes the matching / parsing more self-contained, and I believe
it's generally easier to follow. Also addresses review comments from the
previous patch.
Differential Revision: https://phabricator.services.mozilla.com/D165861
|
|
|
|
|
|
|
|
|
|
|
|
| |
and OnlyOfType as functionless Nth variants
Like bug 1808226, this doesn't change any behavior, it just simplifies matching.
I also added a WPT JavaScript test for :only-of-type, since dedicated WPT
JavScript tests already exist for the other pseudo-classes this patch
touches.
Differential Revision: https://phabricator.services.mozilla.com/D165859
|
|
|
|
|
|
|
|
|
|
|
| |
To accomplish this, all :nth- Components were replaced with type Nth,
which uses NthSelectorData.
Using NthSelectorData will make it easier to add selector lists for :nth
selectors later on, but this change by itself shouldn't change any
behavior.
Differential Revision: https://phabricator.services.mozilla.com/D165831
|
|
|
|
|
|
| |
This makes me a bit happier about the previous patch :)
Differential Revision: https://phabricator.services.mozilla.com/D165236
|
|
|
|
|
|
|
|
|
| |
This makes relatively simple changes so that we check lowercase-ness of
local-name selectors first. If so, we don't need to check whether we're
an HTML element in an HTML document, which requires a fair bit of
pointer-chasing.
Differential Revision: https://phabricator.services.mozilla.com/D163627
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The directories changed:
* servo/components/selectors/
* servo/components/style/
* servo/components/style_derive/
* servo/ports/geckolib/
Per review request, disable rustfmt in `components_to_transform_3d_matrix()` to
preserve the format for a call to `Transform3D::new`.
My mozilla-central is at
https://hg.mozilla.org/mozilla-central/rev/d1ae84015c22f2034435b47194fdced878072035
My nightly rust is 1.66.0-nightly (8b705839c 2022-09-26).
Differential Revision: https://phabricator.services.mozilla.com/D158234
|
|
|
|
|
|
| |
As per spec, see https://github.com/w3c/csswg-drafts/issues/7280
Differential Revision: https://phabricator.services.mozilla.com/D156468
|
|
|
|
|
|
|
|
| |
Parsing is behind a config value `layout.css.has-selectors.enabled`. This
change does not support p:has(> a) combinators, but will handle them
gracefully, just not matching on them.
Differential Revision: https://phabricator.services.mozilla.com/D149515
|
|
|
|
|
|
|
| |
Limit its features to those we actually use, which turns out is none for
webrender_api.
Differential Revision: https://phabricator.services.mozilla.com/D148734
|
|
|
|
|
|
|
|
|
| |
This shrinks the function by avoiding generating rather noisy panic
code.
Depends on D145486
Differential Revision: https://phabricator.services.mozilla.com/D145487
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This doesn't make a difference, I was hoping it would allow us to remove the
special-casey code we have here:
https://searchfox.org/mozilla-central/rev/997a56b018662e2940c99bbaf57a6ac9d1aa5422/servo/components/selectors/matching.rs#610-632
But it doesn't. Still I think it doesn't hurt tho, shouldn't change behavior.
Depends on D145485
Differential Revision: https://phabricator.services.mozilla.com/D145486
|
|
|
|
|
|
|
|
|
|
|
|
| |
Note that element.clone() is just copying a couple pointers.
Have a single place where we compute the next element and check for linky-ness.
This saves a couple checks (very very minor win in the micro-benchmark I've
been looking at, but consistent).
Depends on D145484
Differential Revision: https://phabricator.services.mozilla.com/D145485
|
|
|
|
|
|
|
|
|
| |
This makes the inner function much smaller which improves selector-matching
performance very mildly for the benchmarks I've been looking at. Also, this
should help selector matching on quirks mode by only doing this when we
actually find :hover / :active pseudo-classes.
Differential Revision: https://phabricator.services.mozilla.com/D145484
|
|
|
|
|
|
| |
non-lexical
Differential Revision: https://phabricator.services.mozilla.com/D123622
|
|
|
|
|
|
|
|
|
|
|
| |
* remove extern crate
* Update components/script_plugins/lib.rs
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
---------
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
|
|
|
|
|
|
|
| |
* Add taplo fmt config for toml fmt
* fmt toml files
* Add even-better-toml to extensions recommendations
|
| |
|