Class: HTML5::InFramesetPhase

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

#endTagFrameset(name) ⇒ Object



34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/html5/html5parser/in_frameset_phase.rb', line 34

def endTagFrameset(name)
  if @tree.open_elements.last.name == 'html'
    # inner_html case
    parse_error("unexpected-frameset-in-frameset-innerhtml")
  else
    @tree.open_elements.pop
  end
  if (not @parser.inner_html and
    @tree.open_elements.last.name != 'frameset')
    # If we're not in inner_html mode and the the current node is not a
    # "frameset" element (anymore) then switch.
    @parser.phase = @parser.phases[:afterFrameset]
  end
end

#endTagNoframes(name) ⇒ Object



49
50
51
# File 'lib/html5/html5parser/in_frameset_phase.rb', line 49

def endTagNoframes(name)
  @parser.phases[:inBody].processEndTag(name)
end

#endTagOther(name) ⇒ Object



53
54
55
# File 'lib/html5/html5parser/in_frameset_phase.rb', line 53

def endTagOther(name)
  parse_error("unexpected-end-tag-in-frameset", {"name" => name})
end

#processCharacters(data) ⇒ Object



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

def processCharacters(data)
  parse_error("unexpected-char-in-frameset")
end

#startTagFrame(name, attributes) ⇒ Object



20
21
22
23
# File 'lib/html5/html5parser/in_frameset_phase.rb', line 20

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

#startTagFrameset(name, attributes) ⇒ Object



16
17
18
# File 'lib/html5/html5parser/in_frameset_phase.rb', line 16

def startTagFrameset(name, attributes)
  @tree.insert_element(name, attributes)
end

#startTagNoframes(name, attributes) ⇒ Object



25
26
27
# File 'lib/html5/html5parser/in_frameset_phase.rb', line 25

def startTagNoframes(name, attributes)
  @parser.phases[:inBody].processStartTag(name, attributes)
end

#startTagOther(name, attributes) ⇒ Object



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

def startTagOther(name, attributes)
  parse_error("unexpected-start-tag-in-frameset",
        {"name" => name})
end