mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
style: Allow resource:// stylesheets to use chrome-only rules.
We'll use it to use @-moz-document from plaintext.css. Differential Revision: https://phabricator.services.mozilla.com/D101516
This commit is contained in:
parent
f16305d25a
commit
df7ea837d8
3 changed files with 5 additions and 5 deletions
|
@ -140,7 +140,7 @@ impl<'a> ParserContext<'a> {
|
||||||
/// Returns whether chrome-only rules should be parsed.
|
/// Returns whether chrome-only rules should be parsed.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn chrome_rules_enabled(&self) -> bool {
|
pub fn chrome_rules_enabled(&self) -> bool {
|
||||||
self.url_data.is_chrome() || self.stylesheet_origin == Origin::User
|
self.url_data.chrome_rules_enabled() || self.stylesheet_origin == Origin::User
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Whether we're in a user-agent stylesheet or chrome rules are enabled.
|
/// Whether we're in a user-agent stylesheet or chrome rules are enabled.
|
||||||
|
|
|
@ -75,7 +75,7 @@ impl<'a> SelectorParser<'a> {
|
||||||
/// Whether we're parsing selectors in a stylesheet that has chrome
|
/// Whether we're parsing selectors in a stylesheet that has chrome
|
||||||
/// privilege.
|
/// privilege.
|
||||||
pub fn chrome_rules_enabled(&self) -> bool {
|
pub fn chrome_rules_enabled(&self) -> bool {
|
||||||
self.url_data.map_or(false, |d| d.is_chrome()) || self.stylesheet_origin == Origin::User
|
self.url_data.map_or(false, |d| d.chrome_rules_enabled()) || self.stylesheet_origin == Origin::User
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -154,8 +154,8 @@ impl UrlExtraData {
|
||||||
|
|
||||||
/// True if this URL scheme is chrome.
|
/// True if this URL scheme is chrome.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn is_chrome(&self) -> bool {
|
pub fn chrome_rules_enabled(&self) -> bool {
|
||||||
self.as_ref().mIsChrome
|
self.as_ref().mChromeRulesEnabled
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Create a reference to this `UrlExtraData` from a reference to pointer.
|
/// Create a reference to this `UrlExtraData` from a reference to pointer.
|
||||||
|
@ -213,7 +213,7 @@ impl fmt::Debug for UrlExtraData {
|
||||||
|
|
||||||
formatter
|
formatter
|
||||||
.debug_struct("URLExtraData")
|
.debug_struct("URLExtraData")
|
||||||
.field("is_chrome", &self.is_chrome())
|
.field("chrome_rules_enabled", &self.chrome_rules_enabled())
|
||||||
.field(
|
.field(
|
||||||
"base",
|
"base",
|
||||||
&DebugURI(self.as_ref().mBaseURI.raw::<structs::nsIURI>()),
|
&DebugURI(self.as_ref().mBaseURI.raw::<structs::nsIURI>()),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue