@@ -6,12 +6,11 @@ class InBodyPhase < Phase
6
6
# http://www.whatwg.org/specs/web-apps/current-work/#in-body
7
7
8
8
handle_start 'html'
9
- handle_start %w( base link meta script style ) => 'ProcessInHead'
10
- handle_start 'title'
9
+ handle_start %w( base link meta script style title ) => 'ProcessInHead'
11
10
12
11
handle_start 'body' , 'form' , 'plaintext' , 'a' , 'button' , 'xmp' , 'table' , 'hr' , 'image'
13
12
14
- handle_start 'input' , 'textarea' , 'select' , 'isindex' , %w( marquee object )
13
+ handle_start 'input' , 'textarea' , 'select' , 'isindex' , %w( applet marquee object )
15
14
16
15
handle_start %w( li dd dt ) => 'ListItem'
17
16
@@ -28,7 +27,7 @@ class InBodyPhase < Phase
28
27
29
28
handle_start %w( event-source section nav article aside header footer datagrid command ) => 'New'
30
29
31
- handle_end 'p' , 'body' , 'html' , 'form' , %w( button marquee object ) , %w( dd dt li ) => 'ListItem'
30
+ handle_end 'p' , 'body' , 'html' , 'form' , %w( applet button marquee object ) , %w( dd dt li ) => 'ListItem'
32
31
33
32
handle_end %w( address blockquote center div dl fieldset listing menu ol pre ul ) => 'Block'
34
33
@@ -64,7 +63,7 @@ class << self
64
63
end
65
64
66
65
if ( data . length > 0 and data [ 0 ] == ?\n &&
67
- %w[ pre textarea ] . include? ( @tree . open_elements . last . name ) && !@tree . open_elements . last . hasContent )
66
+ %w[ listing pre textarea ] . include? ( @tree . open_elements . last . name ) && !@tree . open_elements . last . hasContent )
68
67
data = data [ 1 ..-1 ]
69
68
end
70
69
@@ -91,11 +90,6 @@ def startTagProcessInHead(name, attributes)
91
90
@parser . phases [ :inHead ] . processStartTag ( name , attributes )
92
91
end
93
92
94
- def startTagTitle ( name , attributes )
95
- parse_error ( "unexpected-start-tag-out-of-my-head" , { "name" => name } )
96
- @parser . phases [ :inHead ] . processStartTag ( name , attributes )
97
- end
98
-
99
93
def startTagBody ( name , attributes )
100
94
parse_error ( "unexpected-start-tag" , { "name" => "body" } )
101
95
@@ -113,7 +107,7 @@ def startTagBody(name, attributes)
113
107
def startTagCloseP ( name , attributes )
114
108
endTagP ( 'p' ) if in_scope? ( 'p' )
115
109
@tree . insert_element ( name , attributes )
116
- if name == 'pre'
110
+ if [ 'pre' , 'listing' ] . include? ( name )
117
111
class << self
118
112
remove_method :processSpaceCharacters rescue nil
119
113
alias processSpaceCharacters processSpaceCharactersDropNewline
@@ -220,7 +214,7 @@ def startTagButton(name, attributes)
220
214
end
221
215
end
222
216
223
- def startTagMarqueeObject ( name , attributes )
217
+ def startTagAppletMarqueeObject ( name , attributes )
224
218
@tree . reconstructActiveFormattingElements
225
219
@tree . insert_element ( name , attributes )
226
220
@tree . activeFormattingElements . push ( Marker )
@@ -303,7 +297,14 @@ def startTagCdata(name, attributes)
303
297
def startTagSelect ( name , attributes )
304
298
@tree . reconstructActiveFormattingElements
305
299
@tree . insert_element ( name , attributes )
306
- @parser . phase = @parser . phases [ :inSelect ]
300
+
301
+ if [ @parser . phases [ :inTable ] , @parser . phases [ :inCaption ] ,
302
+ @parser . phases [ :inColumnGroup ] , @parser . phases [ :inTableBody ] , @parser . phases [ :inRow ] ,
303
+ @parser . phases [ :inCell ] ] . include? ( @parser . phase )
304
+ @parser . phase = @parser . phases [ :inSelectInTable ]
305
+ else
306
+ @parser . phase = @parser . phases [ :inSelect ]
307
+ end
307
308
end
308
309
309
310
def startTagMisplaced ( name , attributes )
@@ -528,7 +529,7 @@ def endTagFormatting(name)
528
529
end
529
530
end
530
531
531
- def endTagButtonMarqueeObject ( name )
532
+ def endTagAppletButtonMarqueeObject ( name )
532
533
@tree . generateImpliedEndTags if in_scope? ( name )
533
534
534
535
unless @tree . open_elements . last . name == name
0 commit comments