style: Enable chrome-only CSS features in user stylesheets.

MozReview-Commit-ID: FJ4vTiOrotH
Reviewed-by: heycam
Bug: 1418963
This commit is contained in:
Emilio Cobos Álvarez 2017-11-21 10:11:05 +01:00
parent b74e71fdd1
commit c7a3c929f6
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
5 changed files with 52 additions and 29 deletions

View file

@ -70,8 +70,9 @@ impl<'a> SelectorParser<'a> {
/// Whether we're parsing selectors in a stylesheet that has chrome
/// privilege.
pub fn in_chrome_stylesheet(&self) -> bool {
self.url_data.map_or(false, |d| d.is_chrome())
pub fn chrome_rules_enabled(&self) -> bool {
self.url_data.map_or(false, |d| d.is_chrome()) ||
self.stylesheet_origin == Origin::User
}
}