Class: HTML5::BeforeHtmlPhase
- Inherits:
-
Phase
- Object
- Phase
- HTML5::BeforeHtmlPhase
show all
- Defined in:
- lib/html5/html5parser/before_html_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, #processDoctype, #remove_open_elements_until, #startTagHtml, start_tag_handlers, tag_handlers
Constructor Details
This class inherits a constructor from HTML5::Phase
Instance Method Details
#insert_html_element ⇒ Object
34
35
36
37
38
39
|
# File 'lib/html5/html5parser/before_html_phase.rb', line 34
def insert_html_element
element = @tree.createElement('html', {})
@tree.open_elements << element
@tree.document.appendChild(element)
@parser.phase = @parser.phases[:beforeHead]
end
|
#process_eof ⇒ Object
6
7
8
9
|
# File 'lib/html5/html5parser/before_html_phase.rb', line 6
def process_eof
insert_html_element
@parser.phase.process_eof
end
|
#processCharacters(data) ⇒ Object
18
19
20
21
|
# File 'lib/html5/html5parser/before_html_phase.rb', line 18
def processCharacters(data)
insert_html_element
@parser.phase.processCharacters(data)
end
|
11
12
13
|
# File 'lib/html5/html5parser/before_html_phase.rb', line 11
def (data)
@tree.(data, @tree.document)
end
|
#processEndTag(name) ⇒ Object
29
30
31
32
|
# File 'lib/html5/html5parser/before_html_phase.rb', line 29
def processEndTag(name)
insert_html_element
@parser.phase.processEndTag(name)
end
|
#processSpaceCharacters(data) ⇒ Object
15
16
|
# File 'lib/html5/html5parser/before_html_phase.rb', line 15
def processSpaceCharacters(data)
end
|
#processStartTag(name, attributes, self_closing = false) ⇒ Object
23
24
25
26
27
|
# File 'lib/html5/html5parser/before_html_phase.rb', line 23
def processStartTag(name, attributes, self_closing=false)
@parser.first_start_tag = true if name == 'html'
insert_html_element
@parser.phase.processStartTag(name, attributes)
end
|