class Gammo::Parser::InCell

Section 12.2.6.4.15.

Public Instance Methods

default(_) click to toggle source
# File lib/gammo/parser/insertion_mode/in_cell.rb, line 41
def default(_)
  halt InBody.new(parser).process
end
end_tag_token(token) click to toggle source
# File lib/gammo/parser/insertion_mode/in_cell.rb, line 21
def end_tag_token(token)
  case token.tag
  when Tags::Td, Tags::Th
    # ignore the token
    halt true unless parser.pop_until(TABLE_SCOPE, token.tag)
    parser.clear_active_formatting_elements
    parser.insertion_mode = InRow
    halt true
  when Tags::Body, Tags::Caption, Tags::Col, Tags::Colgroup, Tags::Html
    # ignore the token
    halt true
  when Tags::Table, Tags::Tbody, Tags::Tfoot, Tags::Thead, Tags::Tr
    # ignore the token
    halt true unless parser.element_in_scope?(TABLE_SCOPE, token.tag)
    parser.clear_active_formatting_elements if parser.pop_until(TABLE_SCOPE, Tags::Td, Tags::Th)
    parser.insertion_mode = InRow
    halt false
  end
end
start_tag_token(token) click to toggle source
# File lib/gammo/parser/insertion_mode/in_cell.rb, line 5
def start_tag_token(token)
  case token.tag
  when Tags::Caption, Tags::Col, Tags::Colgroup, Tags::Tbody, Tags::Td, Tags::Tfoot, Tags::Th, Tags::Thead, Tags::Tr
    halt true unless parser.pop_until(TABLE_SCOPE, Tags::Td, Tags::Th)
    parser.clear_active_formatting_elements
    parser.insertion_mode = InRow
    halt false
  when Tags::Select
    parser.reconstruct_active_formatting_elements
    parser.add_element
    parser.frameset_ok = false
    parser.insertion_mode = InSelectInTable
    halt true
  end
end