Class: Gammo::Parser::AfterAfterBody

Inherits:
InsertionMode show all
Defined in:
lib/gammo/parser/insertion_mode/after_after_body.rb

Overview

Section 12.2.6.4.22.

Instance Attribute Summary

Attributes inherited from InsertionMode

#parser

Instance Method Summary collapse

Methods inherited from InsertionMode

#initialize, #process

Constructor Details

This class inherits a constructor from Gammo::Parser::InsertionMode

Instance Method Details

#character_token(token) ⇒ Object



10
11
12
# File 'lib/gammo/parser/insertion_mode/after_after_body.rb', line 10

def character_token(token)
  halt InBody.new(parser).process if token.data.lstrip.length.zero?
end

#comment_token(token) ⇒ Object



21
22
23
24
# File 'lib/gammo/parser/insertion_mode/after_after_body.rb', line 21

def comment_token(token)
  parser.document.append_child Node::Comment.new(data: token.data)
  halt true
end

#default(_) ⇒ Object



30
31
32
33
# File 'lib/gammo/parser/insertion_mode/after_after_body.rb', line 30

def default(_)
  parser.insertion_mode = InBody
  halt false
end

#doctype_token(token) ⇒ Object



26
27
28
# File 'lib/gammo/parser/insertion_mode/after_after_body.rb', line 26

def doctype_token(token)
  halt InBody.new(parser).process
end

#error_token(_) ⇒ Object



5
6
7
8
# File 'lib/gammo/parser/insertion_mode/after_after_body.rb', line 5

def error_token(_)
  # ignore the token
  halt true
end

#start_tag_token(token) ⇒ Object



14
15
16
17
18
19
# File 'lib/gammo/parser/insertion_mode/after_after_body.rb', line 14

def start_tag_token(token)
  case token.tag
  when Tags::Html
    halt InBody.new(parser).process
  end
end