From 36bac588630c6b49f20fea176a8e81c7bff7442b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Mon, 12 Jun 2017 04:51:00 +0200 Subject: [PATCH] style: Don't try to go down the tree if there aren't invalidations. This can happen when adding an empty stylesheet, for example. Bug: 1372068 MozReview-Commit-ID: Jtm4eJBWjEA --- components/style/invalidation/stylesheets.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/components/style/invalidation/stylesheets.rs b/components/style/invalidation/stylesheets.rs index 6d36d16a2cd..c1014d0383b 100644 --- a/components/style/invalidation/stylesheets.rs +++ b/components/style/invalidation/stylesheets.rs @@ -155,6 +155,11 @@ impl StylesheetInvalidationSet { return true; } + if self.invalid_scopes.is_empty() { + debug!("process_invalidations_in_subtree: empty invalidation set"); + return false; + } + for scope in &self.invalid_scopes { if scope.matches(element) { debug!("process_invalidations_in_subtree: {:?} matched {:?}",