mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
style: Kill -servo-under-display-none.
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
This commit is contained in:
parent
7d91b30172
commit
2c88248b87
5 changed files with 8 additions and 43 deletions
|
@ -249,43 +249,3 @@ ${helpers.single_keyword("image-rendering",
|
|||
}
|
||||
}
|
||||
</%helpers:longhand>
|
||||
|
||||
// Used in the bottom-up flow construction traversal to avoid constructing flows for
|
||||
// descendants of nodes with `display: none`.
|
||||
<%helpers:longhand name="-servo-under-display-none"
|
||||
derived_from="display"
|
||||
products="servo"
|
||||
animation_value_type="none"
|
||||
spec="Nonstandard (internal layout use only)">
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
|
||||
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
||||
#[cfg_attr(feature = "servo", derive(Deserialize, HeapSizeOf, Serialize))]
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq, ToComputedValue)]
|
||||
pub struct SpecifiedValue(pub bool);
|
||||
|
||||
pub mod computed_value {
|
||||
pub type T = super::SpecifiedValue;
|
||||
}
|
||||
|
||||
pub fn get_initial_value() -> computed_value::T {
|
||||
SpecifiedValue(false)
|
||||
}
|
||||
|
||||
impl ToCss for SpecifiedValue {
|
||||
fn to_css<W>(&self, _: &mut W) -> fmt::Result where W: fmt::Write {
|
||||
Ok(()) // Internal property
|
||||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn derive_from_display(context: &mut Context) {
|
||||
use super::display::computed_value::T as Display;
|
||||
|
||||
if context.style().get_box().clone_display() == Display::none {
|
||||
context.builder
|
||||
.set__servo_under_display_none(SpecifiedValue(true));
|
||||
}
|
||||
}
|
||||
</%helpers:longhand>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue