Class: Gammo::Parser::AfterFrameset

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

Overview

Section 12.2.6.4.21.

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



11
12
13
14
# File 'lib/gammo/parser/insertion_mode/after_frameset.rb', line 11

def character_token(token)
  s = token.data.gsub(/[^\s]/, '')
  parser.add_text(s) unless s.empty?
end

#comment_token(token) ⇒ Object



7
8
9
# File 'lib/gammo/parser/insertion_mode/after_frameset.rb', line 7

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

#default(_) ⇒ Object



33
34
35
36
# File 'lib/gammo/parser/insertion_mode/after_frameset.rb', line 33

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

#end_tag_token(token) ⇒ Object



25
26
27
28
29
30
31
# File 'lib/gammo/parser/insertion_mode/after_frameset.rb', line 25

def end_tag_token(token)
  case token.tag
  when Tags::Html
    parser.insertion_mode = AfterAfterFrameset
    halt true
  end
end

#start_tag_token(token) ⇒ Object



16
17
18
19
20
21
22
23
# File 'lib/gammo/parser/insertion_mode/after_frameset.rb', line 16

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