Class: HTML5::BeforeHeadPhase

Inherits:
Phase
  • Object
show all
Defined in:
lib/html5/html5parser/before_head_phase.rb

Instance Method Summary collapse

Methods inherited from Phase

#adjust_foreign_attributes, #adjust_mathml_attributes, #assert, end_tag_handlers, handle_end, handle_start, #in_scope?, #initialize, #processComment, #processDoctype, #processEndTag, #processStartTag, #remove_open_elements_until, #startTagHtml, start_tag_handlers, tag_handlers

Constructor Details

This class inherits a constructor from HTML5::Phase

Instance Method Details

#endTagImplyHead(name) ⇒ Object



34
35
36
37
# File 'lib/html5/html5parser/before_head_phase.rb', line 34

def endTagImplyHead(name)
  startTagHead('head', {})
  @parser.phase.processEndTag(name)
end

#endTagOther(name) ⇒ Object



39
40
41
# File 'lib/html5/html5parser/before_head_phase.rb', line 39

def endTagOther(name)
  parse_error("end-tag-after-implied-root", {"name" => name})
end

#process_eofObject



10
11
12
13
# File 'lib/html5/html5parser/before_head_phase.rb', line 10

def process_eof
  startTagHead('head', {})
  @parser.phase.process_eof
end

#processCharacters(data) ⇒ Object



18
19
20
21
# File 'lib/html5/html5parser/before_head_phase.rb', line 18

def processCharacters(data)
  startTagHead('head', {})
  @parser.phase.processCharacters(data)
end

#processSpaceCharacters(data) ⇒ Object



15
16
# File 'lib/html5/html5parser/before_head_phase.rb', line 15

def processSpaceCharacters(data)
end

#startTagHead(name, attributes) ⇒ Object



23
24
25
26
27
# File 'lib/html5/html5parser/before_head_phase.rb', line 23

def startTagHead(name, attributes)
  @tree.insert_element(name, attributes)
  @tree.head_pointer = @tree.open_elements[-1]
  @parser.phase = @parser.phases[:inHead]
end

#startTagOther(name, attributes) ⇒ Object



29
30
31
32
# File 'lib/html5/html5parser/before_head_phase.rb', line 29

def startTagOther(name, attributes)
  startTagHead('head', {})
  @parser.phase.processStartTag(name, attributes)
end