Class: Gammo::Parser::InColumnGroup
Overview
Instance Attribute Summary
#parser
Instance Method Summary
collapse
#initialize, #process
Instance Method Details
#character_token(token) ⇒ Object
5
6
7
8
9
10
11
12
13
|
# File 'lib/gammo/parser/insertion_mode/in_column_group.rb', line 5
def character_token(token)
s = token.data.lstrip
if s.length < token.data.length
parser.add_text token.data.slice(0, token.data.length - s.length)
halt true if s == ''
token.data = s
end
end
|
15
16
17
18
|
# File 'lib/gammo/parser/insertion_mode/in_column_group.rb', line 15
def (token)
parser.add_child(Node::Comment.new(data: token.data))
halt true
end
|
#default(_) ⇒ Object
58
59
60
61
62
63
|
# File 'lib/gammo/parser/insertion_mode/in_column_group.rb', line 58
def default(_)
halt true if parser.top.tag != Tags::Colgroup
parser.open_elements.pop
parser.insertion_mode = InTable
halt false
end
|
#doctype_token(_) ⇒ Object
20
21
22
|
# File 'lib/gammo/parser/insertion_mode/in_column_group.rb', line 20
def doctype_token(_)
halt true
end
|
#end_tag_token(token) ⇒ Object
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
# File 'lib/gammo/parser/insertion_mode/in_column_group.rb', line 38
def end_tag_token(token)
case token.tag
when Tags::Colgroup
if parser.top.tag == Tags::Colgroup
parser.open_elements.pop
parser.insertion_mode = InTable
end
halt true
when Tags::Col
halt true
when Tags::Template
halt InHead.new(parser).process
end
end
|
#error_token(_) ⇒ Object
54
55
56
|
# File 'lib/gammo/parser/insertion_mode/in_column_group.rb', line 54
def error_token(_)
halt InBody.new(parser).process
end
|
#start_tag_token(token) ⇒ Object
24
25
26
27
28
29
30
31
32
33
34
35
36
|
# File 'lib/gammo/parser/insertion_mode/in_column_group.rb', line 24
def start_tag_token(token)
case token.tag
when Tags::Html
halt InBody.new(parser).process
when Tags::Col
parser.add_element
parser.open_elements.pop
parser.acknowledge_self_closing_tag
halt true
when Tags::Template
halt InHead.new(parser).process
end
end
|