Class: Gammo::Parser::AfterAfterFrameset

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

Overview

Section 12.2.6.4.23.

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

#comment_token(token) ⇒ Object



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

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

#default(_) ⇒ Object



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

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

#doctype_token(token) ⇒ Object



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

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

#start_tag_token(token) ⇒ Object



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

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

#text_token(token) ⇒ Object



9
10
11
# File 'lib/gammo/parser/insertion_mode/after_after_frameset.rb', line 9

def text_token(token)
  halt InBody.new(parser).process unless token.data.gsub(/[^\s]/, '').empty?
end