JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
45e801ccba3a607b78715c8ea10d8cb08b091137
[ckeditor.git] / _source / core / dtd.js
1 /*\r
2 Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.\r
3 For licensing, see LICENSE.html or http://ckeditor.com/license\r
4 */\r
5 \r
6 /**\r
7  * @fileOverview Defines the {@link CKEDITOR.dtd} object, which holds the DTD\r
8  *              mapping for XHTML 1.0 Transitional. This file was automatically\r
9  *              generated from the file: xhtml1-transitional.dtd.\r
10  */\r
11 \r
12 /**\r
13  * Holds and object representation of the HTML DTD to be used by the editor in\r
14  * its internal operations.\r
15  *\r
16  * Each element in the DTD is represented by a\r
17  * property in this object. Each property contains the list of elements that\r
18  * can be contained by the element. Text is represented by the "#" property.\r
19  *\r
20  * Several special grouping properties are also available. Their names start\r
21  * with the "$" character.\r
22  * @namespace\r
23  * @example\r
24  * // Check if "div" can be contained in a "p" element.\r
25  * alert( !!CKEDITOR.dtd[ 'p' ][ 'div' ] );  "false"\r
26  * @example\r
27  * // Check if "p" can be contained in a "div" element.\r
28  * alert( !!CKEDITOR.dtd[ 'div' ][ 'p' ] );  "true"\r
29  * @example\r
30  * // Check if "p" is a block element.\r
31  * alert( !!CKEDITOR.dtd.$block[ 'p' ] );  "true"\r
32  */\r
33 CKEDITOR.dtd = (function()\r
34 {\r
35     var X = CKEDITOR.tools.extend,\r
36 \r
37                 A = {isindex:1,fieldset:1},\r
38                 B = {input:1,button:1,select:1,textarea:1,label:1},\r
39                 C = X({a:1},B),\r
40                 D = X({iframe:1},C),\r
41                 E = {hr:1,ul:1,menu:1,div:1,blockquote:1,noscript:1,table:1,center:1,address:1,dir:1,pre:1,h5:1,dl:1,h4:1,noframes:1,h6:1,ol:1,h1:1,h3:1,h2:1},\r
42                 F = {ins:1,del:1,script:1},\r
43                 G = X({b:1,acronym:1,bdo:1,'var':1,'#':1,abbr:1,code:1,br:1,i:1,cite:1,kbd:1,u:1,strike:1,s:1,tt:1,strong:1,q:1,samp:1,em:1,dfn:1,span:1},F),\r
44                 H = X({sub:1,img:1,object:1,sup:1,basefont:1,map:1,applet:1,font:1,big:1,small:1},G),\r
45                 I = X({p:1},H),\r
46                 J = X({iframe:1},H,B),\r
47                 K = {img:1,noscript:1,br:1,kbd:1,center:1,button:1,basefont:1,h5:1,h4:1,samp:1,h6:1,ol:1,h1:1,h3:1,h2:1,form:1,font:1,'#':1,select:1,menu:1,ins:1,abbr:1,label:1,code:1,table:1,script:1,cite:1,input:1,iframe:1,strong:1,textarea:1,noframes:1,big:1,small:1,span:1,hr:1,sub:1,bdo:1,'var':1,div:1,object:1,sup:1,strike:1,dir:1,map:1,dl:1,applet:1,del:1,isindex:1,fieldset:1,ul:1,b:1,acronym:1,a:1,blockquote:1,i:1,u:1,s:1,tt:1,address:1,q:1,pre:1,p:1,em:1,dfn:1},\r
48 \r
49                 L = X({a:1},J),\r
50                 M = {tr:1},\r
51                 N = {'#':1},\r
52                 O = X({param:1},K),\r
53                 P = X({form:1},A,D,E,I),\r
54                 Q = {li:1};\r
55 \r
56         var block = {address:1,blockquote:1,center:1,dir:1,div:1,dl:1,fieldset:1,form:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,hr:1,isindex:1,menu:1,noframes:1,ol:1,p:1,pre:1,table:1,ul:1};\r
57 \r
58     return /** @lends CKEDITOR.dtd */ {\r
59 \r
60                 // The "$" items have been added manually.\r
61 \r
62                 /**\r
63                  * List of block elements, like "p" or "div".\r
64                  * @type Object\r
65                  * @example\r
66                  */\r
67                 $block : block,\r
68 \r
69                 $inline : L,    // Just like span.\r
70 \r
71                 $body : X({script:1}, block),\r
72 \r
73                 $cdata : {script:1,style:1},\r
74 \r
75                 /**\r
76                  * List of empty (self-closing) elements, like "br" or "img".\r
77                  * @type Object\r
78                  * @example\r
79                  */\r
80                 $empty : {area:1,base:1,br:1,col:1,hr:1,img:1,input:1,link:1,meta:1,param:1},\r
81 \r
82                 /**\r
83                  * List of list item elements, like "li" or "dd".\r
84                  * @type Object\r
85                  * @example\r
86                  */\r
87                 $listItem : {dd:1,dt:1,li:1},\r
88 \r
89                 /**\r
90              * List of list root elements.\r
91              * @type Object\r
92              * @example\r
93              */\r
94             $list: { ul:1,ol:1,dl:1},\r
95 \r
96                 /**\r
97                  * Elements that accept text nodes, but are not possible to edit into\r
98                  * the browser.\r
99                  * @type Object\r
100                  * @example\r
101                  */\r
102                 $nonEditable : {applet:1,button:1,embed:1,iframe:1,map:1,object:1,option:1,script:1,textarea:1,param:1},\r
103 \r
104                 /**\r
105                  * List of elements that can be ignored if empty, like "b" or "span".\r
106                  * @type Object\r
107                  * @example\r
108                  */\r
109                 $removeEmpty : {abbr:1,acronym:1,address:1,b:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,q:1,s:1,samp:1,small:1,span:1,strike:1,strong:1,sub:1,sup:1,tt:1,u:1,'var':1},\r
110 \r
111                 /**\r
112                  * List of elements that have tabindex set to zero by default.\r
113                  * @type Object\r
114                  * @example\r
115                  */\r
116                 $tabIndex : {a:1,area:1,button:1,input:1,object:1,select:1,textarea:1},\r
117 \r
118                 /**\r
119                  * List of elements used inside the "table" element, like "tbody" or "td".\r
120                  * @type Object\r
121                  * @example\r
122                  */\r
123                 $tableContent : {caption:1,col:1,colgroup:1,tbody:1,td:1,tfoot:1,th:1,thead:1,tr:1},\r
124 \r
125         col : {},\r
126         tr : {td:1,th:1},\r
127         img : {},\r
128         colgroup : {col:1},\r
129         noscript : P,\r
130         td : P,\r
131         br : {},\r
132         th : P,\r
133         center : P,\r
134         kbd : L,\r
135         button : X(I,E),\r
136         basefont : {},\r
137         h5 : L,\r
138         h4 : L,\r
139         samp : L,\r
140         h6 : L,\r
141         ol : Q,\r
142         h1 : L,\r
143         h3 : L,\r
144         option : N,\r
145         h2 : L,\r
146         form : X(A,D,E,I),\r
147         select : {optgroup:1,option:1},\r
148         font : L,\r
149         ins : L,\r
150         menu : Q,\r
151         abbr : L,\r
152         label : L,\r
153         table : {thead:1,col:1,tbody:1,tr:1,colgroup:1,caption:1,tfoot:1},\r
154         code : L,\r
155         script : N,\r
156         tfoot : M,\r
157         cite : L,\r
158         li : P,\r
159         input : {},\r
160         iframe : P,\r
161         strong : L,\r
162         textarea : N,\r
163         noframes : P,\r
164         big : L,\r
165         small : L,\r
166         span : L,\r
167         hr : {},\r
168         dt : L,\r
169         sub : L,\r
170         optgroup : {option:1},\r
171         param : {},\r
172         bdo : L,\r
173         'var' : L,\r
174         div : P,\r
175         object : O,\r
176         sup : L,\r
177         dd : P,\r
178         strike : L,\r
179         area : {},\r
180         dir : Q,\r
181         map : X({area:1,form:1,p:1},A,F,E),\r
182         applet : O,\r
183         dl : {dt:1,dd:1},\r
184         del : L,\r
185         isindex : {},\r
186         fieldset : X({legend:1},K),\r
187         thead : M,\r
188         ul : Q,\r
189         acronym : L,\r
190         b : L,\r
191         a : J,\r
192         blockquote : P,\r
193         caption : L,\r
194         i : L,\r
195         u : L,\r
196         tbody : M,\r
197         s : L,\r
198         address : X(D,I),\r
199         tt : L,\r
200         legend : L,\r
201         q : L,\r
202         pre : X(G,C),\r
203         p : L,\r
204         em : L,\r
205         dfn : L\r
206     };\r
207 })();\r
208 \r
209 // PACKAGER_RENAME( CKEDITOR.dtd )\r