aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/context.rs
Commit message (Collapse)AuthorAgeFilesLines
* Remove cached thread local context from LayoutContextPu Xingyu2017-02-081-64/+21
| | | | | Remove cached thread local context from LayoutContext, use LayoutContext for assign_inline_sizes(), and simplify the parallel flow traversal code.
* Remove redundant style_context() method of LayoutContextPu Xingyu2017-02-061-8/+0
|
* Bug 1325734 - Pass the thread-local context into should_traverse_children. ↵Bobby Holley2017-01-091-0/+13
| | | | r=emilio
* Stop allowing unsafe code around thread_local.Ms2ger2016-12-301-3/+0
|
* Stop using UnsafeNode in the StyleSharingCandidateCache.Bobby Holley2016-12-211-3/+4
|
* Introduce and use Scoped TLS.Bobby Holley2016-12-211-37/+34
| | | | | | | | | | | | | | | | 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-31/+42
| | | | | | | | | | 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.
* Removed util.Alan Jeffrey2016-12-141-1/+1
|
* Make Restyle tracking more granular.Bobby Holley2016-12-091-0/+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
* Urlmageddon: Use refcounted urls more often.Emilio Cobos Álvarez2016-11-171-8/+8
|
* Concurrent rule tree, v1Emilio Cobos Álvarez2016-11-051-3/+0
| | | | | | | | | | | | This patch introduces infrastructure for the rule tree, and constructs it. We don't use it yet, nor have good heuristics for GC'ing it, but this should not happen anymore once we store the rule node reference in the node. I haven't messed up with memory orders because I want to do a try run with it, then mess with them. Take down the ApplicableDeclarationsCache, use the rule tree for doing the cascade.
* Auto merge of #14048 - antrik:nosync-ipc_sender, r=mbrubeckbors-servo2016-11-031-5/+8
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | layout/context: Wrap `image_cache_thread` in a `Mutex<>` as well `SharedLayoutContext.image_cache_thread` didn't get the `Mutex<>` treatment along with all the other channels in there, because `ipc-channel::Sender` is presently inherently `Sync`. I believe this to be an implementation accident though, that should be rectified in the future -- not something users should actually rely on... Note that sharing senders (be it `mpsc` or `ipc-channel`) in is probably not a good idea anyway: just cloning them -- and letting them handle the sharing internally -- should be both simpler and cheaper. But right now that's how things are handled here; so let's go with the flow... <!-- 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/14048) <!-- Reviewable:end -->
| * layout/context: Wrap `image_cache_thread` in a `Mutex<>` as wellOlaf Buddenhagen2016-11-031-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | `SharedLayoutContext.image_cache_thread` didn't get the `Mutex<>` treatment along with all the other channels in there, because `ipc-channel::Sender` is presently inherently `Sync`. I believe this to be an implementation accident though, that should be rectified in the future -- not something users should actually rely on... Note that sharing senders (be it `mpsc` or `ipc-channel`) in is probably not a good idea anyway: just cloning them -- and letting them handle the sharing internally -- should be both simpler and cheaper. But right now that's how things are handled here; so let's go with the flow...
* | Make style context use parking_lot::RwLockXidorn Quan2016-11-021-5/+3
|/
* Remove concept of Layers from ServoMartin Robinson2016-10-211-6/+0
| | | | | | | | Layers were a feature of the legacy drawing path. If we re-add them at some point, it probably makes more sense to make them a product of display list inspection. This change also remove a bunch of dead painting code.
* Remove old rendering backend.Glenn Watson2016-10-181-20/+11
| | | | | | | | | | | | | | This removes paint threads, rust-layers dependency, and changes optional webrender types to be required. The use_webrender option has been removed, however I've left the "-w" command line option in place so that wpt runner can continue to pass that. Once it's removed from there we can also remove the -w option. Once this stage is complete, it should be fine to change the display list building code to generate webrender display lists directly and avoid the conversion step.
* Move image fetching methods to SharedLayoutContext.Ms2ger2016-08-231-9/+10
|
* Remove some type aliases that are now just re-exports.Simon Sapin2016-07-201-2/+1
|
* Have a concrete SelectorImpl type everywhere in the style crate.Simon Sapin2016-07-201-2/+1
| | | | | It is conditionally compiled to one implementation or the other (Gecko or Servo) with `#[cfg(…)]`.
* Remove the ComputedValue traits and style_struct_traitsSimon Sapin2016-07-201-2/+2
|
* style: Remove the Mutex from new_animations_sender by moving it to the local ↵Emilio Cobos Álvarez2016-07-011-8/+6
| | | | | | | | | | StyleContext. As a follow-up, we could move all the data living under a mutex in the SharedLayoutContext only in order to create the local context to the same place. This should increase animation performance when there are multiple animations in one page that happen to be on different threads.
* Remove SharedLayoutContext::url.Ms2ger2016-05-311-3/+0
| | | | It is unused.
* Remove empty lines following braces.Josh Matthews2016-05-271-1/+0
|
* layout: Stop storing PrecomputedStyleData in LayoutNodeEmilio Cobos Álvarez2016-04-291-0/+5
| | | | Use the SharedStyleContext instead.
* style: Add infrastructure for non-eagerly-cascaded pseudo-elementsEmilio Cobos Álvarez2016-04-291-1/+1
| | | | This commit also removes StylistWrapper and uses Arc::get_mut instead.
* ComputedValues is now ServoComputedValuesPer Lundberg2016-03-271-5/+4
| | | | This is the first part of #10185. More to follow. I have built this locally with both servo and geckolib without errors; let's see if it succeeds on all platforms as well.
* Auto merge of #10155 - bholley:generalize_style_structs, r=SimonSapinbors-servo2016-03-251-3/+4
|\ | | | | | | | | | | | | | | | | | | | | Generalize the style structs This allows geckolib to pass gecko style structs and have the style system write to them directly, provided we implement all the traits. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10155) <!-- Reviewable:end -->
| * Parameterize the rest of the style system on TNode.Bobby Holley2016-03-241-3/+4
| |
* | canvas: Remove all the canvas layerization infrastructureEmilio Cobos Álvarez2016-03-231-6/+1
|/ | | | | | | It was never complete, and with webrender as a backend the way we render WebGL contexts has changed a bit. This should remove quite a bit of overhead.
* gfx: Allow images to be shipped to the WebRender thread without shippingPatrick Walton2016-03-221-37/+73
| | | | | | | | | over the data as well. WebRender doesn't need the data, as it acquires it separately. About a 50%-100% improvement in display list building time on browser.html.
* Don't use image metadata for layout when rendering to a fileMatt Brubeck2016-02-251-36/+16
| | | | | | | | | PR #9208 added the ability to perform layout before an `<img>` resource is fully loaded. However, when we are rendering to an image file for testing purposes, we need to block until the image content is fully loaded (until issue #9441 is fixed). Fixes #9550.
* Refactor style to be completely backend-independentEmilio Cobos Álvarez2016-02-131-2/+4
| | | | | | | | | | | This commit refactors the style crate to be completely independent of the actual implementation and pseudo-elements supported. This also adds a gecko backend which introduces parsing for the anonymous box pseudo-elements[1], although there's still no way of querying them. https://mxr.mozilla.org/mozilla-central/source/layout/style/nsCSSAnonBoxList.h
* Auto merge of #9523 - ruud-v-a:hasher, r=Wafflespeanutbors-servo2016-02-051-2/+2
|\ | | | | | | | | | | | | | | | | | | Upgrade to new Hasher API This fixes #9494. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9523) <!-- Reviewable:end -->
| * Upgrade to new Hasher APIRuud van Asseldonk2016-02-031-2/+2
| |
* | Auto merge of #9532 - nox:dedup-heapsize, r=Manishearthbors-servo2016-02-051-1/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | Say farewell to in-tree HeapSizeOf <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9532) <!-- Reviewable:end -->
| * | Say farewell to in-tree HeapSizeOfAnthony Ramine2016-02-041-1/+1
| |/
* / Implement StandaloneStyleContext::new.Bobby Holley2016-02-031-0/+1
|/
* adding image metadata notification capabilities to image cachejmr02016-01-291-2/+49
|
* Remove unused imports in layoutKishor Bhat2016-01-171-1/+1
|
* Update to rustc 1.7.0-nightly (b4707ebca 2015-12-27)Ms2ger2016-01-141-1/+2
|
* task -> threadrohan.prinja2016-01-101-14/+14
|
* Remove the dependency of parallel DOM traversal and style calculation on ↵Bobby Holley2016-01-061-10/+0
| | | | LayoutContext.
* Hoist style-related context bits into style/.Bobby Holley2015-12-291-52/+26
| | | | | | | | We do a few things-here: * Hoist non-layout-dependent fields in SharedLayoutData and LocalLayoutData into style/. * Hoist parts of css/matching.rs into style/. * Hoist parts of layout/animation.rs into style/animation.rs. * Remove the duplicated-but-slightly-different definition of OpaqueNode.
* Move LayerKind and ScrollPolicy enums to gfx_traitsBrandon Fairchild2015-12-201-1/+1
| | | | | | This also moves LayerId and LayerProperties to gfx_traits. Fixes #8836.
* Add pipeline information to CSS error reporting.GauriGNaik2015-12-141-1/+1
|
* Defined new trait ParseErrorReporter and added error_reporter member to ↵GauriGNaik2015-11-251-0/+4
| | | | ParserContext
* Write animated values into the `ComputedValues` structures whenPatrick Walton2015-11-241-2/+5
| | | | | | | | | | animations complete or are interrupted. This adds a new pair of reader-writer locks. I measured the performance of style recalculation on Wikipedia and the overhead of the locks was not measurable. Closes #7816.
* Remove the unsafe Sync implementation for SharedLayoutContext.Ms2ger2015-11-071-5/+0
|
* Wrap SharedLayoutContext::stylist in a wrapper to make it Sync.Ms2ger2015-11-071-2/+7
|
* Wrap SharedLayoutContext::canvas_layers_sender in a Mutex.Ms2ger2015-11-071-2/+1
|