dtd.js 7.6 KB

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