X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fcore%2Fdtd.js;h=105e9967f5252431101cf598ed31f87d337d62c4;hb=48b1db88210b4160dce439c6e3e32e14af8c106b;hp=45e801ccba3a607b78715c8ea10d8cb08b091137;hpb=7cd80714081a8ffdf4a1a8d2c72f120ed5ef3d6d;p=ckeditor.git diff --git a/_source/core/dtd.js b/_source/core/dtd.js index 45e801c..105e996 100644 --- a/_source/core/dtd.js +++ b/_source/core/dtd.js @@ -1,5 +1,5 @@ /* -Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ @@ -10,16 +10,15 @@ For licensing, see LICENSE.html or http://ckeditor.com/license */ /** - * Holds and object representation of the HTML DTD to be used by the editor in - * its internal operations. - * - * Each element in the DTD is represented by a - * property in this object. Each property contains the list of elements that - * can be contained by the element. Text is represented by the "#" property. - * + * @namespace Holds and object representation of the HTML DTD to be used by the + * editor in its internal operations.
+ *
+ * Each element in the DTD is represented by a property in this object. Each + * property contains the list of elements that can be contained by the element. + * Text is represented by the "#" property.
+ *
* Several special grouping properties are also available. Their names start * with the "$" character. - * @namespace * @example * // Check if "div" can be contained in a "p" element. * alert( !!CKEDITOR.dtd[ 'p' ][ 'div' ] ); "false" @@ -32,14 +31,14 @@ For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.dtd = (function() { - var X = CKEDITOR.tools.extend, + var X = CKEDITOR.tools.extend, A = {isindex:1,fieldset:1}, B = {input:1,button:1,select:1,textarea:1,label:1}, C = X({a:1},B), D = X({iframe:1},C), 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}, - F = {ins:1,del:1,script:1}, + F = {ins:1,del:1,script:1,style:1}, 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), H = X({sub:1,img:1,object:1,sup:1,basefont:1,map:1,applet:1,font:1,big:1,small:1},G), I = X({p:1},H), @@ -51,14 +50,22 @@ CKEDITOR.dtd = (function() N = {'#':1}, O = X({param:1},K), P = X({form:1},A,D,E,I), - Q = {li:1}; + Q = {li:1}, + R = {style:1,script:1}, + S = {base:1,link:1,meta:1,title:1}, + T = X(S,R), + U = {head:1,body:1}, + V = {html:1}; 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}; - return /** @lends CKEDITOR.dtd */ { + return /** @lends CKEDITOR.dtd */ { // The "$" items have been added manually. + // List of elements living outside body. + $nonBodyContent: X(V,U,S), + /** * List of block elements, like "p" or "div". * @type Object @@ -66,9 +73,22 @@ CKEDITOR.dtd = (function() */ $block : block, + /** + * List of block limit elements. + * @type Object + * @example + */ + $blockLimit : { body:1,div:1,td:1,th:1,caption:1,form:1 }, + + /** + * List of inline (<span> like) elements. + */ $inline : L, // Just like span. - $body : X({script:1}, block), + /** + * list of elements that can be children at <body>. + */ + $body : X({script:1,style:1}, block), $cdata : {script:1,style:1}, @@ -122,6 +142,15 @@ CKEDITOR.dtd = (function() */ $tableContent : {caption:1,col:1,colgroup:1,tbody:1,td:1,tfoot:1,th:1,thead:1,tr:1}, + html: U, + head: T, + style: N, + script: N, + body: P, + base: {}, + link: {}, + meta: {}, + title: N, col : {}, tr : {td:1,th:1}, img : {},