mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Auto merge of #19881 - jonleighton:issue-19811, r=emilio
Add layout RPC query for getting an element's style This enables us to implement Element::has_css_layout_box() in a more direct way, and also enables us to remove some of the existing more specific queries. Fixes #19811. r? @emilio <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19881) <!-- Reviewable:end -->
This commit is contained in:
commit
2a46067587
10 changed files with 88 additions and 136 deletions
|
@ -11,7 +11,6 @@ use invalidation::element::restyle_hints::RestyleHint;
|
|||
#[cfg(feature = "gecko")]
|
||||
use malloc_size_of::MallocSizeOfOps;
|
||||
use properties::ComputedValues;
|
||||
use properties::longhands::display::computed_value::T as Display;
|
||||
use rule_tree::StrongRuleNode;
|
||||
use selector_parser::{EAGER_PSEUDO_COUNT, PseudoElement, RestyleDamage};
|
||||
use selectors::NthIndexCache;
|
||||
|
@ -169,7 +168,7 @@ impl ElementStyles {
|
|||
|
||||
/// Whether this element `display` value is `none`.
|
||||
pub fn is_display_none(&self) -> bool {
|
||||
self.primary().get_box().clone_display() == Display::None
|
||||
self.primary().get_box().clone_display().is_none()
|
||||
}
|
||||
|
||||
#[cfg(feature = "gecko")]
|
||||
|
|
|
@ -216,6 +216,12 @@ impl Display {
|
|||
other => other,
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns true if the value is `None`
|
||||
#[inline]
|
||||
pub fn is_none(&self) -> bool {
|
||||
*self == Display::None
|
||||
}
|
||||
}
|
||||
|
||||
/// A specified value for the `vertical-align` property.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue