mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +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
|
||||
}
|
||||
|
||||
/// Returns the query name filter.
|
||||
pub fn container_name(&self) -> &ContainerName {
|
||||
&self.condition.name
|
||||
}
|
||||
|
||||
/// Measure heap usage.
|
||||
#[cfg(feature = "gecko")]
|
||||
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.
|
||||
#[derive(Debug, ToShmem)]
|
||||
#[derive(Debug, ToShmem, ToCss)]
|
||||
pub struct ContainerCondition {
|
||||
#[css(skip_if = "ContainerName::is_none")]
|
||||
name: ContainerName,
|
||||
condition: QueryCondition,
|
||||
#[css(skip)]
|
||||
flags: FeatureFlags,
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue