Method: HTML5::Phase#process_eof

Defined in:
lib/html5/html5parser/phase.rb

#process_eofObject



86
87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/html5/html5parser/phase.rb', line 86

def process_eof
  @tree.generateImpliedEndTags

  if @tree.open_elements.length > 2
    parse_error("expected-closing-tag-but-got-eof")
  elsif @tree.open_elements.length == 2 and @tree.open_elements[1].name != 'body'
    # This happens for framesets or something?
    parse_error("expected-closing-tag-but-got-eof")
  elsif @parser.inner_html and @tree.open_elements.length > 1 
    # XXX This is not what the specification says. Not sure what to do here.
    parse_error("eof-in-innerhtml")
  end
  # Betting ends.
end