mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
style: Implement nsCSSProps::LookupProperty using Rust.
Always assume allowed-for-all-content. There are a couple callers which weren't doing that: * A unit test -> removed. * ComputeAnimationDistance: Used for testing (in transitions_per_property), and for the animation inspector. The animation inspector shouldn't show non-enabled properties. The transitions_per_property test already relies on getComputedStyle stuff which only uses eForAllContent. * GetCSSImageURLs: I added this API for the context menu page and such. It doesn't rely on non-enabled-everywhere properties, it was only using eInChrome because it was a ChromeOnly API, but it doesn't really need this. Differential Revision: https://phabricator.services.mozilla.com/D2514
This commit is contained in:
parent
c3289ad46e
commit
694d00eb5e
1 changed files with 12 additions and 0 deletions
|
@ -1870,6 +1870,18 @@ impl PropertyId {
|
|||
id.enabled_for_all_content()
|
||||
}
|
||||
|
||||
/// Converts this PropertyId in nsCSSPropertyID, resolving aliases to the
|
||||
/// resolved property, and returning eCSSPropertyExtra_variable for custom
|
||||
/// properties.
|
||||
#[cfg(feature = "gecko")]
|
||||
#[inline]
|
||||
pub fn to_nscsspropertyid_resolving_aliases(&self) -> nsCSSPropertyID {
|
||||
match self.non_custom_non_alias_id() {
|
||||
Some(id) => id.to_nscsspropertyid(),
|
||||
None => nsCSSPropertyID::eCSSPropertyExtra_variable,
|
||||
}
|
||||
}
|
||||
|
||||
fn allowed_in(&self, context: &ParserContext) -> bool {
|
||||
let id = match self.non_custom_id() {
|
||||
// Custom properties are allowed everywhere
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue