mirror of
https://github.com/servo/servo.git
synced 2025-08-07 14:35:33 +01:00
style: Improve CSS OM for CSSContainerRule
This implements https://github.com/w3c/csswg-drafts/pull/7293, pending a spec resolution, so landing test as tentative for now, but the change makes sense. Differential Revision: https://phabricator.services.mozilla.com/D155602
This commit is contained in:
parent
b268936308
commit
aefbae5f96
1 changed files with 8 additions and 1 deletions
|
@ -47,6 +47,11 @@ impl ContainerRule {
|
||||||
&self.condition.condition
|
&self.condition.condition
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Returns the query name filter.
|
||||||
|
pub fn container_name(&self) -> &ContainerName {
|
||||||
|
&self.condition.name
|
||||||
|
}
|
||||||
|
|
||||||
/// Measure heap usage.
|
/// Measure heap usage.
|
||||||
#[cfg(feature = "gecko")]
|
#[cfg(feature = "gecko")]
|
||||||
pub fn size_of(&self, guard: &SharedRwLockReadGuard, ops: &mut MallocSizeOfOps) -> usize {
|
pub fn size_of(&self, guard: &SharedRwLockReadGuard, ops: &mut MallocSizeOfOps) -> usize {
|
||||||
|
@ -88,10 +93,12 @@ impl ToCssWithGuard for ContainerRule {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A container condition and filter, combined.
|
/// A container condition and filter, combined.
|
||||||
#[derive(Debug, ToShmem)]
|
#[derive(Debug, ToShmem, ToCss)]
|
||||||
pub struct ContainerCondition {
|
pub struct ContainerCondition {
|
||||||
|
#[css(skip_if = "ContainerName::is_none")]
|
||||||
name: ContainerName,
|
name: ContainerName,
|
||||||
condition: QueryCondition,
|
condition: QueryCondition,
|
||||||
|
#[css(skip)]
|
||||||
flags: FeatureFlags,
|
flags: FeatureFlags,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue