This is necessary because we can't create GeckoStyleSheets off-main-thread,
so we need a placeholder until it can be filled in.
Bug: 1454030
Reviewed-by: emilio
MozReview-Commit-ID: ssRme4fLYg
It's just a struct aggregating stylesheets + CascadeData, with a quirks_mode
parameter because XBL sucks so bad.
Bug: 1436059
Reviewed-by: xidorn
MozReview-Commit-ID: 7q99tSNXo0K
In particular, `rebuild` is now done entirely by CascadeData, which simplifies
more stuff.
The eventual final state for this is that the data structure we use to store the
XBL / Shadow DOM stuff will be something like:
struct AuthorStyles { CascadeData, AuthorSheetCollection }
MozReview-Commit-ID: 8TExtP58L4X
This will make it easier to handle it properly for Shadow DOM, though this patch
doesn't do that.
This also makes some method inline and infallible for convenience, since nobody
checks the errors anyway.
Bug: 1436798
Reviewed-by: bholley
MozReview-Commit-ID: Hq3erAUs5tf
Chances are we need to pass it around in a bit.
Also invert the boolean because I don't want to reason about double negations,
even if they're simple.
MozReview-Commit-ID: KhX4lDKwDoj
Otherwise removal of stylesheets may get out of sync with other DOM changes, and
we may fail to invalidate the style of the affected elements.
Bug: 1432850
Reviewed-by: bz
MozReview-Commit-ID: DrMTgLzQcnk
Servo currently uses `heapsize`, but Stylo/Gecko use `malloc_size_of`.
`malloc_size_of` is better -- it handles various cases that `heapsize` does not
-- so this patch changes Servo to use `malloc_size_of`.
This patch makes the following changes to the `malloc_size_of` crate.
- Adds `MallocSizeOf` trait implementations for numerous types, some built-in
(e.g. `VecDeque`), some external and Servo-only (e.g. `string_cache`).
- Makes `enclosing_size_of_op` optional, because vanilla jemalloc doesn't
support that operation.
- For `HashSet`/`HashMap`, falls back to a computed estimate when
`enclosing_size_of_op` isn't available.
- Adds an extern "C" `malloc_size_of` function that does the actual heap
measurement; this is based on the same functions from the `heapsize` crate.
This patch makes the following changes elsewhere.
- Converts all the uses of `heapsize` to instead use `malloc_size_of`.
- Disables the "heapsize"/"heap_size" feature for the external crates that
provide it.
- Removes the `HeapSizeOf` implementation from `hashglobe`.
- Adds `ignore` annotations to a few `Rc`/`Arc`, because `malloc_size_of`
doesn't derive those types, unlike `heapsize`.
Implement `size_hint` for more iterators.
```
implement size hint for
more iterators because why
not we like fast things
```
<!-- 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/18494)
<!-- Reviewable:end -->
Also add a few comments and similar about pending invalidation work, and avoid
passing a device in script, since the work it performs scanning the stylesheet
is just thrown away in the `flush_without_invalidations` call.
This will allow tracking whether there have been only additions to the
stylesheet set, and in that case don't destroy and completely rebuild the
invalidation map.
This is a patch that unifies a bit how Gecko and Stylo stylesheets work, in
order to be able to eventually move the stylesheets into the stylist, and be
able to incrementally update the invalidation map.
This moves us to clear on rebuild, which allows us to remove yet another place
where we track stylist dirtiness.
Bug: 1390255
Reviewed-by: heycam
MozReview-Commit-ID: nihQbUAbh8
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
People apparently do all sorts of silly stuff with stylesheets, see Google Inbox
in bug 1379203.
Bug: 1379433
Reviewed-By: heycam
MozReview-Commit-ID: 4x2d3glOFu8
This patch also makes RulesIterator not iterate over rules for which we don't
process nested rules.
There's nothing depending on this behavior right now afaik, and this will make
us duplicate less code in following patches.
Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1357461
MozReview-Commit-ID: CaMFQtAVnJF