Implement type_id as inherent methods.

This implies LayoutNode no longer needs to return an Option, as it never
represents a pseudo-element.

Also, fixes lies in the documentation.
This commit is contained in:
Ms2ger 2015-06-21 16:36:03 +02:00
parent f0034b4ac9
commit dc167ca343
3 changed files with 22 additions and 24 deletions

View file

@ -13,7 +13,7 @@ use data::{LayoutDataAccess, LayoutDataWrapper};
use incremental::{self, RestyleDamage};
use opaque_node::OpaqueNodeMethods;
use smallvec::SmallVec16;
use wrapper::{LayoutElement, LayoutNode, TLayoutNode};
use wrapper::{LayoutElement, LayoutNode};
use script::dom::characterdata::CharacterDataTypeId;
use script::dom::node::NodeTypeId;
@ -677,7 +677,7 @@ impl<'ln> MatchMethods for LayoutNode<'ln> {
&mut None => panic!("no layout data"),
&mut Some(ref mut layout_data) => {
match self.type_id() {
Some(NodeTypeId::CharacterData(CharacterDataTypeId::Text)) => {
NodeTypeId::CharacterData(CharacterDataTypeId::Text) => {
// Text nodes get a copy of the parent style. This ensures
// that during fragment construction any non-inherited
// CSS properties (such as vertical-align) are correctly