Class: HTML5::InRowPhase

Inherits:
Phase
  • Object
show all
Defined in:
lib/feed_tools/vendor/html5/lib/html5/html5parser/in_row_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

#endTagIgnore(name) ⇒ Object



64
65
66
67
# File 'lib/feed_tools/vendor/html5/lib/html5/html5parser/in_row_phase.rb', line 64

def endTagIgnore(name)
  parse_error("unexpected-end-tag-in-table-row",
          {"name" => name})
end

#endTagOther(name) ⇒ Object



69
70
71
# File 'lib/feed_tools/vendor/html5/lib/html5/html5parser/in_row_phase.rb', line 69

def endTagOther(name)
  @parser.phases[:inTable].processEndTag(name)
end

#endTagTable(name) ⇒ Object



46
47
48
49
50
51
52
# File 'lib/feed_tools/vendor/html5/lib/html5/html5parser/in_row_phase.rb', line 46

def endTagTable(name)
  ignoreEndTag = ignoreEndTagTr
  endTagTr('tr')
  # Reprocess the current tag if the tr end tag was not ignored
  # XXX how are we sure it's always ignored in the inner_html case?
  @parser.phase.processEndTag(name) unless ignoreEndTag
end

#endTagTableRowGroup(name) ⇒ Object



54
55
56
57
58
59
60
61
62
# File 'lib/feed_tools/vendor/html5/lib/html5/html5parser/in_row_phase.rb', line 54

def endTagTableRowGroup(name)
  if in_scope?(name, true)
    endTagTr('tr')
    @parser.phase.processEndTag(name)
  else
    # inner_html case
    parse_error
  end
end

#endTagTr(name) ⇒ Object



34
35
36
37
38
39
40
41
42
43
44
# File 'lib/feed_tools/vendor/html5/lib/html5/html5parser/in_row_phase.rb', line 34

def endTagTr(name)
  if ignoreEndTagTr
    # inner_html case
    assert @parser.inner_html
    parse_error
  else
    clearStackToTableRowContext
    @tree.open_elements.pop
    @parser.phase = @parser.phases[:inTableBody]
  end
end

#processCharacters(data) ⇒ Object



12
13
14
# File 'lib/feed_tools/vendor/html5/lib/html5/html5parser/in_row_phase.rb', line 12

def processCharacters(data)
  @parser.phases[:inTable].processCharacters(data)
end

#startTagOther(name, attributes) ⇒ Object



30
31
32
# File 'lib/feed_tools/vendor/html5/lib/html5/html5parser/in_row_phase.rb', line 30

def startTagOther(name, attributes)
  @parser.phases[:inTable].processStartTag(name, attributes)
end

#startTagTableCell(name, attributes) ⇒ Object



16
17
18
19
20
21
# File 'lib/feed_tools/vendor/html5/lib/html5/html5parser/in_row_phase.rb', line 16

def startTagTableCell(name, attributes)
  clearStackToTableRowContext
  @tree.insert_element(name, attributes)
  @parser.phase = @parser.phases[:inCell]
  @tree.activeFormattingElements.push(Marker)
end

#startTagTableOther(name, attributes) ⇒ Object



23
24
25
26
27
28
# File 'lib/feed_tools/vendor/html5/lib/html5/html5parser/in_row_phase.rb', line 23

def startTagTableOther(name, attributes)
  ignoreEndTag = ignoreEndTagTr
  endTagTr('tr')
  # XXX how are we sure it's always ignored in the inner_html case?
  @parser.phase.processStartTag(name, attributes) unless ignoreEndTag
end