servo/components/style
Emilio Cobos Álvarez cd04664fb9
style: Use CascadeFlags for what they're for.
Now that we have an Element around on cascade, we can stop using the cascade
flags mechanism to pass various element-related state, like "is this element the
root", or "should it use the item-based display fixup".

That fixes handwaviness in the handling of those flags from style reparenting,
and code duplication to handle tricky stuff like :visited.

There are a number of other changes that are worth noticing:

 * skip_root_and_item_based_display_fixup is renamed to skip_item_display_fixup:

   TElement::is_root() already implies being the document element, which by
   definition is not native anonymous and not a pseudo-element.

   Thus, you never get fixed-up if your NAC or a pseudo, which is what the code
   tried to avoid, so the only fixup with a point is the item one, which is
   necessary.

 * The pseudo-element probing code was refactored to return early a
   Option::<CascadeInputs>::None, which is nicer than what it was doing.

 * The visited_links_enabled check has moved to selector-matching time. The rest
   of the checks aren't based on whether the element is a link, or are properly
   guarded by parent_style.visited_style().is_some() or visited_rules.is_some().

   Thus you can transitively infer that no element will end up with a :visited
   style, not even from style reparenting.

Anyway, the underlying reason why I want the element in StyleAdjuster is because
we're going to implement an adjustment in there depending on the tag of the
element (converting display: contents to display: none depending on the tag), so
computing that information eagerly, including a hash lookup, wouldn't be nice.
2018-01-23 13:18:54 +01:00
..
counter_style Avoid the generic writer parameter for PropertyDeclaration serialization. 2018-01-22 14:58:05 -08:00
gecko style: Use CascadeFlags for what they're for. 2018-01-23 13:18:54 +01:00
gecko_bindings Avoid entraining various Debug impls in release builds. 2018-01-13 09:51:46 -08:00
gecko_string_cache style: Remove some uses of unused unsafe. 2017-11-15 13:26:24 +01:00
invalidation style: Track the visited-handling-mode on the MatchingContext. 2018-01-19 13:22:37 +01:00
properties style: Use CascadeFlags for what they're for. 2018-01-23 13:18:54 +01:00
rule_tree Add some FIXME comments about using ptr::NonNull 2018-01-22 17:41:26 +01:00
servo style: Use CascadeFlags for what they're for. 2018-01-23 13:18:54 +01:00
sharing style: Use Option::get_or_insert_with. 2018-01-10 03:39:29 +01:00
stylesheets Avoid the generic writer parameter for PropertyDeclaration serialization. 2018-01-22 14:58:05 -08:00
values style: Move cursor property out of mako 2018-01-20 19:06:29 +02:00
animation.rs style: Make the TElement type arrive to the cascade function. 2018-01-23 00:57:54 +01:00
applicable_declarations.rs Replace all uses of the heapsize crate with malloc_size_of. 2017-10-18 22:20:37 +11:00
attr.rs Allow unused imports for AsciiExt in style code. 2017-11-09 12:43:23 +01:00
bezier.rs
bloom.rs style: Use the ? operator for Option 2017-12-09 08:29:53 -08:00
build.rs Check that 'style' is compiled in a supported configuration. 2017-12-10 02:58:31 +01:00
build_gecko.rs Update bindgen. 2018-01-22 13:40:23 +01:00
Cargo.toml Update bindgen. 2018-01-22 13:40:23 +01:00
context.rs style: Derive debug for CascadeInputs. 2018-01-23 00:57:54 +01:00
custom_properties.rs style: Use the ? operator for Option 2017-12-09 08:29:53 -08:00
data.rs style: Add a couple FIXMEs I've noticed while working on this. 2018-01-12 12:08:40 +01:00
dom.rs style: Use CascadeFlags for what they're for. 2018-01-23 13:18:54 +01:00
dom_apis.rs style: Add invalidation support for ::slotted(). 2018-01-09 14:26:02 +01:00
driver.rs Add weighted telemetry probes for parallel restyles 2017-12-12 10:13:23 -06:00
element_state.rs style: Remove :unsolved pseudo-class 2018-01-10 17:20:06 +08:00
encoding_support.rs Use encoding-rs instead of rust-encoding for CSS parsing 2017-10-31 19:08:43 +01:00
error_reporting.rs style: Update cssparser to 0.23. 2017-12-05 10:01:37 +01:00
font_face.rs Avoid the generic writer parameter for PropertyDeclaration serialization. 2018-01-22 14:58:05 -08:00
font_metrics.rs Avoid debug serialization of PropertyDeclaration & co in release builds. 2018-01-15 17:24:27 -08:00
hash.rs Revert "Diagnostic map semantics." 2017-10-23 13:51:08 -07:00
lib.rs style: Add a document state invalidator. 2018-01-12 12:08:42 +01:00
logical_geometry.rs style: Make all keywords CamelCase for consistency. 2017-12-06 02:35:10 +01:00
macros.rs style: Move font-variant-numeric outside of mako 2017-11-18 17:57:22 +08:00
matching.rs style: Make the TElement type arrive to the cascade function. 2018-01-23 00:57:54 +01:00
media_queries.rs style: Simplify a bit media query construction. 2017-11-06 13:51:53 +01:00
parallel.rs Increase stack safety margin for stylo. 2017-09-07 11:44:45 -07:00
parser.rs Allow deriving Parse for keywords. 2017-12-15 20:01:31 +01:00
README.md
rule_cache.rs Skip rule node which contains only inherited properties for rule cache. 2018-01-05 11:29:01 +11:00
scoped_tls.rs
selector_map.rs style: Indent some function calls properly. 2018-01-20 02:36:34 +01:00
selector_parser.rs style: Move :-moz-locale-dir matching to rust. 2018-01-11 14:47:29 +01:00
shared_lock.rs Avoid the generic writer parameter for PropertyDeclaration serialization. 2018-01-22 14:58:05 -08:00
str.rs Avoid the generic writer parameter for PropertyDeclaration serialization. 2018-01-22 14:58:05 -08:00
style_adjuster.rs style: Use CascadeFlags for what they're for. 2018-01-23 13:18:54 +01:00
style_resolver.rs style: Use CascadeFlags for what they're for. 2018-01-23 13:18:54 +01:00
stylesheet_set.rs style: Make invalidation state also be with the ::slotted rules. 2018-01-09 14:26:03 +01:00
stylist.rs style: Use CascadeFlags for what they're for. 2018-01-23 13:18:54 +01:00
thread_state.rs Bump bitflags to 1.0 in every servo crate 2017-10-30 23:36:06 +01:00
timer.rs
traversal.rs style: Require an nth-index cache for invalidation. 2017-11-29 21:22:29 +01:00
traversal_flags.rs style: Get rid of unstyled children only traversals. 2017-11-20 08:24:08 +01:00

servo-style

Style system for Servo, using rust-cssparser for parsing.