From 49521baee7507dc0e5a85a626e98c2373e6e9d7a Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Fri, 11 Apr 2014 17:33:33 +0100 Subject: [PATCH] Rename ElementType to PseudoElementType, to avoid confusion with ElementTypeId. --- src/components/main/css/node_util.rs | 2 +- src/components/main/layout/construct.rs | 6 +++--- src/components/main/layout/wrapper.rs | 16 ++++++++-------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/components/main/css/node_util.rs b/src/components/main/css/node_util.rs index f449a99ac44..5c88632eb55 100644 --- a/src/components/main/css/node_util.rs +++ b/src/components/main/css/node_util.rs @@ -25,7 +25,7 @@ impl<'ln> NodeUtil for ThreadSafeLayoutNode<'ln> { fn get_css_select_results<'a>(&'a self) -> &'a Arc { unsafe { let layout_data_ref = self.borrow_layout_data(); - match self.get_element_type() { + match self.get_pseudo_element_type() { Before | BeforeBlock => { cast::transmute_region(layout_data_ref.as_ref() .unwrap() diff --git a/src/components/main/layout/construct.rs b/src/components/main/layout/construct.rs index bf5ed0673d0..e3be9167d39 100644 --- a/src/components/main/layout/construct.rs +++ b/src/components/main/layout/construct.rs @@ -487,7 +487,7 @@ impl<'a> FlowConstructor<'a> { // List of absolute descendants, in tree order. let mut abs_descendants = Descendants::new(); for kid in node.children() { - if kid.get_element_type() != Normal { + if kid.get_pseudo_element_type() != Normal { self.process(&kid); } @@ -1127,7 +1127,7 @@ impl<'ln> NodeUtils for ThreadSafeLayoutNode<'ln> { let mut layout_data_ref = self.mutate_layout_data(); match &mut *layout_data_ref { &Some(ref mut layout_data) =>{ - match self.get_element_type() { + match self.get_pseudo_element_type() { Before | BeforeBlock => { layout_data.data.before_flow_construction_result = result }, @@ -1146,7 +1146,7 @@ impl<'ln> NodeUtils for ThreadSafeLayoutNode<'ln> { let mut layout_data_ref = self.mutate_layout_data(); match &mut *layout_data_ref { &Some(ref mut layout_data) => { - match self.get_element_type() { + match self.get_pseudo_element_type() { Before | BeforeBlock => { mem::replace(&mut layout_data.data.before_flow_construction_result, NoConstructionResult) diff --git a/src/components/main/layout/wrapper.rs b/src/components/main/layout/wrapper.rs index 6687c9c0e48..85ada5e486e 100644 --- a/src/components/main/layout/wrapper.rs +++ b/src/components/main/layout/wrapper.rs @@ -396,7 +396,7 @@ fn get_content(content_list: &content::T) -> ~str { } #[deriving(Eq, Clone)] -pub enum ElementType { +pub enum PseudoElementType { Normal, Before, After, @@ -411,7 +411,7 @@ pub struct ThreadSafeLayoutNode<'ln> { /// The wrapped node. priv node: LayoutNode<'ln>, - priv pseudo: ElementType, + priv pseudo: PseudoElementType, } impl<'ln> TLayoutNode for ThreadSafeLayoutNode<'ln> { @@ -497,19 +497,19 @@ impl<'ln> ThreadSafeLayoutNode<'ln> { } } - pub fn new_with_pseudo_without_self<'a>(node: &LayoutNode<'a>, element_type: ElementType) -> ThreadSafeLayoutNode<'a> { + pub fn new_with_pseudo_without_self<'a>(node: &LayoutNode<'a>, pseudo: PseudoElementType) -> ThreadSafeLayoutNode<'a> { ThreadSafeLayoutNode { node: node.clone(), - pseudo: element_type, + pseudo: pseudo, } } /// Creates a new `ThreadSafeLayoutNode` from the given `LayoutNode`. - pub fn new_with_pseudo<'a>(&'a self, element_type: ElementType) -> ThreadSafeLayoutNode<'a> { + pub fn new_with_pseudo<'a>(&'a self, pseudo: PseudoElementType) -> ThreadSafeLayoutNode<'a> { ThreadSafeLayoutNode { node: self.node.clone(), - pseudo: element_type, + pseudo: pseudo, } } @@ -544,11 +544,11 @@ impl<'ln> ThreadSafeLayoutNode<'ln> { } } - pub fn get_element_type(&self) -> ElementType { + pub fn get_pseudo_element_type(&self) -> PseudoElementType { self.pseudo } - pub fn is_block(&self, kind: ElementType) -> bool { + pub fn is_block(&self, kind: PseudoElementType) -> bool { let mut layout_data_ref = self.mutate_layout_data(); let node_layout_data_wrapper = layout_data_ref.get_mut_ref();