class Gammo::Parser::InHeadNoscript
12.2.6.4.5.
Public Instance Methods
comment_token(_)
click to toggle source
# File lib/gammo/parser/insertion_mode/in_head_noscript.rb, line 10 def comment_token(_) halt InHead.new(parser).process end
default(token)
click to toggle source
# 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(_)
click to toggle source
# File lib/gammo/parser/insertion_mode/in_head_noscript.rb, line 5 def doctype_token(_) # ignore the token. halt true end
end_tag_token(token)
click to toggle source
# 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 # no-op else # ignore the token. halt true end end
start_tag_token(token)
click to toggle source
# 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 # ignore the token. halt true end end
text_token(token)
click to toggle source
# File lib/gammo/parser/insertion_mode/in_head_noscript.rb, line 39 def text_token(token) halt InHead.new(parser).process if token.data.lstrip == '' end