Class: HTML5::InColumnGroupPhase

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

Instance Method Summary collapse

Methods inherited from Phase

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

Constructor Details

This class inherits a constructor from HTML5::Phase

Instance Method Details

#endTagCol(name) ⇒ Object



44
45
46
# File 'lib/html5/html5parser/in_column_group_phase.rb', line 44

def endTagCol(name)
  parse_error("no-end-tag", {"name" => "col"})
end

#endTagColgroup(name) ⇒ Object



33
34
35
36
37
38
39
40
41
42
# File 'lib/html5/html5parser/in_column_group_phase.rb', line 33

def endTagColgroup(name)
  if ignoreEndTagColgroup
    # inner_html case
    assert @parser.inner_html
    parse_error
  else
    @tree.open_elements.pop
    @parser.phase = @parser.phases[:inTable]
  end
end

#endTagOther(name) ⇒ Object



48
49
50
51
52
# File 'lib/html5/html5parser/in_column_group_phase.rb', line 48

def endTagOther(name)
  ignoreEndTag = ignoreEndTagColgroup
  endTagColgroup('colgroup')
  @parser.phase.processEndTag(name) unless ignoreEndTag
end

#ignoreEndTagColgroupObject



12
13
14
# File 'lib/html5/html5parser/in_column_group_phase.rb', line 12

def ignoreEndTagColgroup
  @tree.open_elements[-1].name == 'html'
end

#processCharacters(data) ⇒ Object



16
17
18
19
20
# File 'lib/html5/html5parser/in_column_group_phase.rb', line 16

def processCharacters(data)
  ignoreEndTag = ignoreEndTagColgroup
  endTagColgroup("colgroup")
  @parser.phase.processCharacters(data) unless ignoreEndTag
end

#startTagCol(name, attributes) ⇒ Object



22
23
24
25
# File 'lib/html5/html5parser/in_column_group_phase.rb', line 22

def startTagCol(name, attributes)
  @tree.insert_element(name, attributes)
  @tree.open_elements.pop
end

#startTagOther(name, attributes) ⇒ Object



27
28
29
30
31
# File 'lib/html5/html5parser/in_column_group_phase.rb', line 27

def startTagOther(name, attributes)
  ignoreEndTag = ignoreEndTagColgroup
  endTagColgroup('colgroup')
  @parser.phase.processStartTag(name, attributes) unless ignoreEndTag
end