Class: Gammo::Parser::InCaption
Overview
Instance Attribute Summary
#parser
Instance Method Summary
collapse
#initialize, #process
Instance Method Details
#default(_) ⇒ Object
42
43
44
|
# File 'lib/gammo/parser/insertion_mode/in_caption.rb', line 42
def default(_)
halt InBody.new(parser).process
end
|
#end_tag_token(token) ⇒ Object
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
# File 'lib/gammo/parser/insertion_mode/in_caption.rb', line 22
def end_tag_token(token)
case token.tag
when Tags::Caption
if parser.pop_until(TABLE_SCOPE, Tags::Caption)
parser.clear_active_formatting_elements
parser.insertion_mode = InTable
end
halt true
when Tags::Table
halt true unless parser.pop_until(TABLE_SCOPE, Tags::Caption)
parser.clear_active_formatting_elements
parser.insertion_mode = InTable
halt false
when Tags::Body, Tags::Col, Tags::Colgroup, Tags::Html, Tags::Tbody, Tags::Td, Tags::Tfoot, Tags::Th, Tags::Thead, Tags::Tr
halt true
end
end
|
#start_tag_token(token) ⇒ Object
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
# File 'lib/gammo/parser/insertion_mode/in_caption.rb', line 5
def start_tag_token(token)
case token.tag
when Tags::Caption, Tags::Col, Tags::Colgroup, Tags::Tbody, Tags::Td, Tags::Tfoot, Tags::Thead, Tags::Tr
halt true unless parser.pop_until(TABLE_SCOPE, Tags::Caption)
parser.clear_active_formatting_elements
parser.insertion_mode = InTable
halt false
when Tags::Select
parser.reconstruct_active_formatting_elements
parser.add_element
parser.frameset_ok = false
parser.insertion_mode = InSelectInTable
halt true
end
end
|