class Gammo::Parser::InSelectInTable

Section 12.2.6.4.17.

Public Instance Methods

default(_) click to toggle source
# File lib/gammo/parser/insertion_mode/in_select_in_table.rb, line 41
def default(_)
  halt InSelect.new(parser).process
end
end_tag_token(token) click to toggle source
# File lib/gammo/parser/insertion_mode/in_select_in_table.rb, line 23
def end_tag_token(token)
  case token.tag
  when Tags::Caption, Tags::Table, Tags::Tbody, Tags::Tfoot, Tags::Thead, Tags::Tr, Tags::Td, Tags::Th
    if token.instance_of?(Tokenizer::EndTagToken) && !parser.element_in_scope?(TABLE_SCOPE, token.tag)
      # ignore the token
      halt true
    end
    parser.open_elements.reverse_each_with_index do |elm, i|
      if elm.tag == Tags::Select
        parser.open_elements = parser.open_elements.slice(0, i)
        break
      end
    end
    parser.reset_insertion_mode
    halt false
  end
end
start_tag_token(token) click to toggle source
# File lib/gammo/parser/insertion_mode/in_select_in_table.rb, line 5
def start_tag_token(token)
  case token.tag
  when Tags::Caption, Tags::Table, Tags::Tbody, Tags::Tfoot, Tags::Thead, Tags::Tr, Tags::Td, Tags::Th
    if token.instance_of?(Tokenizer::EndTagToken) && parser.element_in_scope?(TABLE_SCOPE, token.tag)
      # ignore the token
      halt true
    end
    parser.open_elements.reverse_each_with_index do |elm, i|
      if elm.tag == Tags::Select
        parser.open_elements = parser.open_elements.slice(0, i)
        break
      end
    end
    parser.reset_insertion_mode
    halt false
  end
end