aboutsummaryrefslogtreecommitdiffstats
path: root/components/style/stylesheet_set.rs
Commit message (Collapse)AuthorAgeFilesLines
* Move Stylo to its own repo (#31350)Delan Azabani2024-02-271-705/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* style: Share CascadeData instances across ShadowRootsOriol Brufau2023-05-161-15/+7
| | | | | | | | | | | 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
* style: Make the cascade data cache genericOriol Brufau2023-05-161-18/+30
| | | | | | | We're going to use it both for UA sheets and for author styles in Shadow DOM. Differential Revision: https://phabricator.services.mozilla.com/D107265
* Rustfmt.Emilio Cobos Álvarez2021-02-261-8/+10
|
* style: Use document quirks mode rather than sheet quirks mode for stylesheet ↵Emilio Cobos Álvarez2021-02-261-1/+1
| | | | | | | | | | invalidation. In order to determine whether classes or ids are case insensitive we need the document quirks mode. The sheet quirks mode almost always matches, but may not match when sheets are added by privileged APIs. Differential Revision: https://phabricator.services.mozilla.com/D95061
* style: Invalidate for CSSOM changes in a more fine-grained way.Emilio Cobos Álvarez2021-02-261-2/+53
| | | | | | | | | | | | | | | | | 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
* style: Minor cleanup of ServoStyleSet.Emilio Cobos Álvarez2020-04-161-1/+3
| | | | | | | | Removing unused arguments and so on. The origin can always be inferred from the stylesheet so it wasn't being used. Differential Revision: https://phabricator.services.mozilla.com/D64150
* Upgrade to rustc 1.43.0-nightly (5d04ce67f 2020-02-13)Simon Sapin2020-02-141-2/+3
|
* style: Remove support for XBL resources.Emilio Cobos Álvarez2019-05-071-1/+1
| | | | | | So much unsound code going away :-) Differential Revision: https://phabricator.services.mozilla.com/D28380
* style: Don't keep two list of stylesheets in ServoStyleSet.Emilio Cobos Álvarez2019-05-071-0/+7
| | | | | | Just one set of stylesheets is enough. While at it, unify SheetType and Origin. Differential Revision: https://phabricator.services.mozilla.com/D27564
* Move StylesheetSetRef to scriptFernando Jiménez Moreno2019-04-261-62/+0
|
* Rename StylesheetSet to StylesheetSetRefFernando Jiménez Moreno2019-04-261-8/+8
|
* Revert unnecessary format changesFernando Jiménez Moreno2019-04-261-3/+2
|
* Make Node and Element rare_data an OptionFernando Jiménez Moreno2019-04-261-51/+51
|
* Revert changes in sheet_set_methods macroFernando Jiménez Moreno2019-04-261-11/+6
|
* Make StylesheetSet an enum instead of a trait objectFernando Jiménez Moreno2019-04-261-15/+39
|
* Remove stylesheets ownership from DocumentOrShadowRootFernando Jiménez Moreno2019-04-261-55/+109
|
* style: Remove some redundant use statements.Emilio Cobos Álvarez2019-04-121-2/+0
|
* style: Remove ServoStyleSet::PrependStyleSheet.Cameron McCormack2019-01-131-22/+0
| | | | Differential Revision: https://phabricator.services.mozilla.com/D16284
* Update MPL license to https (part 4)Jan Andre Ikenmeyer2018-11-191-1/+1
|
* `cargo fix --edition`Simon Sapin2018-11-101-6/+6
|
* Format style component.chansuke2018-09-091-1/+2
|
* style: Allow placeholder import sheets.Bobby Holley2018-04-171-1/+1
| | | | | | | | | 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
* Run rustfmt on selectors, servo_arc, and style.Bobby Holley2018-04-101-18/+25
| | | | | | | | | | This was generated with: ./mach cargo fmt --package selectors && ./mach cargo fmt --package servo_arc && ./mach cargo fmt --package style Using rustfmt 0.4.1-nightly (a4462d1 2018-03-26)
* style: Better Shadow DOM assertions.Emilio Cobos Álvarez2018-03-191-1/+1
| | | | | | Bug: 1445682 Reviewed-by: xidorn Differential Revision: https://phabricator.services.mozilla.com/D748
* style: Separate the XBL and shadow dom styling bits.Emilio Cobos Álvarez2018-03-071-1/+6
| | | | | | Bug: 1441022 Reviewed-by: xidorn MozReview-Commit-ID: 2W0BmZ8wWXg
* Add sizeof for AuthorStyles.Xidorn Quan2018-02-191-4/+4
|
* style: Make XBL / Shadow DOM use something more light-weight than a Stylist.Emilio Cobos Álvarez2018-02-161-0/+25
| | | | | | | | | 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
* style: Move more stuff to the place it belongs to.Emilio Cobos Álvarez2018-02-091-90/+89
| | | | | | | | | | | | 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
* style: Introduce AuthorStyleSheetSet.Emilio Cobos Álvarez2018-02-091-0/+26
| | | | MozReview-Commit-ID: K3ciocPJuz3
* style: Move the stylesheet set methods under a macro to reuse it soon.Emilio Cobos Álvarez2018-02-091-70/+89
| | | | MozReview-Commit-ID: 50Srw4Mjw18
* style: Move author-style-disabled handling to push_applicable_declarations.Emilio Cobos Álvarez2018-02-091-36/+0
| | | | | | | | | | | | 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
* style: Make AuthorStylesEnabled an enum.Emilio Cobos Álvarez2018-02-091-16/+22
| | | | | | | | | 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
* style: Rename OriginValidity to DataValidity.Emilio Cobos Álvarez2018-02-091-24/+24
| | | | MozReview-Commit-ID: FpsYUlWLWTt
* style: Assert we don't try to do dumb stuff.Emilio Cobos Álvarez2018-02-091-0/+3
| | | | MozReview-Commit-ID: 6DpkiwUdccD
* style: Move the dirty bit to SheetCollection.Emilio Cobos Álvarez2018-02-091-18/+39
| | | | MozReview-Commit-ID: DO9vv9vmSzF
* style: Rename StylesheetSet to DocumentStylesheetSet.Emilio Cobos Álvarez2018-02-091-9/+9
| | | | MozReview-Commit-ID: 5Xl1eRLu1VF
* Avoid stylist flushes when sheets are appended and then removed again before ↵Bobby Holley2018-02-011-14/+21
| | | | | | flushing layout. MozReview-Commit-ID: CHgbqfHnjwI
* style: Look at the snapshots when invalidating due to stylesheet changes.Emilio Cobos Álvarez2018-01-271-1/+5
| | | | | | | | | 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
* style: Make invalidation state also be with the ::slotted rules.Emilio Cobos Álvarez2018-01-091-0/+1
| | | | MozReview-Commit-ID: GYmsXYvL9vj
* style: Use the ? operator for OptionMatt Brubeck2017-12-091-8/+2
|
* Replace all uses of the `heapsize` crate with `malloc_size_of`.Nicholas Nethercote2017-10-181-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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`.
* style: Share user agent cascade data across documents.Emilio Cobos Álvarez2017-09-151-60/+75
| | | | | MozReview-Commit-ID: KcyuTHD0bt9 Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
* style: Unify how servo and Gecko handle UA sheets.Emilio Cobos Álvarez2017-09-141-25/+28
|
* Auto merge of #18494 - frewsxcv:frewsxcv-size-hint, r=jdmbors-servo2017-09-131-0/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 -->
| * Implement `size_hint` for more iterators.Corey Farwell2017-09-131-0/+4
| | | | | | | | | | | | | | | | ``` implement size hint for more iterators because why not we like fast things ```
* | style: Add a comment about why the raw pointer is ok.Emilio Cobos Álvarez2017-09-131-0/+2
| |
* | style: Disable "removed" assertion in Gecko.Emilio Cobos Álvarez2017-09-131-1/+7
| |
* | style: Store stylesheets per origin.Emilio Cobos Álvarez2017-09-131-82/+202
|/ | | | | | | This will allow us to cache UA sheets across documents. MozReview-Commit-ID: 5rYIKTmC6iw Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
* style: Remove outdated comment.Emilio Cobos Álvarez2017-08-231-2/+1
| | | | Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>