Looking For


New Layout: HTML Tag Handling Chart

Authors: Rick Gessner
Updated: 23 October 1998

[eds. note: This document extracted from email. Original message follows]
During a recent tag handling fest in the parser, it occured to me that we don't have a "how to handle tag x" document. So I've created a the following table of HTML tags and how we handle them in the parser. I needed this for debugging purposes, and others may benefit from it during testing.

Anyway, it's a work in progress, so send me issues.

-Rick

A
 

Tag
Block 
Parent
Inline 
Parent
Inline 
Content
Block 
Content
a
x
x
x
 
abbr
x
x
x
 
acronym
x
x
x
 
address
x
 
x
 
applet
x
x
x
x
area <map>      

B
 

Tag
Block 
Parent
Inline 
Parent
Inline 
Content
Block 
Content
Head 
Content
Other Content
b
x
x
x
     
base <head>          
basefont
x
 
x
x
   
bdo
x
x
x
     
bgsound
<head>+x
x
       
big
x
x
x
     
blink
x
x
x
     
blockquote
x
x
x
   
body
<html>, <noframe>
 
x
x
  del, ins
br
x
x
       
button
x
x
x
x
   
.
.
. ...
.
.
.
.
.

C
 

Tag
Block 
Parent
Inline 
Parent
Inline 
Content
Block 
Content
caption table  
x
 
center
x
 
x
x
cite
x
x
x
 
code x
x
x
 
col colgroup, table      
colgroup table   col  

D
 

Tag
Block 
Parent
Inline 
Parent
Inline 
Content
Block 
Content
dd dl  
*
x
del body  
x
x
dfn
x
x
x
 
dir
x
  li  
div
x
 
x
x
dl
x
  dd, dt  
dt dl  
x

E
 

Tag
Block 
Parent
Inline 
Parent
Inline 
Content
Block 
Content
em
x
x
x
 
embed
x
x
param+x
x
.
.
.
.
.

F
 

Tag
Block 
Parent
Inline 
Parent
Inline 
Content
Block 
Content
fieldset
x
 
legend+x
x
font
x
x
x
 
form
x
 
keygen+x
x
frame
frameset
     
frameset frameset, html   frame, frameset, noframes  

G
 

Tag
Block 
Parent
Inline 
Parent
Inline 
Content
Block 
Content
         
         

H
 

Tag
Block 
Parent
Inline 
Parent
Inline 
Content
Block 
Content
Head
Content
head <html>      
x
hr
x
       
html     body, frameset, head    
hx
x
 
x
   
.
.
.
.
.
.
.
.
.
.
.

I
 

Tag
Block 
Parent
Inline 
Parent
Inline 
Content
Block 
Content
Head 
Content
i
x
x
x
   
iframe
x
x
x
x
 
ilayer
x
x
x
 
img
x
x
     
ins
body
 
x
x
 
isindex
head+x
       

J
 

Tag
Block 
Parent
Inline 
Parent
Inline 
Content
Block 
Content
         
         

K
 

Tag
Block 
Parent
Inline 
Parent
Inline 
Content
Block 
Content
kbd
x
x
x
 
keygen
form
     

L
 

Tag
Block 
Parent
Inline 
Parent
Inline 
Content
Block 
Content
Head 
Content
label
x
x
x
   
layer
x
 
x
x
 
legend
fieldset
 
x
   
li  
x
x
(if inside ol/ul)
 
link
head
       
listing          

M
 

Tag
Block 
Parent
Inline 
Parent
Inline 
Content
Block 
Content
Head 
Content
map
x
x
area
   
marquee
x
 
x
x
 
menu
x
 
li
   
meta
head
       
multicol
x
 
x
x
 

 
 

N
 

Tag
Block 
Parent
Inline 
Parent
Inline 
Content
Block 
Content
Head 
Content
nextid
head
       
nobr
x
x
x
   
noembed
x
x
x
 
noframes
frametset+x
 
body+x
x
 
nolayer
x
x
x
 
noscript
x
 
x
x
 

O
 

Tag
Block 
Parent
Inline 
Parent
Inline 
Content
Block 
Content
object
x
x
param+x
x
ol
x
 
li
 
optgroup
select, optgroup
 
option, optgroup
 
option
optgroup, select
 
text
 
.
.
.
.

P
 

Tag
Block 
Parent
Inline 
Parent
Inline 
Content
Block 
Content
p
x
x
 
param
applet, object
     
plaintext        
pre
x
x*
 

*Exceptions:
applet, basefont, big, blink, font, iframe, img, nobr, object, small, sub, sup

Q
 

Tag
Block 
Parent
Inline 
Parent
Inline 
Content
Block 
Content
q
x
x
x
 

S
 

Tag
Block 
Parent
Inline 
Parent
Inline 
Content
Block 
Content
Head 
Content
s
x
x
x
   
samp
x
x
x
   
script
head+x
x
text
   
select
x
x
optgroup, option
   
small
x
x
x
   
sound
head+x
x
     
spacer
x
x
     
span
x
x
x
   
strike
x
x
x
   
strong
x
x
x
   
style
head
 
text
   
sub
x
x
x
   
sup
x
x
x
   

T
 

Tag
Block 
Parent
Inline 
Parent
Inline 
Content
Block 
Content
Head 
Content
table
x
 
caption, col,colgroup, tr, thead, tbody, tfoot
   
tbody
table
 
tr
   
td
tr
 
x
x
 
textarea
x
x
text
   
tfoot
table
 
tr
   
th
tr
 
x
x
 
thead
table
tr
   
title
head
 
text
   
tr
table, tbody, thead, tfoot
 
th, td
   
tt
x
x
x
   

U
 

Tag
Block 
Parent
Inline 
Parent
Inline 
Content
Block 
Content
u
x
x
x
 
ul
x
 
li
 

VWX!
 

Tag
Block 
Parent
Inline 
Parent
Inline 
Content
Block 
Content
var
x
x
x
 
 wbr
 x
 x
   
xmp
!doctype
html
!--