Commit graph

226 commits

Author SHA1 Message Date
Michael Howell
6a37877734 Complete animations whether or not cascade is done
Fixes #12554
2016-07-28 11:22:20 -07:00
Emilio Cobos Álvarez
c3a727ebda
style: Remove a few more unuseful traversals now we can. 2016-07-27 11:14:45 -07:00
Emilio Cobos Álvarez
d81fe27b11
style: Avoid propagating the restyle flag all through the dom when a node gets dirty.
This puts us in pair with stylo.
2016-07-25 10:50:04 -07:00
Emilio Cobos Álvarez
96ea1a335c
stylo: don't double check that the root node is dirty in restyle_tree, since now we ensure it in the caller. 2016-07-24 12:51:58 -07:00
Emilio Cobos Álvarez
a3020419d9
stylo: Don't traverse the whole dom every restyle, propagate the dirty flag down the DOM.
This commit adds hooks to the Servo style traversal to avoid traversing all the
DOM for every restyle. Additionally it changes the behavior of the dirty flag to
be propagated top down, to prevent extra overhead when an element is dirtied.

This commit doesn't aim to change the behavior on Servo just yet, since Servo
might rely on a full bottom up reconstruction of the flows. I'll need to double
check and implement that separately.
2016-07-24 12:51:58 -07:00
Simon Sapin
5c70dfab01 Have a concrete SelectorImpl type everywhere in the style crate.
It is conditionally compiled to one implementation or the other
(Gecko or Servo) with `#[cfg(…)]`.
2016-07-20 08:42:46 +02:00
Simon Sapin
789807b7b0 Remove the ComputedValue traits and style_struct_traits 2016-07-20 08:42:40 +02:00
Shing Lyu
f754cacbd5 Only restyle viewport-relative nodes on viewport size change 2016-07-18 11:01:42 +08:00
Anthony Ramine
744b94346a Move util::tid to style 2016-07-05 10:36:38 +02:00
Emilio Cobos Álvarez
203d2a62c2
style: Remove the Mutex from new_animations_sender by moving it to the local 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.
2016-07-01 13:48:06 -07:00
Emilio Cobos Álvarez
60192bb830
style: Refactor to pass animations cleanly, land animation-name parsing as experimental 2016-06-28 15:09:53 +00:00
Ms2ger
79e0d18a1d Add some documentation to the style crate. 2016-06-27 17:33:14 +02:00
Ms2ger
4381107c21 Make the STYLE_BLOOM global private. 2016-06-23 13:52:26 +02:00
Simon Sapin
00b6210519 Make the style crate almost build on stable Rust.
`discriminant_value` will need to be replaced with something else later.
2016-06-22 15:44:13 +02:00
Ms2ger
ae5cb0ceb0 Move the TNode::initialize_data() call from recalc_style_at to its callers.
This will allow us to make it an inherent method.
2016-06-13 15:11:21 +01:00
Cameron McCormack
2c9cfae830 Look past restyle root for parent node when restyling.
Currently when traversing a the tree to restyle, we look at whether a
given element to restyle is the root.  This seems to always be the root
of the entire document, since we start our processing from the top.  If
the current element being restyled is the root of the restyle, then we
use None as the parent node for restyling purposes.

In stylo we want to invoke restyling starting from an arbitrary node in
the document, not just the root of the document, so this change looks
for the parent element regardless of whether we're at the root of the
restyle.
2016-05-25 11:52:42 +10:00
Emilio Cobos Álvarez
2a499d5a0b
layout: Stop storing PrecomputedStyleData in LayoutNode
Use the SharedStyleContext instead.
2016-04-29 22:54:48 +02:00
Emilio Cobos Álvarez
b6402a81d0
style: Add infrastructure for non-eagerly-cascaded pseudo-elements
This commit also removes StylistWrapper and uses Arc::get_mut instead.
2016-04-29 22:54:45 +02:00
Bobby Holley
c2daea2c9c Parameterize the rest of the style system on TNode. 2016-03-24 11:50:57 -07:00
Bobby Holley
b1878bd925 Remove lifetimes from T{Node,Element,Document}. 2016-03-14 14:31:57 -07:00
Emilio Cobos Álvarez
dd503dfacb Refactor style to be completely backend-independent
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
2016-02-13 16:05:14 +01:00
Bobby Holley
cafc0aabdf Hoist style-only traversal into geckolib.
Implementing StandaloneStyleContext::new is going to require a TLS key (just
like LayoutContext::new), and we don't want that key in shared code.
2016-02-03 18:39:16 -08:00
Bobby Holley
84f24a04a4 Basic wrappers and glue for GeckoLib. 2016-01-13 12:14:00 -08:00
rohan.prinja
1f02c4ebbb task -> thread 2016-01-10 17:58:13 +09:00
Bobby Holley
3b33174163 Review nits: Narrowly scoping unsafety, and expanding comment. 2016-01-07 11:17:31 -08:00
Bobby Holley
f9a02f0aba Hoist the style parts of traversal.rs into style/. 2016-01-06 18:50:16 -08:00