| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This should help out quite a bit with uBO, which has lots of very
general attribute selectors. We invalidate per attribute name rather
than using a SelectorMap, which prevents matching for attribute
selectors that can't have changed.
The idea is that this should be generally cheaper, though there are
cases where this would be a slight pesimization. For example, if there's
an attribute selector like:
my-specific-element[my-attribute] { /* ... */ }
And you change `my-attribute` in an element that isn't a
`my-specific-element`, before that the SelectorMap would've prevented us
from selector-matching completely. Now we'd still run selector-matching
for that (though the matching would be pretty cheap).
However I think this should speed up things generally, let's see what
the perf tests think before landing this though.
Differential Revision: https://phabricator.services.mozilla.com/D76825
|
|
|
|
|
|
|
|
|
|
|
| |
invalidation code.
After bug 1632647, we can have pseudo-classes inside :not / :is /
:where, which the invalidation and matching code weren't handling.
Add a few tests for this stuff working as expected.
Differential Revision: https://phabricator.services.mozilla.com/D76160
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
:where() and :is() with the outer visitor.
See the comment about why this is valuable. For a selector like:
.foo:is(.bar) > .baz
Before this patch we'd generate an Dependency for .bar like this:
Dependency {
selector: .bar,
offset: 0,
parent: Some(Dependency {
selector: .foo:is(.bar) > .baz,
offset: 1, // Pointing to the `>` combinator.
parent: None,
}),
}
After this patch we'd generate just:
Dependency {
selector: .foo:is(.bar) > .baz,
offset: 1, // Pointing to the `>` combinator.
parent: None,
}
This is not only less memory but also less work. The reason for that is that,
before this patch, when .bar changes, we'd look the dependency, and see there's
a parent, and then scan that, so we'd match `.bar` two times, one for the
initial dependency, and one for .foo:is(.bar).
Instead, with this we'd only check `.foo:is(.bar)` once.
Differential Revision: https://phabricator.services.mozilla.com/D71423
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
That way we can look at the parent dependency as described in the previous
patch. An alternative would be to add a:
parent_dependency: Option<&'a Dependency>
on construction to `Invalidation`, but this way seems slightly better to avoid
growing the struct. It's not even one more indirection because the selector is
contained directly in the Dependency struct.
Differential Revision: https://phabricator.services.mozilla.com/D71422
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The tricky part of :is() and :where() is that they can have combinators inside,
so something like this is valid:
foo:is(#bar > .baz) ~ taz
The current invalidation logic is based on the assumption that you can
represent a combinator as a (selector, offset) tuple, which are stored in the
Dependency struct. This assumption breaks with :is() and :where(), so we need
to make them be able to represent a combinator in an "inner" selector.
For this purpose, we add a `parent` dependency. With it, when invalidating
inside the `:is()` we can represent combinators inside as a stack.
The basic idea is that, for the example above, when an id of "bar" is added or
removed, we'd find a dependency like:
Dependency {
selector: #bar > .baz,
offset: 1, // pointing to the `>` combinator
parent: Some(Dependency {
selector: foo:is(#bar > .baz) > taz,
offset: 1, // Pointing to the `~` combinator.
parent: None,
})
}
That way, we'd start matching at the element that changed, towards the right,
and if we find an element that matches .baz, instead of invalidating that
element, we'd look at the parent dependency, then double-check that the whole
left-hand-side of the selector (foo:is(#bar > .baz)) actually changed, and then
keep invalidating to the right using the parent dependency as usual.
This patch only builds the data structure and keeps the code compiling, the
actual invalidation work will come in a following patch.
Differential Revision: https://phabricator.services.mozilla.com/D71421
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This implements the easy / straight-forward parts of the :where / :is
selectors.
The biggest missing piece is to handle properly invalidation when there
are combinators present inside the :where. That's the hard part of this,
actually.
But this is probably worth landing in the interim. This fixes some of
the visitors that were easy to fix.
Differential Revision: https://phabricator.services.mozilla.com/D70788
|
|
|
|
|
|
|
| |
Other browsers allow this and the spec doesn't really disallow it, so fix it,
add a test and carry on.
Differential Revision: https://phabricator.services.mozilla.com/D65107
|
|
|
|
| |
This lets us experiment with how we store this data on the DOM side.
|
| |
|
|
|
|
| |
Differential Revision: https://phabricator.services.mozilla.com/D56044
|
|
|
|
| |
Differential Revision: https://phabricator.services.mozilla.com/D55862
|
| |
|
|
|
|
| |
Differential Revision: https://phabricator.services.mozilla.com/D54010
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some of the stuff, in particular inside GeckoBindings stuff should be
refactored to be less ugly and duplicate a bit less code, but the rest of the
code should be landable as is.
Some invalidation changes are already needed because we weren't matching with
the right shadow host during invalidation (which made existing ::part() tests
fail).
Pending invalidation work:
* Making exportparts work right on the snapshots.
* Invalidating parts from descendant hosts.
They're not very hard but I need to think how to best implement it:
* Maybe get rid of ShadowRoot::mParts and just walk DOM descendants in the
Shadow DOM.
* Maybe implement a ElementHasExportPartsAttr much like HasPartAttr and use
that to keep the list of elements.
* Maybe invalidate :host and ::part() together in here[1]
* Maybe something else.
Opinions?
[1]: https://searchfox.org/mozilla-central/rev/131338e5017bc0283d86fb73844407b9a2155c98/servo/components/style/invalidation/element/invalidator.rs#561
Differential Revision: https://phabricator.services.mozilla.com/D53730
|
|
|
|
|
|
|
|
| |
And do a full restyle only when the state goes from visited to unvisited or vice
versa. That is, use regular invalidation for addition or removals of href
attributes, for example.
Differential Revision: https://phabricator.services.mozilla.com/D50821
|
|
|
|
| |
Differential Revision: https://phabricator.services.mozilla.com/D50810
|
|
|
|
| |
Differential Revision: https://phabricator.services.mozilla.com/D50554
|
|
|
|
|
|
|
| |
If the sets get too big we cannot allocate anything else, we'll just empty them
and invalidate the whole document.
Differential Revision: https://phabricator.services.mozilla.com/D46828
|
|
|
|
| |
Differential Revision: https://phabricator.services.mozilla.com/D43992
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch invalidates the style for `::selection`, which will restore the
behavior before the regression.
However, it's still not quite correct, because repaint is not triggered. Given
that `::selection` requires some major change to implement
https://github.com/w3c/csswg-drafts/issues/2474, we can address this problem
later.
Differential Revision: https://phabricator.services.mozilla.com/D35305
|
|
|
|
|
|
|
|
| |
Still does nothing, since we still do not collect part rules, but this is all
the plumbing that should allow us to invalidate parts when attributes or state
change on their ancestors.
Differential Revision: https://phabricator.services.mozilla.com/D32642
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Remove unused code (4/4)
<!-- Please describe your changes on the following line: -->
Fourth and final PR in a series of PRs to remove unused/dead code from servo, powered by an (upcoming) tool of mine. Please take a look and tell me if you want to keep something.
* First PR: #23477
* Second PR: #23498
* Third PR: #23499
Shortstat of the combined PR series:
```
47 files changed, 7 insertions(+), 805 deletions(-)
```
---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because they only remove dead code
<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->
<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23532)
<!-- Reviewable:end -->
|
| | |
|
| |
| |
| |
| |
| | |
Closes #22972
Closes #23463
|
|/
|
|
|
|
|
|
|
|
|
| |
correctly when there's no selector before it, and add tests.
D29542 fixed the bogus checks that was making nested pseudo-elements match
author rules. This adds tests and ends up being just a cleanup, though as it
turns out we it also fixes an issue with ::slotted() matched from
Element.matches.
Differential Revision: https://phabricator.services.mozilla.com/D27529
|
|
|
|
|
|
|
|
|
|
| |
Also fairly straight-forward. This may get more complicated when we do part
forwarding, if any.
I've opened https://github.com/w3c/csswg-drafts/issues/3841 in what I think
would be a cleaner model for forwarding.
Differential Revision: https://phabricator.services.mozilla.com/D28063
|
|
|
|
|
|
| |
Disabled for now of course. This should be pretty uncontroversial I'd think.
Differential Revision: https://phabricator.services.mozilla.com/D28060
|
|
|
|
|
|
| |
So much unsound code going away :-)
Differential Revision: https://phabricator.services.mozilla.com/D28380
|
|
|
|
|
|
| |
as a result of a style change.
Differential Revision: https://phabricator.services.mozilla.com/D24888
|
|
|
|
|
|
|
| |
:-moz-list-bullet/number to that in the parser.
Bug: 205202
Reviewed-by: emilio
|
|
|
|
| |
Differential Revision: https://phabricator.services.mozilla.com/D22828
|
|
|
|
| |
Differential Revision: https://phabricator.services.mozilla.com/D16147
|
| |
|
|
|
|
|
|
| |
This brings us alignas support and also associated constants for bitfield enums.
Differential Revision: https://phabricator.services.mozilla.com/D15334
|
| |
|
|
|
|
|
|
| |
The patch and test should be pretty much self-descriptive.
Differential Revision: https://phabricator.services.mozilla.com/D14063
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Other changes should really be (and are) indistinguishable.
Differential Revision: https://phabricator.services.mozilla.com/D4847
|
|
|
|
| |
Differential Revision: https://phabricator.services.mozilla.com/D4730
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We match with AllLinksVisitedAndUnvisited for style invalidation, and we already
do a subtree restyle because :visited matching doesn't depend on the actual
element state.
So all this stuff is just not needed. The comment points to the attribute tests
in bug 1328509, but those still trivially pass with this change.
I think this was unneeded since I introduced AllLinksVisitedAndUnvisited, or
maybe since https://github.com/servo/servo/pull/19520. In any case it doesn't
really matter, and I already had done this cleanup in my WIP patches for
bug 1406622, but I guess this is a slightly more suitable place to land them :)
Differential Revision: https://phabricator.services.mozilla.com/D3305
|
|
|
|
|
|
|
|
| |
We force a repaint from ContentStateChangedInternal if visited links are
disabled, and that's observable. Let's cut it off as early as we can to avoid
timing attacks even when :visited is disabled.
Differential Revision: https://phabricator.services.mozilla.com/D3304
|
|
|
|
|
|
|
|
|
| |
It used to be this way because of lifetime issues (plus the shadow
datas were in RwLocks at some point IIRC). Now we guarantee that as long as the
element is away the cascade data is as well, so we don't need to thread it
around.
Differential Revision: https://phabricator.services.mozilla.com/D2768
|
|
|
|
| |
Differential Revision: https://phabricator.services.mozilla.com/D2767
|
|
|
|
|
|
|
|
| |
And general Element logging. We now print all the attributes for comparison.
If this turns out to be too verbose we can change it to diff them or something.
Differential Revision: https://phabricator.services.mozilla.com/D2471
|