From 89e01f1df6d885706bb63fcb7cc41e9124c788e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Fri, 17 Feb 2023 21:15:06 +0000 Subject: [PATCH] style: Expose chrome-only environment variables to all chrome:// documents, not just chrome-docshells This will be necessary to make the new env var testable. Reviewed in: https://phabricator.services.mozilla.com/D168148 --- components/style/gecko/media_queries.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/style/gecko/media_queries.rs b/components/style/gecko/media_queries.rs index a23ed306bd9..d098849be7d 100644 --- a/components/style/gecko/media_queries.rs +++ b/components/style/gecko/media_queries.rs @@ -541,8 +541,11 @@ impl Device { } /// Return whether the document is a chrome document. + /// + /// This check is consistent with how we enable chrome rules for chrome:// and resource:// + /// stylesheets (and thus chrome:// documents). #[inline] pub fn is_chrome_document(&self) -> bool { - self.pref_sheet_prefs().mIsChrome + self.document().mDocURISchemeIsChrome() } }