mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
style: Remove unused optional display from PseudoElementType definition.
Everyone passes None now.
This commit is contained in:
parent
55174991b6
commit
cb2bba8777
3 changed files with 13 additions and 24 deletions
|
@ -17,7 +17,6 @@ use servo_arc::Arc;
|
|||
use servo_url::ServoUrl;
|
||||
use std::fmt::Debug;
|
||||
use style::attr::AttrValue;
|
||||
use style::computed_values::display::T as Display;
|
||||
use style::context::SharedStyleContext;
|
||||
use style::data::ElementData;
|
||||
use style::dom::{LayoutIterator, NodeInfo, TNode};
|
||||
|
@ -197,7 +196,7 @@ pub trait ThreadSafeLayoutNode: Clone + Copy + Debug + GetLayoutData + NodeInfo
|
|||
fn as_element(&self) -> Option<Self::ConcreteThreadSafeLayoutElement>;
|
||||
|
||||
#[inline]
|
||||
fn get_pseudo_element_type(&self) -> PseudoElementType<Option<Display>> {
|
||||
fn get_pseudo_element_type(&self) -> PseudoElementType<()> {
|
||||
self.as_element().map_or(PseudoElementType::Normal, |el| el.get_pseudo_element_type())
|
||||
}
|
||||
|
||||
|
@ -302,7 +301,7 @@ pub trait ThreadSafeLayoutElement
|
|||
|
||||
/// Creates a new `ThreadSafeLayoutElement` for the same `LayoutElement`
|
||||
/// with a different pseudo-element type.
|
||||
fn with_pseudo(&self, pseudo: PseudoElementType<Option<Display>>) -> Self;
|
||||
fn with_pseudo(&self, pseudo: PseudoElementType<()>) -> Self;
|
||||
|
||||
/// Returns the type ID of this node.
|
||||
/// Returns `None` if this is a pseudo-element; otherwise, returns `Some`.
|
||||
|
@ -325,12 +324,12 @@ pub trait ThreadSafeLayoutElement
|
|||
fn style_data(&self) -> AtomicRef<ElementData>;
|
||||
|
||||
#[inline]
|
||||
fn get_pseudo_element_type(&self) -> PseudoElementType<Option<Display>>;
|
||||
fn get_pseudo_element_type(&self) -> PseudoElementType<()>;
|
||||
|
||||
#[inline]
|
||||
fn get_before_pseudo(&self) -> Option<Self> {
|
||||
if self.style_data().styles.pseudos.get(&PseudoElement::Before).is_some() {
|
||||
Some(self.with_pseudo(PseudoElementType::Before(None)))
|
||||
Some(self.with_pseudo(PseudoElementType::Before(())))
|
||||
} else {
|
||||
None
|
||||
}
|
||||
|
@ -339,7 +338,7 @@ pub trait ThreadSafeLayoutElement
|
|||
#[inline]
|
||||
fn get_after_pseudo(&self) -> Option<Self> {
|
||||
if self.style_data().styles.pseudos.get(&PseudoElement::After).is_some() {
|
||||
Some(self.with_pseudo(PseudoElementType::After(None)))
|
||||
Some(self.with_pseudo(PseudoElementType::After(())))
|
||||
} else {
|
||||
None
|
||||
}
|
||||
|
@ -349,7 +348,7 @@ pub trait ThreadSafeLayoutElement
|
|||
fn get_details_summary_pseudo(&self) -> Option<Self> {
|
||||
if self.get_local_name() == &local_name!("details") &&
|
||||
self.get_namespace() == &ns!(html) {
|
||||
Some(self.with_pseudo(PseudoElementType::DetailsSummary(None)))
|
||||
Some(self.with_pseudo(PseudoElementType::DetailsSummary(())))
|
||||
} else {
|
||||
None
|
||||
}
|
||||
|
@ -360,7 +359,7 @@ pub trait ThreadSafeLayoutElement
|
|||
if self.get_local_name() == &local_name!("details") &&
|
||||
self.get_namespace() == &ns!(html) &&
|
||||
self.get_attr(&ns!(), &local_name!("open")).is_some() {
|
||||
Some(self.with_pseudo(PseudoElementType::DetailsContent(None)))
|
||||
Some(self.with_pseudo(PseudoElementType::DetailsContent(())))
|
||||
} else {
|
||||
None
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue