Parent

Class/Module Index [+]

Quicksearch

HTML5::InHeadPhase

Public Instance Methods

anything_else() click to toggle source
# File lib/feed_tools/vendor/html5/lib/html5/html5parser/in_head_phase.rb, line 118
def anything_else
  if @tree.open_elements.last.name == 'head'
    endTagHead('head')
  else
    @parser.phase = @parser.phases[:afterHead]
  end
end
endTagHead(name) click to toggle source
# File lib/feed_tools/vendor/html5/lib/html5/html5parser/in_head_phase.rb, line 92
def endTagHead(name)
  if @tree.open_elements.last.name == 'head'
    @tree.open_elements.pop
  else
    parse_error("unexpected-end-tag", {"name" => "head"})
  end
  @parser.phase = @parser.phases[:afterHead]
end
endTagImplyAfterHead(name) click to toggle source
# File lib/feed_tools/vendor/html5/lib/html5/html5parser/in_head_phase.rb, line 101
def endTagImplyAfterHead(name)
  anything_else
  @parser.phase.processEndTag(name)
end
endTagOther(name) click to toggle source
# File lib/feed_tools/vendor/html5/lib/html5/html5parser/in_head_phase.rb, line 114
def endTagOther(name)
  parse_error("unexpected-end-tag", {"name" => name})
end
endTagTitleStyleScriptNoscript(name) click to toggle source
# File lib/feed_tools/vendor/html5/lib/html5/html5parser/in_head_phase.rb, line 106
def endTagTitleStyleScriptNoscript(name)
  if @tree.open_elements.last.name == name
    @tree.open_elements.pop
  else
    parse_error("unexpected-end-tag", {"name" => name})
  end
end
processCharacters(data) click to toggle source
# File lib/feed_tools/vendor/html5/lib/html5/html5parser/in_head_phase.rb, line 22
def processCharacters(data)
  if ]title style script noscript].include?(@tree.open_elements.last.name)
    @tree.insertText(data)
  else
    anything_else
    @parser.phase.processCharacters(data)
  end
end
process_eof() click to toggle source
# File lib/feed_tools/vendor/html5/lib/html5/html5parser/in_head_phase.rb, line 13
def process_eof
  if ['title', 'style', 'script'].include?(name = @tree.open_elements.last.name)
    parse_error("expected-named-closing-tag-but-got-eof", {"name" => @tree.open_elements.last.name})
    @tree.open_elements.pop
  end
  anything_else
  @parser.phase.process_eof
end
startTagBaseLinkMeta(name, attributes) click to toggle source
# File lib/feed_tools/vendor/html5/lib/html5/html5parser/in_head_phase.rb, line 78
def startTagBaseLinkMeta(name, attributes)
  element = @tree.createElement(name, attributes)
  if @tree.head_pointer != nil and @parser.phase == @parser.phases[:inHead]
    appendToHead(element)
  else
    @tree.open_elements.last.appendChild(element)
  end
end
startTagHead(name, attributes) click to toggle source
# File lib/feed_tools/vendor/html5/lib/html5/html5parser/in_head_phase.rb, line 31
def startTagHead(name, attributes)
  parse_error("two-heads-are-not-better-than-one")
end
startTagNoscript(name, attributes) click to toggle source
# File lib/feed_tools/vendor/html5/lib/html5/html5parser/in_head_phase.rb, line 53
def startTagNoscript(name, attributes)
  # XXX Need to decide whether to implement the scripting disabled case.
  element = @tree.createElement(name, attributes)
  if @tree.head_pointer !=nil and @parser.phase == @parser.phases[:inHead]
    appendToHead(element)
  else
    @tree.open_elements.last.appendChild(element)
  end
  @tree.open_elements.push(element)
  @parser.tokenizer.content_model_flag = :CDATA
end
startTagOther(name, attributes) click to toggle source
# File lib/feed_tools/vendor/html5/lib/html5/html5parser/in_head_phase.rb, line 87
def startTagOther(name, attributes)
  anything_else
  @parser.phase.processStartTag(name, attributes)
end
startTagScript(name, attributes) click to toggle source
# File lib/feed_tools/vendor/html5/lib/html5/html5parser/in_head_phase.rb, line 65
def startTagScript(name, attributes)
  #XXX Inner HTML case may be wrong
  element = @tree.createElement(name, attributes)
  element._flags.push("parser-inserted")
  if @tree.head_pointer != nil and @parser.phase == @parser.phases[:inHead]
    appendToHead(element)
  else
    @tree.open_elements.last.appendChild(element)
  end
  @tree.open_elements.push(element)
  @parser.tokenizer.content_model_flag = :CDATA
end
startTagStyle(name, attributes) click to toggle source
# File lib/feed_tools/vendor/html5/lib/html5/html5parser/in_head_phase.rb, line 42
def startTagStyle(name, attributes)
  element = @tree.createElement(name, attributes)
  if @tree.head_pointer != nil and @parser.phase == @parser.phases[:inHead]
    appendToHead(element)
  else
    @tree.open_elements.last.appendChild(element)
  end
  @tree.open_elements.push(element)
  @parser.tokenizer.content_model_flag = :CDATA
end
startTagTitle(name, attributes) click to toggle source
# File lib/feed_tools/vendor/html5/lib/html5/html5parser/in_head_phase.rb, line 35
def startTagTitle(name, attributes)
  element = @tree.createElement(name, attributes)
  appendToHead(element)
  @tree.open_elements.push(element)
  @parser.tokenizer.content_model_flag = :RCDATA
end

Protected Instance Methods

appendToHead(element) click to toggle source
# File lib/feed_tools/vendor/html5/lib/html5/html5parser/in_head_phase.rb, line 128
def appendToHead(element)
  if @tree.head_pointer.nil?
    assert @parser.inner_html
    @tree.open_elements.last.appendChild(element)
  else
    @tree.head_pointer.appendChild(element)
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.