last_template = null
last_template_i = null
for el, i in open_els
- if el.name is 'template'
+ if el.name is 'template' and el.namespace is NS_HTML
last_template = el
last_template_i = i
break
last_table = null
last_table_i
for el, i in open_els
- if el.name is 'table'
+ if el.name is 'table' and el.namespace is NS_HTML
last_table = el
last_table_i = i
break
# this is odd
target = open_els[open_els.length - 1]
target_i = target.children.length
+ break
# 5. If last table has a parent element, then let adjusted
# insertion location be inside last table's parent element,
# immediately before last table, and abort these substeps.
return
return
- ins_mode_in_table_else = (t) ->
- parse_error()
- flag_foster_parenting = true # FIXME
- ins_mode_in_body t
- flag_foster_parenting = false
- can_in_table = { # FIXME do this inline like everywhere else
- 'table': true
- 'tbody': true
- 'tfoot': true
- 'thead': true
- 'tr': true
- }
-
# 8.2.5.4.8 http://www.w3.org/TR/html5/syntax.html#parsing-main-incdata
ins_mode_text = (t) ->
if t.type is TYPE_TEXT
# http://www.w3.org/TR/html5/syntax.html#tokenization
# 8.2.5.4.9 http://www.w3.org/TR/html5/syntax.html#parsing-main-intable
+ ins_mode_in_table_else = (t) ->
+ parse_error()
+ flag_foster_parenting = true
+ ins_mode_in_body t
+ flag_foster_parenting = false
+ return
+ can_in_table = { # FIXME do this inline like everywhere else
+ 'table': true
+ 'tbody': true
+ 'tfoot': true
+ 'thead': true
+ 'tr': true
+ }
ins_mode_in_table = (t) ->
switch t.type
when TYPE_TEXT
when 'style', 'script', 'template'
ins_mode_in_head t
when 'input'
- if is_input_hidden_tok t
+ unless is_input_hidden_tok t
ins_mode_in_table_else t
else
parse_error()