diff --git a/components/style/context.rs b/components/style/context.rs index 08fdb4d1eef..a7d5aa4a67b 100644 --- a/components/style/context.rs +++ b/components/style/context.rs @@ -116,21 +116,6 @@ impl Default for StyleSystemOptions { } } -impl StyleSystemOptions { - #[cfg(feature = "servo")] - /// On Gecko's nightly build? - pub fn is_nightly(&self) -> bool { - false - } - - #[cfg(feature = "gecko")] - /// On Gecko's nightly build? - #[inline] - pub fn is_nightly(&self) -> bool { - structs::GECKO_IS_NIGHTLY - } -} - /// A shared style context. /// /// There's exactly one of these during a given restyle traversal, and it's diff --git a/components/style/properties/properties.mako.rs b/components/style/properties/properties.mako.rs index 95d59df064d..b27831a5785 100644 --- a/components/style/properties/properties.mako.rs +++ b/components/style/properties/properties.mako.rs @@ -1757,7 +1757,21 @@ impl UnparsedValue { shorthand_cache.insert((shorthand, longhand), declaration); } - Cow::Borrowed(&shorthand_cache[&(shorthand, longhand_id)]) + let key = (shorthand, longhand_id); + match shorthand_cache.get(&key) { + Some(decl) => Cow::Borrowed(decl), + None => { + // FIXME: We should always have the key here but it seems + // sometimes we don't, see bug 1696409. + #[cfg(feature = "gecko")] + { + if structs::GECKO_IS_NIGHTLY { + panic!("Expected {:?} to be in the cache but it was not!", key); + } + } + invalid_at_computed_value_time() + } + } } }