aboutsummaryrefslogtreecommitdiffstats
path: root/components/style/gecko/traversal.rs
Commit message (Collapse)AuthorAgeFilesLines
* Move Stylo to its own repo (#31350)Delan Azabani2024-02-271-53/+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
* Update MPL license to https (part 4)Jan Andre Ikenmeyer2018-11-191-1/+1
|
* `cargo fix --edition --features gecko`Simon Sapin2018-11-101-4/+4
|
* Run rustfmt on selectors, servo_arc, and style.Bobby Holley2018-04-101-12/+14
| | | | | | | | | | 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)
* Eliminate the sequential/traversal parallel distinction in favor of a ↵Bobby Holley2017-08-251-8/+2
| | | | | | unified adaptive driver. MozReview-Commit-ID: ADVTNJntzmp
* Pass a callback to recalc_style_at to avoid traversing children twice.Bobby Holley2017-07-151-8/+9
| | | | MozReview-Commit-ID: DIHXaVNzbFM
* script: Move the layout_wrapper outside of script.Emilio Cobos Álvarez2017-07-151-12/+2
| | | | | | | | This allows us to have ensure_data() and clear_data() functions on the TElement trait, instead of hacking around it adding methods in random traits. This also allows us to do some further cleanup, which I'd rather do in a followup.
* Rip out the generic abstractions around ThreadLocalStyleContext.Bobby Holley2017-07-051-14/+4
| | | | MozReview-Commit-ID: 5WTLuk323Ac
* Do the sequential traversal breadth-first.Bobby Holley2017-04-091-1/+1
| | | | | | | | | | | | | While we're at it, we also eliminate the 'unknown' dom depth for the bloom filter. Computing depth has negligible cost relative to the amount of work we do setting up the bloom filter at a given depth. Doing it once per traversal should be totally fine. I originally separated the elimination of unknown dom depth from the traversal changes, but I got bloom filter crashes on the intermediate patch, presumably because I didn't properly fix the sequential traversal for this case. Given that the final state is green, I just decided to squash and move on.
* Replace RwLock<StyleRule> with Locked<StyleRule>Simon Sapin2017-03-191-6/+7
|
* style: Expose the traversal kind to the style system.Emilio Cobos Álvarez2017-01-241-2/+8
| | | | | | | This way we'll be able to take different paths for the sequential and parallel traversals in some concrete cases. This is a preliminar patch to fix bug 1332525.
* Bug 1325734 - Parameterize the style traversal on TElement instead of TNode. ↵Bobby Holley2017-01-091-6/+6
| | | | | | r=emilio This works around the issue described in https://github.com/rust-lang/rust/issues/38917
* style: Document Gecko's traversal code.Emilio Cobos Álvarez2017-01-021-0/+5
| | | | | | Actually, I think most of the functions in DOMTraversalContext deserve a nice comment, but that's probably fine as a followup, I want to land the require-docs thing now.
* Stop using UnsafeNode in the StyleSharingCandidateCache.Bobby Holley2016-12-211-4/+4
|
* Introduce and use Scoped TLS.Bobby Holley2016-12-211-10/+11
| | | | | | | | | | | | | | | | It turns out that it's problematic to embed ThreadLocalStyleContext within LayoutContext, because parameterizing the former on TElement (which we do in the next patch) infects all the traversal stuff with the trait parameters, which we don't really want. In general, it probably makes sense to use separate scoped TLS types for the separate DOM and Flow tree passes, so we can add a different ScopedTLS type for the Flow pass if we ever need it. We also reorder the |scope| and |shared| parameters in parallel.rs, because it aligns more with the order in style/parallel.rs. I did this when I was adding a TLS parameter to all these functions, which I realized we don't need for now.
* Make the DomTraversalContext own the SharedStyleContext and share it ↵Bobby Holley2016-12-161-18/+25
| | | | | | | | | | immutably across the traversal. This allows us to get rid of a bunch of lifetimes and simplify a lot of code. It also lets us get rid of that nasty lifetime transmute, which is awesome. The situation with thread-local contexts is still suboptimal, but we fix that in subsequent patches.
* Make Restyle tracking more granular.Bobby Holley2016-12-091-15/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | The primary idea of this patch is to ditch the rigid enum of Previous/Current styles, and replace it with a series of indicators for the various types of work that needs to be performed (expanding snapshots, rematching, recascading, and damage processing). This loses us a little bit of sanity checking (since the up-to-date-ness of our style is no longer baked into the type system), but gives us a lot more flexibility that we'll need going forward (especially when we separate matching from cascading). We also eliminate get_styling_mode in favor of a method on the traversal. This patch does a few other things as ridealongs: * Temporarily eliminates the handling for transfering ownership of styles to the frame. We'll need this again at some point, but for now it's causing too much complexity for a half-implemented feature. * Ditches TRestyleDamage, which is no longer necessary post-crate-merge, and is a constant source of compilation failures from either needing to be imported or being unnecessarily imported (which varies between gecko and servo). * Expands Snapshots for the traversal root, which was missing before. * Fixes up the skip_root stuff to avoid visiting the skipped root. * Unifies parallel traversal and avoids spawning for a single work item. * Adds an explicit pre_traverse step do any pre-processing and determine whether we need to traverse at all. MozReview-Commit-ID: IKhLAkAigXE
* style: Enable the bloom filter recovering.Emilio Cobos Álvarez2016-11-271-3/+3
|
* Revert restyled_previous_sibling_element tracking, and separate child ↵Bobby Holley2016-11-241-2/+2
| | | | | | | | | | | | | | | preprocessing. I realized that I fixed this issue incorrectly when the test failed before. Our design document specifies that restyle hints must be expanded by the parent before traversing children, so that we can properly apply LaterSiblings restyle hints. This includes parents that do not themselves need processing (StylingMode::Traverse). So we need to preprocess children even in the case where we don't restyle the parent. On the flip side, we do in fact know whether a child needs processing before enqueuing it, so we can skip the conservative visit I added before. MozReview-Commit-ID: AEiRzdsN0h5
* Bug 1317016 - Basic infrastructure for RestyleHint-driven traversal.Bobby Holley2016-11-241-7/+3
| | | | MozReview-Commit-ID: 7wH5XcILVmX
* Drop style data from descendants on display:none.Bobby Holley2016-11-011-0/+4
| | | | MozReview-Commit-ID: 8ls43oAGWRg
* Eliminate RestyleResult.Bobby Holley2016-11-011-9/+8
| | | | | | | The new incremental restyle algorithm will make traversal decisions in a more centralized way. MozReview-Commit-ID: GH6gFt4VUJO
* Replace begin_styling with a centralized mechanism to set a node up for ↵Bobby Holley2016-11-011-1/+1
| | | | | | | | | either styling or restyling. We also make sure that an element never has an ElementData with ElementDataStyles::Uninitialized, and eagerly call prepare_for_styling whenever an ElementData is instantiated. MozReview-Commit-ID: 9YP6eSmdMt0
* Rename NodeData and associated data structures to Element*.Bobby Holley2016-10-291-2/+2
| | | | MozReview-Commit-ID: 96VsmsoZtjZ
* Hoist most styling functionality from TNode to TElement.Bobby Holley2016-10-291-4/+11
| | | | MozReview-Commit-ID: DZ8ZrsZIiAU
* Don't traverse text nodes during styling.Bobby Holley2016-10-271-2/+9
| | | | MozReview-Commit-ID: 6CtQMxbcLnF
* Introduce StylingMode and deprecate explicit dirtiness.Bobby Holley2016-10-261-1/+7
| | | | MozReview-Commit-ID: 5tF075EJKBa
* Rearrange some data structures in preparation for the new incremental ↵Bobby Holley2016-10-211-4/+0
| | | | | | restyle algorithm. MozReview-Commit-ID: 8iOALQylOuK
* Move most of geckolib into style::geckoManish Goregaokar2016-09-261-0/+49