Eliminate untraversed node types from LayoutNodeType.

MozReview-Commit-ID: 926ReI1BSsf
This commit is contained in:
Bobby Holley 2016-10-25 13:52:27 -07:00
parent 6b40f97289
commit 97fd61f512
4 changed files with 5 additions and 30 deletions

View file

@ -2654,20 +2654,11 @@ impl Into<LayoutNodeType> for NodeTypeId {
#[inline(always)]
fn into(self) -> LayoutNodeType {
match self {
NodeTypeId::CharacterData(CharacterDataTypeId::Comment) =>
LayoutNodeType::Comment,
NodeTypeId::Document(..) =>
LayoutNodeType::Document,
NodeTypeId::DocumentFragment =>
LayoutNodeType::DocumentFragment,
NodeTypeId::DocumentType =>
LayoutNodeType::DocumentType,
NodeTypeId::Element(e) =>
LayoutNodeType::Element(e.into()),
NodeTypeId::CharacterData(CharacterDataTypeId::ProcessingInstruction) =>
LayoutNodeType::ProcessingInstruction,
NodeTypeId::CharacterData(CharacterDataTypeId::Text) =>
LayoutNodeType::Text,
x => unreachable!("Layout should not traverse nodes of type {:?}", x),
}
}
}