Class: Gammo::Parser::InFrameset
Overview
Instance Attribute Summary
#parser
Instance Method Summary
collapse
#initialize, #process
Instance Method Details
#character_token(token) ⇒ Object
9
10
11
12
|
# File 'lib/gammo/parser/insertion_mode/in_frameset.rb', line 9
def character_token(token)
text = token.data.each_char.with_object(String.new) { |c, s| s << c if c == ?\s }
parser.add_text(text) if text != ''
end
|
5
6
7
|
# File 'lib/gammo/parser/insertion_mode/in_frameset.rb', line 5
def (token)
parser.add_child Node::.new(data: token.data)
end
|
#default(_) ⇒ Object
42
43
44
45
|
# File 'lib/gammo/parser/insertion_mode/in_frameset.rb', line 42
def default(_)
halt true
end
|
#end_tag_token(token) ⇒ Object
29
30
31
32
33
34
35
36
37
38
39
40
|
# File 'lib/gammo/parser/insertion_mode/in_frameset.rb', line 29
def end_tag_token(token)
case token.tag
when Tags::Frameset
if parser.open_elements.last.tag != Tags::Html
parser.open_elements.pop
if parser.open_elements.last.tag != Tags::Frameset
parser.insertion_mode = AfterFrameset
halt true
end
end
end
end
|
#start_tag_token(token) ⇒ Object
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
# File 'lib/gammo/parser/insertion_mode/in_frameset.rb', line 14
def start_tag_token(token)
case token.tag
when Tags::Html
halt InBody.new(parser).process
when Tags::Frameset
parser.add_element
when Tags::Frame
parser.add_element
parser.open_elements.pop
parser.acknowledge_self_closing_tag
when Tags::Noframes
halt InHead.new(parser).process
end
end
|