From 14661e470f041d6b38862203135912c77a1f4b17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Thu, 11 Jan 2018 15:40:02 +0100 Subject: [PATCH] style: Add a couple FIXMEs I've noticed while working on this. ::slotted is hard. --- components/style/data.rs | 2 ++ components/style/invalidation/element/invalidator.rs | 3 +++ 2 files changed, 5 insertions(+) diff --git a/components/style/data.rs b/components/style/data.rs index 56f2de5beb6..56efedc41f0 100644 --- a/components/style/data.rs +++ b/components/style/data.rs @@ -262,6 +262,8 @@ impl ElementData { } let mut xbl_stylists = SmallVec::<[_; 3]>::new(); + // FIXME(emilio): This is wrong, needs to account for ::slotted rules + // that may apply to elements down the tree. let cut_off_inheritance = element.each_applicable_non_document_style_rule_data(|data, quirks_mode| { xbl_stylists.push((data, quirks_mode)) diff --git a/components/style/invalidation/element/invalidator.rs b/components/style/invalidation/element/invalidator.rs index 14aa084a1b0..3e2866ddca8 100644 --- a/components/style/invalidation/element/invalidator.rs +++ b/components/style/invalidation/element/invalidator.rs @@ -505,6 +505,9 @@ where DescendantInvalidationKind::Slotted, ); + // FIXME(emilio): Need to handle nested slotted nodes if `element` + // is itself a . + debug_assert!( sibling_invalidations.is_empty(), "::slotted() shouldn't have sibling combinators to the right, \