Add missing actions in CreateContextualFragment method

This commit is contained in:
Guillaume Gomez 2016-11-14 21:11:23 +01:00
parent 00f229d615
commit 861bcb2b79
13 changed files with 14 additions and 22 deletions

View file

@ -903,9 +903,9 @@ impl RangeMethods for Range {
let node = self.StartContainer();
let element = match node.type_id() {
NodeTypeId::Document(_) | NodeTypeId::DocumentFragment => None,
NodeTypeId::Element(_) => Some(node),
NodeTypeId::Element(_) => Some(Root::downcast::<Element>(node).unwrap()),
NodeTypeId::CharacterData(CharacterDataTypeId::Comment) |
NodeTypeId::CharacterData(CharacterDataTypeId::Text) => node.GetParentNode(),
NodeTypeId::CharacterData(CharacterDataTypeId::Text) => node.GetParentElement(),
NodeTypeId::CharacterData(CharacterDataTypeId::ProcessingInstruction) |
NodeTypeId::DocumentType => unreachable!(),
};
@ -928,6 +928,7 @@ impl RangeMethods for Range {
for node in fragment_node.upcast::<Node>().traverse_preorder() {
if let Some(script) = node.downcast::<HTMLScriptElement>() {
script.set_already_started(false);
script.set_parser_inserted(false);
}
}