2007-07-05 00:36:59 +02:00
|
|
|
require 'html5/html5parser/phase'
|
2007-05-30 17:45:52 +02:00
|
|
|
|
2007-07-05 00:36:59 +02:00
|
|
|
module HTML5
|
2007-05-30 17:45:52 +02:00
|
|
|
class TrailingEndPhase < Phase
|
|
|
|
|
2007-08-30 19:19:10 +02:00
|
|
|
def process_eof
|
2007-05-30 17:45:52 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
def processComment(data)
|
2007-08-30 19:19:10 +02:00
|
|
|
@tree.insert_comment(data, @tree.document)
|
2007-05-30 17:45:52 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
def processSpaceCharacters(data)
|
2007-08-30 19:19:10 +02:00
|
|
|
@parser.last_phase.processSpaceCharacters(data)
|
2007-05-30 17:45:52 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
def processCharacters(data)
|
2007-09-10 05:26:19 +02:00
|
|
|
parse_error("expected-eof-but-got-char")
|
2007-08-30 19:19:10 +02:00
|
|
|
@parser.phase = @parser.last_phase
|
2007-05-30 17:45:52 +02:00
|
|
|
@parser.phase.processCharacters(data)
|
|
|
|
end
|
|
|
|
|
|
|
|
def processStartTag(name, attributes)
|
2007-09-10 05:26:19 +02:00
|
|
|
parse_error("expected-eof-but-got-start-tag", {"name" => name})
|
2007-08-30 19:19:10 +02:00
|
|
|
@parser.phase = @parser.last_phase
|
2007-05-30 17:45:52 +02:00
|
|
|
@parser.phase.processStartTag(name, attributes)
|
|
|
|
end
|
|
|
|
|
|
|
|
def processEndTag(name)
|
2007-09-10 05:26:19 +02:00
|
|
|
parse_error("expected-eof-but-got-end-tag", {"name" => name})
|
2007-08-30 19:19:10 +02:00
|
|
|
@parser.phase = @parser.last_phase
|
2007-05-30 17:45:52 +02:00
|
|
|
@parser.phase.processEndTag(name)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|