Class: Gammo::Parser::InHeadNoscript
Overview
Instance Attribute Summary
#parser
Instance Method Summary
collapse
#initialize, #process
Instance Method Details
#character_token(token) ⇒ Object
39
40
41
|
# File 'lib/gammo/parser/insertion_mode/in_head_noscript.rb', line 39
def character_token(token)
halt InHead.new(parser).process if token.data.lstrip == ''
end
|
10
11
12
|
# File 'lib/gammo/parser/insertion_mode/in_head_noscript.rb', line 10
def (_)
halt InHead.new(parser).process
end
|
#default(token) ⇒ Object
43
44
45
46
47
48
49
|
# File 'lib/gammo/parser/insertion_mode/in_head_noscript.rb', line 43
def default(token)
parser.open_elements.pop
raise ParseError, 'the new current node will be a head element.'\
if parser.top.tag != Tags::Head
parser.insertion_mode = InHead
halt false
end
|
#doctype_token(_) ⇒ Object
5
6
7
8
|
# File 'lib/gammo/parser/insertion_mode/in_head_noscript.rb', line 5
def doctype_token(_)
halt true
end
|
#end_tag_token(token) ⇒ Object
25
26
27
28
29
30
31
32
33
34
35
36
37
|
# File 'lib/gammo/parser/insertion_mode/in_head_noscript.rb', line 25
def end_tag_token(token)
case token.tag
when Tags::Noscript
parser.open_elements.pop
parser.insertion_mode = InHead
halt true
when Tags::Br
else
halt true
end
end
|
#start_tag_token(token) ⇒ Object
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/gammo/parser/insertion_mode/in_head_noscript.rb', line 14
def start_tag_token(token)
case token.tag
when Tags::Html then halt InBody.new(parser).process
when Tags::Basefont, Tags::Bgsound, Tags::Link, Tags::Meta, Tags::Noframes, Tags::Style
halt InHead.new(parser).process
when Tags::Head, Tags::Noscript
halt true
end
end
|