Rename ElementType to PseudoElementType, to avoid confusion with ElementTypeId.

This commit is contained in:
Simon Sapin 2014-04-11 17:33:33 +01:00
parent 0275654c4a
commit 49521baee7
3 changed files with 12 additions and 12 deletions

View file

@ -25,7 +25,7 @@ impl<'ln> NodeUtil for ThreadSafeLayoutNode<'ln> {
fn get_css_select_results<'a>(&'a self) -> &'a Arc<ComputedValues> { fn get_css_select_results<'a>(&'a self) -> &'a Arc<ComputedValues> {
unsafe { unsafe {
let layout_data_ref = self.borrow_layout_data(); let layout_data_ref = self.borrow_layout_data();
match self.get_element_type() { match self.get_pseudo_element_type() {
Before | BeforeBlock => { Before | BeforeBlock => {
cast::transmute_region(layout_data_ref.as_ref() cast::transmute_region(layout_data_ref.as_ref()
.unwrap() .unwrap()

View file

@ -487,7 +487,7 @@ impl<'a> FlowConstructor<'a> {
// List of absolute descendants, in tree order. // List of absolute descendants, in tree order.
let mut abs_descendants = Descendants::new(); let mut abs_descendants = Descendants::new();
for kid in node.children() { for kid in node.children() {
if kid.get_element_type() != Normal { if kid.get_pseudo_element_type() != Normal {
self.process(&kid); self.process(&kid);
} }
@ -1127,7 +1127,7 @@ impl<'ln> NodeUtils for ThreadSafeLayoutNode<'ln> {
let mut layout_data_ref = self.mutate_layout_data(); let mut layout_data_ref = self.mutate_layout_data();
match &mut *layout_data_ref { match &mut *layout_data_ref {
&Some(ref mut layout_data) =>{ &Some(ref mut layout_data) =>{
match self.get_element_type() { match self.get_pseudo_element_type() {
Before | BeforeBlock => { Before | BeforeBlock => {
layout_data.data.before_flow_construction_result = result 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(); let mut layout_data_ref = self.mutate_layout_data();
match &mut *layout_data_ref { match &mut *layout_data_ref {
&Some(ref mut layout_data) => { &Some(ref mut layout_data) => {
match self.get_element_type() { match self.get_pseudo_element_type() {
Before | BeforeBlock => { Before | BeforeBlock => {
mem::replace(&mut layout_data.data.before_flow_construction_result, mem::replace(&mut layout_data.data.before_flow_construction_result,
NoConstructionResult) NoConstructionResult)

View file

@ -396,7 +396,7 @@ fn get_content(content_list: &content::T) -> ~str {
} }
#[deriving(Eq, Clone)] #[deriving(Eq, Clone)]
pub enum ElementType { pub enum PseudoElementType {
Normal, Normal,
Before, Before,
After, After,
@ -411,7 +411,7 @@ pub struct ThreadSafeLayoutNode<'ln> {
/// The wrapped node. /// The wrapped node.
priv node: LayoutNode<'ln>, priv node: LayoutNode<'ln>,
priv pseudo: ElementType, priv pseudo: PseudoElementType,
} }
impl<'ln> TLayoutNode for ThreadSafeLayoutNode<'ln> { 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 { ThreadSafeLayoutNode {
node: node.clone(), node: node.clone(),
pseudo: element_type, pseudo: pseudo,
} }
} }
/// Creates a new `ThreadSafeLayoutNode` from the given `LayoutNode`. /// 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 { ThreadSafeLayoutNode {
node: self.node.clone(), 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 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 mut layout_data_ref = self.mutate_layout_data();
let node_layout_data_wrapper = layout_data_ref.get_mut_ref(); let node_layout_data_wrapper = layout_data_ref.get_mut_ref();