1313//! mode appropriately".
1414
1515use { LocalName , Namespace , QualName , ExpandedName } ;
16- use interface:: { Attribute , TreeSink , QuirksMode , NodeOrText , AppendNode , AppendText } ;
16+ use interface:: { Attribute , TreeSink , QuirksMode , NodeOrText , AppendNode , AppendText , create_element } ;
1717use tendril:: StrTendril ;
1818use tokenizer:: { Tag , StartTag , EndTag } ;
1919use tokenizer:: states:: { RawData , RawKind } ;
@@ -358,8 +358,8 @@ impl<Handle, Sink> TreeBuilderActions<Handle>
358358 } ;
359359 // FIXME: Is there a way to avoid cloning the attributes twice here (once on their
360360 // own, once as part of t.clone() above)?
361- let new_element = self . sink . create_element (
362- QualName :: new ( None , ns ! ( html) , tag. name . clone ( ) ) ,
361+ let new_element = create_element (
362+ & mut self . sink , QualName :: new ( None , ns ! ( html) , tag. name . clone ( ) ) ,
363363 tag. attrs . clone ( ) ) ;
364364 self . open_elems [ node_index] = new_element. clone ( ) ;
365365 self . active_formatting [ node_formatting_index] = Element ( new_element. clone ( ) , tag) ;
@@ -387,8 +387,8 @@ impl<Handle, Sink> TreeBuilderActions<Handle>
387387 // 15.
388388 // FIXME: Is there a way to avoid cloning the attributes twice here (once on their own,
389389 // once as part of t.clone() above)?
390- let new_element = self . sink . create_element (
391- QualName :: new ( None , ns ! ( html) , fmt_elem_tag. name . clone ( ) ) ,
390+ let new_element = create_element (
391+ & mut self . sink , QualName :: new ( None , ns ! ( html) , fmt_elem_tag. name . clone ( ) ) ,
392392 fmt_elem_tag. attrs . clone ( ) ) ;
393393 let new_entry = Element ( new_element. clone ( ) , fmt_elem_tag) ;
394394
@@ -772,8 +772,8 @@ impl<Handle, Sink> TreeBuilderActions<Handle>
772772
773773 //§ creating-and-inserting-nodes
774774 fn create_root ( & mut self , attrs : Vec < Attribute > ) {
775- let elem = self . sink . create_element (
776- QualName :: new ( None , ns ! ( html) , local_name ! ( "html" ) ) ,
775+ let elem = create_element (
776+ & mut self . sink , QualName :: new ( None , ns ! ( html) , local_name ! ( "html" ) ) ,
777777 attrs) ;
778778 self . push ( & elem) ;
779779 self . sink . append ( & self . doc_handle , AppendNode ( elem) ) ;
@@ -791,7 +791,7 @@ impl<Handle, Sink> TreeBuilderActions<Handle>
791791
792792 // Step 7.
793793 let qname = QualName :: new ( None , ns, name) ;
794- let elem = self . sink . create_element ( qname. clone ( ) , attrs. clone ( ) ) ;
794+ let elem = create_element ( & mut self . sink , qname. clone ( ) , attrs. clone ( ) ) ;
795795
796796 let insertion_point = self . appropriate_place_for_insertion ( None ) ;
797797 let tree_node = match insertion_point {
@@ -953,16 +953,8 @@ impl<Handle, Sink> TreeBuilderActions<Handle>
953953 TagToken ( Tag { kind : StartTag , name : local_name ! ( "svg" ) , .. } ) => return false ,
954954 CharacterTokens ( ..) | NullCharacterToken |
955955 TagToken ( Tag { kind : StartTag , .. } ) => {
956- let integration_point = self . sink . elem_any_attr (
957- self . adjusted_current_node ( ) ,
958- |attr_name, attr_value| {
959- attr_name == expanded_name ! ( "" , "encoding" ) && (
960- attr_value. eq_ignore_ascii_case ( "text/html" ) ||
961- attr_value. eq_ignore_ascii_case ( "application/xhtml+xml" )
962- )
963- }
964- ) ;
965- return !integration_point
956+ return !self . sink . is_mathml_annotation_xml_integration_point (
957+ self . adjusted_current_node ( ) )
966958 }
967959 _ => { }
968960 } ;
0 commit comments