mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Eliminate untraversed node types from LayoutNodeType.
MozReview-Commit-ID: 926ReI1BSsf
This commit is contained in:
parent
6b40f97289
commit
97fd61f512
4 changed files with 5 additions and 30 deletions
|
@ -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),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue