servo/components
Emilio Cobos Álvarez db5db13559
style: Implement the non-functional :host selector.
Kinda tricky because :host only matches rules on the shadow root where the rules
come from. So we need to be careful during invalidation and style sharing.

I didn't use the non_ts_pseudo_class_list bits because as soon as we implement
the :host(..) bits we're going to need to special-case it anyway.

The general schema is the following:

 * Rightmost featureless :host selectors are handled inserting them in the
   host_rules hashmap. Note that we only insert featureless stuff there. We
   could insert all of them and just filter during matching, but that's slightly
   annoying.

 * The other selectors, like non-featureless :host or what not, are added to the
   normal cascade data. This is harmless, since the shadow host rules are never
   matched against the host, so we know they'll just never match, and avoids
   adding more special-cases.

 * Featureless :host selectors to the left of a combinator are handled during
   matching, in the special-case of next_element_for_combinator in selectors.
   This prevents this from being more invasive, and keeps the usual fast path
   slim, but it's a bit hard to match the spec and the implementation.

   We could keep a copy of the SelectorIter instead in the matching context to
   make the handling of featureless-ness explicit in match_non_ts_pseudo_class,
   but we'd still need the special-case anyway, so I'm not fond of it.

 * We take advantage of one thing that makes this sound. As you may have
   noticed, if you had `root` element which is a ShadowRoot, and you matched
   something like `div:host` against it, using a MatchingContext with
   current_host == root, we'd incorrectly report a match. But this is impossible
   due to the following constraints:

    * Shadow root rules aren't matched against the host during styling (except
      these featureless selectors).

    * DOM APIs' current_host needs to be the _containing_ host, not the element
      itself if you're a Shadow host.

Bug: 992245
Reviewed-by: xidorn
MozReview-Commit-ID: KayYNfTXb5h
2018-04-09 12:19:05 +02:00
..
allocator
atoms Fire the pageshow event at the end of the page load r=jdm 2018-03-06 07:24:24 -08:00
bluetooth Bump ipc-channel and bincode 2018-03-21 13:05:47 +01:00
bluetooth_traits Bump ipc-channel and bincode 2018-03-21 13:05:47 +01:00
canvas Properly clamp arguments to WebGLRenderingContext.depthRange 2018-04-05 09:31:09 +02:00
canvas_traits Properly clamp arguments to WebGLRenderingContext.depthRange 2018-04-05 09:31:09 +02:00
compositing Bump env_logger to 0.5 and log to 0.4 in every servo crate 2018-03-28 19:50:58 +02:00
config Bump env_logger to 0.5 and log to 0.4 in every servo crate 2018-03-28 19:50:58 +02:00
constellation Implement diff-based session history 2018-04-05 18:23:21 -05:00
debugger Bump env_logger to 0.5 and log to 0.4 in every servo crate 2018-03-28 19:50:58 +02:00
deny_public_fields Bump syn/quote in deny_public_fields 2018-02-12 15:05:18 +01:00
devtools Bump env_logger to 0.5 and log to 0.4 in every servo crate 2018-03-28 19:50:58 +02:00
devtools_traits Bump ipc-channel and bincode 2018-03-21 13:05:47 +01:00
dom_struct
domobject_derive Adapt Servo for mozjs 0.6 and the changes introduced in servo/rust-mozjs#393 2018-03-28 21:28:30 +02:00
fallible
geometry alias some euclid types 2018-03-16 14:34:29 +08:00
gfx Bump env_logger to 0.5 and log to 0.4 in every servo crate 2018-03-28 19:50:58 +02:00
gfx_traits Update WebRender 2018-02-06 15:10:35 +01:00
hashglobe Bump ipc-channel and bincode 2018-03-21 13:05:47 +01:00
jstraceable_derive Bump syn/quote in jstraceable_derive 2018-02-12 17:07:58 +01:00
layout Add support for percentages in column-gap. 2018-04-05 21:04:29 -03:00
layout_thread Bump env_logger to 0.5 and log to 0.4 in every servo crate 2018-03-28 19:50:58 +02:00
layout_traits Bump ipc-channel and bincode 2018-03-21 13:05:47 +01:00
malloc_size_of Hide non-Servo heap measurement. 2018-04-02 10:21:18 -04:00
malloc_size_of_derive Bump syn/quote in malloc_size_of_derive 2018-02-12 17:08:19 +01:00
metrics Bump env_logger to 0.5 and log to 0.4 in every servo crate 2018-03-28 19:50:58 +02:00
msg remove mozbrowser code 2018-02-13 09:40:06 +01:00
net Measure cache memory usage (#19251): 2018-04-01 13:30:57 -04:00
net_traits Measure cache memory usage (#19251): 2018-04-01 13:30:57 -04:00
nonzero
profile Bump env_logger to 0.5 and log to 0.4 in every servo crate 2018-03-28 19:50:58 +02:00
profile_traits Measure cache memory usage (#19251): 2018-04-01 13:30:57 -04:00
rand Bump env_logger to 0.5 and log to 0.4 in every servo crate 2018-03-28 19:50:58 +02:00
range
remutex Bump env_logger to 0.5 and log to 0.4 in every servo crate 2018-03-28 19:50:58 +02:00
script Properly check the right internal formats in gl.renderbufferStorage 2018-04-06 11:22:28 +02:00
script_layout_interface Add unique canvas IDs to all canvas operations. 2018-04-02 22:02:22 -04:00
script_plugins
script_traits Add unique canvas IDs to all canvas operations. 2018-04-02 22:02:22 -04:00
selectors style: Implement the non-functional :host selector. 2018-04-09 12:19:05 +02:00
servo Fix the env_logger update 2018-04-03 12:03:41 +02:00
servo_arc Fix license metadata for servo_arc crate 2018-02-21 16:35:18 -08:00
size_of_test
style style: Implement the non-functional :host selector. 2018-04-09 12:19:05 +02:00
style_derive Share a single #[animation(no_bound(…))] for the animation traits 2018-03-12 09:48:25 +01:00
style_traits Remove useless AsciiExt imports. 2018-03-27 10:30:02 +02:00
url Bump ipc-channel and bincode 2018-03-21 13:05:47 +01:00
webdriver_server Bump env_logger to 0.5 and log to 0.4 in every servo crate 2018-03-28 19:50:58 +02:00
webvr Bump env_logger to 0.5 and log to 0.4 in every servo crate 2018-03-28 19:50:58 +02:00
webvr_traits Bump ipc-channel and bincode 2018-03-21 13:05:47 +01:00