| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
| |
The specifics of how this is going to work are still getting spec'd /
discussed in https://github.com/w3c/csswg-drafts/issues/6576, but this
allows DevTools to work fine and the feature to be complete enough for
Nightly experimentation (with the other in-flight patches).
Otherwise devtools crashes when trying to inspect pages that use them.
Differential Revision: https://phabricator.services.mozilla.com/D124656
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This makes layer order use a fixed set of bits per nesting level, to "reserve"
bits for children before they are registered.
See the comment in LayerOrder for the implementation limits it imposes, and
potential alternatives if these limits are not enough (but I think they should
be).
Enable the tests, as they mostly pass now (commit incoming to fix the remaining
ones).
Differential Revision: https://phabricator.services.mozilla.com/D124620
|
| |
|
|
|
|
|
|
|
|
|
| |
This works modulo the existing nested layer order bug. Will be covered
by WPT /css/css-cascade/layer-import.html once the feature is enabled (I
can probably enable it right away for those tests, but I'd rather fix
the obvious bugs first).
Differential Revision: https://phabricator.services.mozilla.com/D124538
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For that, deal with children in add_rule recursively, to keep the
current layer name up-to-date in block layer rules.
This is not the final version of this code, as right now something like
this:
@layer A {
...
}
@layer B {
...
}
@layer A.A {
...
}
Would give A.A more priority over B, which is not correct. There are
tests for this incoming in wpt sync and such, but that can be tweaked
later.
Differential Revision: https://phabricator.services.mozilla.com/D124335
|
|
|
|
|
|
| |
These have been enabled by default for quite a while.
Differential Revision: https://phabricator.services.mozilla.com/D175513
|
|
|
|
|
|
|
|
|
|
| |
Disabled, and of course doing nothing for now still, but this is another
piece that is useful to get reviewed separately.
Don't allow layers to be interleaved with @import / @namespace rules as
per https://github.com/w3c/csswg-drafts/issues/6522.
Differential Revision: https://phabricator.services.mozilla.com/D124229
|
|
|
|
|
|
|
| |
This needs https://github.com/servo/rust-cssparser/pull/287 and a
cssparser update.
Differential Revision: https://phabricator.services.mozilla.com/D124216
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Not hooked anywhere yet, so this doesn't change behavior, but adds the
basic data model etc.
Adding parsing support requires some changes to cssparser to allow the
same at rule to be block and statement-like at the same time, so better
done separately.
Differential Revision: https://phabricator.services.mozilla.com/D124079
|
|
|
|
|
|
|
| |
Instead, fix up the various content data structures when the stylesheet
is mutated. This makes reading a stylesheet not disable style sharing.
Differential Revision: https://phabricator.services.mozilla.com/D115203
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
StylesheetContents
This prevents incorrectly reusing cached results when the contents go
away and new contents are allocated with the same address.
Note that these keep alive transitively everything else under them, so
all other medialist keys don't need this.
By making this a proper hashmap it should also improve cache lookup
times if the cache grows too big.
Differential Revision: https://phabricator.services.mozilla.com/D115202
|
|
|
|
|
|
| |
(which would never match by definition).
Differential Revision: https://phabricator.services.mozilla.com/D111610
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This should be both a memory and speed win for pages using a lot of
Shadow DOM.
In order to make the cache properly work we need to start keying media query
results on the actual StyleSheetContents, as that's what we share on Gecko, but
that should all be fine.
Differential Revision: https://phabricator.services.mozilla.com/D107266
|
|
|
|
|
|
|
|
| |
This is a backport of https://phabricator.services.mozilla.com/D157589,
by Emilio Cobos Álvarez, plus some additions so that Servo compiles,
and some parts from https://phabricator.services.mozilla.com/D144455.
Should have no change in behavior.
|
|
|
|
| |
Signed-off-by: Lewin Probst <info@emirror.de>
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
plaintext documents.
We add two @-moz-document functions: `plain-text-document()`, matching the
obvious, and `unobservable-document()`, which matches a top-level document with
no opener. This is the equivalent check we do for automatic darkening of
`about:blank` here:
https://searchfox.org/mozilla-central/rev/014fe72eaba26dcf6082fb9bbaf208f97a38594e/layout/base/PresShell.cpp#5282
The former we don't need to use, but it's nice to let user stylesheets target
plaintext documents properly (rather than relying on extensions or what not).
Note that these are not content-observable.
Add two tests: One showing that we produce different rendering when on dark
mode, and one showing that we produce the same one from an iframe, regardless
of dark mode.
Depends on D101517
Differential Revision: https://phabricator.services.mozilla.com/D101518
|
|
|
|
|
|
| |
We'll use it to use @-moz-document from plaintext.css.
Differential Revision: https://phabricator.services.mozilla.com/D101516
|
|
|
|
| |
Differential Revision: https://phabricator.services.mozilla.com/D98710
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The changes should be trivial.
The third_party changes are up for review in
https://github.com/servo/rust-cssparser/pull/277 (and of course I'll
land with a bump to 0.28 rather than the override after that gets r+'d).
The basic idea is that with this we have the actual start offset of the
rule, so we wouldn't include html comments or other invalid stuff we
discard during sanitization in bug 1680084. But that's a separate
change.
Differential Revision: https://phabricator.services.mozilla.com/D98677
|
|
|
|
|
|
| |
@viewport rules
Differential Revision: https://phabricator.services.mozilla.com/D97817
|
|
|
|
|
|
|
|
|
| |
iterator.
So that skip_children(), which just pops the stack and is used by the
dynamic media query evaluation code, works as it should.
Differential Revision: https://phabricator.services.mozilla.com/D92717
|
|
|
|
| |
Differential Revision: https://phabricator.services.mozilla.com/D90729
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Also, for changes in CSS declarations, like changing
cssRules[i].style.color or something, we end up avoiding a lot of the
work we were doing.
This page still trips us in the sense that they add a stylesheet, then
call getBoundingClientRect(), then insert more rules in the stylesheet,
which causes us to rebuild a lot of the cascade data.
We could try to detect appends to the last stylesheet on the list or
something I guess, and avoid rebuilding the cascade data in some cases.
Depends on D85615
Differential Revision: https://phabricator.services.mozilla.com/D85616
|
|
|
|
|
|
|
|
|
|
|
|
| |
This does not (yet) upgrade ./rust-toolchain
The warnings:
* dead_code "field is never read"
* redundant_semicolons "unnecessary trailing semicolon"
* non_fmt_panic "panic message is not a string literal, this is no longer accepted in Rust 2021"
* unstable_name_collisions "a method with this name may be added to the standard library in the future"
* legacy_derive_helpers "derive helper attribute is used before it is introduced" https://github.com/rust-lang/rust/issues/79202
|
|
|
|
|
|
|
|
|
| |
Fully automated via:
$ rg -l '\.try\(' | xargs sed -i 's/\.try(/.try_parse(/g'
$ cd servo/components/style && cargo +nightly fmt
Differential Revision: https://phabricator.services.mozilla.com/D80099
|
|
|
|
|
|
|
|
|
| |
everywhere.
It doesn't seem like realistically we're going to be able to get rid of
this any time soon.
Differential Revision: https://phabricator.services.mozilla.com/D76809
|
|
|
|
|
|
|
|
|
|
|
|
| |
We still panic in a debug build, so that developers can notice when they
need to add a new static atom after modifying UA sheets.
We also add telemetry to note when this happens, add an app note to a
crash report, in case any crash later on occurs, and re-up the existing,
expired shared memory sheet telemetry probes so we can look at them
again.
Differential Revision: https://phabricator.services.mozilla.com/D73188
|
| |
|
|
|
|
|
|
|
|
| |
- Add new CSS Error
- Add new test case for error
- Ensure that test cases use `replace()` and `replaceSync()`
Differential Revision: https://phabricator.services.mozilla.com/D69423
|
|
|
|
|
|
|
|
|
|
| |
- Add enum AllowImportRules to CSS parsing.
- `replaceSync()` will skip over @import rules and continue parsing.
- `replace()` will skip over @import rules and continue parsing.
- `insertRule()` will throw a syntax error on @import rules.
- Modify WPT test cases to reflect these changes.
Differential Revision: https://phabricator.services.mozilla.com/D61882
|
|
|
|
|
|
|
| |
This is needed to make the root element not a containing block in presence of
filters or what not.
Differential Revision: https://phabricator.services.mozilla.com/D61167
|
| |
|
|
|
|
|
|
| |
This avoids the mutation due to the different serialization in some cases.
Differential Revision: https://phabricator.services.mozilla.com/D56732
|
|
|
|
|
|
|
|
|
|
| |
This code comes from:
https://hg.mozilla.org/mozilla-central/rev/2418cfba72c33c5623f6fb4c243c5203819c8240
I audited other callers of write_str, they seem ok.
Differential Revision: https://phabricator.services.mozilla.com/D54601
|
|
|
|
| |
Differential Revision: https://phabricator.services.mozilla.com/D54529
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The existing code wasn't sound, as CSSOM objects also needed to go away before
the shared memory goes away (as they keep references to them).
This is sound assuming no presence of reference cycles introduced by CSSOM.
We may want to live with this and rely on chrome code not writing cycles like
this with UA stylesheet DOM objects.
We could explicitly drop all potentially-static objects... That seems pretty
error prone though.
Or we could also just leak the shared memory buffer, is there any reason why we
may not want to do that?
Differential Revision: https://phabricator.services.mozilla.com/D51870
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
It's much nicer.
One nice thing about this is that the new code is subject to the existing
threadedness checking, which identified that several of these should be atomic
because they're accessed off the main thread.
Differential Revision: https://phabricator.services.mozilla.com/D40792
|
|
|
|
|
|
|
|
| |
There are a few canvas2d-related dependencies that haven't updated, but they
only use euclid internally so that's not blocking landing the rest of the
changes.
Given the size of this patch, I think it's useful to get this landed as-is.
|
| |
|
|
|
|
| |
Differential Revision: https://phabricator.services.mozilla.com/D38530
|
|
|
|
| |
Differential Revision: https://phabricator.services.mozilla.com/D36475
|
|
|
|
|
|
|
|
|
|
| |
This doesn't change the way C++ code uses static prefs. But it does slightly
change how Rust code uses static prefs, specifically the name generated by
bindgen is slightly different.
The commit also improves some comments.
Differential Revision: https://phabricator.services.mozilla.com/D35764
|
| |
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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 -->
|