JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.6.1
[ckeditor.git] / _source / core / dtd.js
1 /*\r
2 Copyright (c) 2003-2011, 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  * @namespace Holds and object representation of the HTML DTD to be used by the\r
14  * editor in its internal operations.<br />\r
15  * <br />\r
16  * Each element in the DTD is represented by a property in this object. Each\r
17  * property contains the list of elements that can be contained by the element.\r
18  * Text is represented by the "#" property.<br />\r
19  * <br />\r
20  * Several special grouping properties are also available. Their names start\r
21  * with the "$" character.\r
22  * @example\r
23  * // Check if "div" can be contained in a "p" element.\r
24  * alert( !!CKEDITOR.dtd[ 'p' ][ 'div' ] );  "false"\r
25  * @example\r
26  * // Check if "p" can be contained in a "div" element.\r
27  * alert( !!CKEDITOR.dtd[ 'div' ][ 'p' ] );  "true"\r
28  * @example\r
29  * // Check if "p" is a block element.\r
30  * alert( !!CKEDITOR.dtd.$block[ 'p' ] );  "true"\r
31  */\r
32 CKEDITOR.dtd = (function()\r
33 {\r
34         var X = CKEDITOR.tools.extend,\r
35 \r
36                 A = {isindex:1,fieldset:1},\r
37                 B = {input:1,button:1,select:1,textarea:1,label:1},\r
38                 C = X({a:1},B),\r
39                 D = X({iframe:1},C),\r
40                 E = {hr:1,ul:1,menu:1,div:1,section:1,header:1,footer:1,nav:1,article:1,aside:1,figure:1,dialog:1,hgroup:1,mark:1,time:1,meter:1,command:1,keygen:1,output:1,progress:1,audio:1,video:1,details:1,datagrid:1,datalist: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
41                 F = {ins:1,del:1,script:1,style:1},\r
42                 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,wbr:1},F),\r
43                 H = X({sub:1,img:1,object:1,sup:1,basefont:1,map:1,applet:1,font:1,big:1,small:1,mark:1},G),\r
44                 I = X({p:1},H),\r
45                 J = X({iframe:1},H,B),\r
46                 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,section:1,header:1,footer:1,nav:1,article:1,aside:1,figure:1,dialog:1,hgroup:1,mark:1,time:1,meter:1,menu:1,command:1,keygen:1,output:1,progress:1,audio:1,video:1,details:1,datagrid:1,datalist: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
47 \r
48                 L = X({a:1},J),\r
49                 M = {tr:1},\r
50                 N = {'#':1},\r
51                 O = X({param:1},K),\r
52                 P = X({form:1},A,D,E,I),\r
53                 Q = {li:1},\r
54                 R = {style:1,script:1},\r
55                 S = {base:1,link:1,meta:1,title:1},\r
56                 T = X(S,R),\r
57                 U = {head:1,body:1},\r
58                 V = {html:1};\r
59 \r
60         var block = {address:1,blockquote:1,center:1,dir:1,div:1,section:1,header:1,footer:1,nav:1,article:1,aside:1,figure:1,dialog:1,hgroup:1,time:1,meter:1,menu:1,command:1,keygen:1,output:1,progress:1,audio:1,video:1,details:1,datagrid:1,datalist:1,dl:1,fieldset:1,form:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,hr:1,isindex:1,noframes:1,ol:1,p:1,pre:1,table:1,ul:1};\r
61 \r
62         return /** @lends CKEDITOR.dtd */ {\r
63 \r
64                 // The "$" items have been added manually.\r
65 \r
66                 // List of elements living outside body.\r
67                 $nonBodyContent: X(V,U,S),\r
68 \r
69                 /**\r
70                  * List of block elements, like "p" or "div".\r
71                  * @type Object\r
72                  * @example\r
73                  */\r
74                 $block : block,\r
75 \r
76                 /**\r
77                  * List of block limit elements.\r
78                  * @type Object\r
79                  * @example\r
80                  */\r
81                 $blockLimit : { body:1,div:1,section:1,header:1,footer:1,nav:1,article:1,aside:1,figure:1,dialog:1,hgroup:1,time:1,meter:1,menu:1,command:1,keygen:1,output:1,progress:1,audio:1,video:1,details:1,datagrid:1,datalist:1,td:1,th:1,caption:1,form:1 },\r
82 \r
83                 /**\r
84                  * List of inline (&lt;span&gt; like) elements.\r
85                  */\r
86                 $inline : L,    // Just like span.\r
87 \r
88                 /**\r
89                  * list of elements that can be children at &lt;body&gt;.\r
90                  */\r
91                 $body : X({script:1,style:1}, block),\r
92 \r
93                 $cdata : {script:1,style:1},\r
94 \r
95                 /**\r
96                  * List of empty (self-closing) elements, like "br" or "img".\r
97                  * @type Object\r
98                  * @example\r
99                  */\r
100                 $empty : {area:1,base:1,br:1,col:1,hr:1,img:1,input:1,link:1,meta:1,param:1,wbr:1},\r
101 \r
102                 /**\r
103                  * List of list item elements, like "li" or "dd".\r
104                  * @type Object\r
105                  * @example\r
106                  */\r
107                 $listItem : {dd:1,dt:1,li:1},\r
108 \r
109                 /**\r
110                  * List of list root elements.\r
111                  * @type Object\r
112                  * @example\r
113                  */\r
114                 $list: {ul:1,ol:1,dl:1},\r
115 \r
116                 /**\r
117                  * Elements that accept text nodes, but are not possible to edit into\r
118                  * the browser.\r
119                  * @type Object\r
120                  * @example\r
121                  */\r
122                 $nonEditable : {applet:1,button:1,embed:1,iframe:1,map:1,object:1,option:1,script:1,textarea:1,param:1,audio:1,video:1},\r
123 \r
124                 /**\r
125                  *  List of block tags with each one a singleton element lives in the corresponding structure for description.\r
126                  */\r
127                 $captionBlock : { caption:1, legend:1 },\r
128 \r
129                 /**\r
130                  * List of elements that can be ignored if empty, like "b" or "span".\r
131                  * @type Object\r
132                  * @example\r
133                  */\r
134                 $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,mark:1},\r
135 \r
136                 /**\r
137                  * List of elements that have tabindex set to zero by default.\r
138                  * @type Object\r
139                  * @example\r
140                  */\r
141                 $tabIndex : {a:1,area:1,button:1,input:1,object:1,select:1,textarea:1},\r
142 \r
143                 /**\r
144                  * List of elements used inside the "table" element, like "tbody" or "td".\r
145                  * @type Object\r
146                  * @example\r
147                  */\r
148                 $tableContent : {caption:1,col:1,colgroup:1,tbody:1,td:1,tfoot:1,th:1,thead:1,tr:1},\r
149 \r
150         html: U,\r
151         head: T,\r
152         style: N,\r
153         script: N,\r
154         body: P,\r
155         base: {},\r
156         link: {},\r
157         meta: {},\r
158         title: N,\r
159         col : {},\r
160         tr : {td:1,th:1},\r
161         img : {},\r
162         colgroup : {col:1},\r
163         noscript : P,\r
164         td : P,\r
165         br : {},\r
166         wbr : {},\r
167         th : P,\r
168         center : P,\r
169         kbd : L,\r
170         button : X(I,E),\r
171         basefont : {},\r
172         h5 : L,\r
173         h4 : L,\r
174         samp : L,\r
175         h6 : L,\r
176         ol : Q,\r
177         h1 : L,\r
178         h3 : L,\r
179         option : N,\r
180         h2 : L,\r
181         form : X(A,D,E,I),\r
182         select : {optgroup:1,option:1},\r
183         font : L,\r
184         ins : L,\r
185         menu : Q,\r
186         abbr : L,\r
187         label : L,\r
188         table : {thead:1,col:1,tbody:1,tr:1,colgroup:1,caption:1,tfoot:1},\r
189         code : L,\r
190         tfoot : M,\r
191         cite : L,\r
192         li : P,\r
193         input : {},\r
194         iframe : P,\r
195         strong : L,\r
196         textarea : N,\r
197         noframes : P,\r
198         big : L,\r
199         small : L,\r
200         span : L,\r
201         hr : {},\r
202         dt : L,\r
203         sub : L,\r
204         optgroup : {option:1},\r
205         param : {},\r
206         bdo : L,\r
207         'var' : L,\r
208         div : P,\r
209         object : O,\r
210         sup : L,\r
211         dd : P,\r
212         strike : L,\r
213         area : {},\r
214         dir : Q,\r
215         map : X({area:1,form:1,p:1},A,F,E),\r
216         applet : O,\r
217         dl : {dt:1,dd:1},\r
218         del : L,\r
219         isindex : {},\r
220         fieldset : X({legend:1},K),\r
221         thead : M,\r
222         ul : Q,\r
223         acronym : L,\r
224         b : L,\r
225         a : J,\r
226         blockquote : P,\r
227         caption : L,\r
228         i : L,\r
229         u : L,\r
230         tbody : M,\r
231         s : L,\r
232         address : X(D,I),\r
233         tt : L,\r
234         legend : L,\r
235         q : L,\r
236         pre : X(G,C),\r
237         p : L,\r
238         em : L,\r
239         dfn : L,\r
240                 //HTML5\r
241                 section : P,\r
242                 header : P,\r
243                 footer : P,\r
244                 nav : P,\r
245                 article : P,\r
246                 aside : P,\r
247                 figure: P,\r
248                 dialog : P,\r
249                 hgroup : P,\r
250                 mark : L,\r
251                 time : L,\r
252                 meter : L,\r
253                 menu : L,\r
254                 command : L,\r
255                 keygen : L,\r
256                 output : L,\r
257                 progress : O,\r
258                 audio : O,\r
259                 video : O,\r
260                 details : O,\r
261                 datagrid : O,\r
262                 datalist : O\r
263     };\r
264 })();\r
265 \r
266 // PACKAGER_RENAME( CKEDITOR.dtd )\r