X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fcore%2Fdom%2Felementpath.js;h=835ad10ffa63623b2447270338532d1cad8d2891;hb=039a051ccf3901311661022a30afd60fc38130c9;hp=bc9f01a519f7a682f3218a6b50304cf45b892731;hpb=ea7e3453c7b0f023b050aca6d9f83ab372860d91;p=ckeditor.git diff --git a/_source/core/dom/elementpath.js b/_source/core/dom/elementpath.js index bc9f01a..835ad10 100644 --- a/_source/core/dom/elementpath.js +++ b/_source/core/dom/elementpath.js @@ -1,12 +1,12 @@ /* -Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. +Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ (function() { // Elements that may be considered the "Block boundary" in an element path. - var pathBlockElements = { address:1,blockquote:1,dl:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1,li:1,dt:1,de:1 }; + var pathBlockElements = { address:1,blockquote:1,dl:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1,li:1,dt:1,dd:1 }; // Elements that may be considered the "Block limit" in an element path. var pathBlockLimitElements = { body:1,div:1,table:1,tbody:1,tr:1,td:1,th:1,caption:1,form:1 }; @@ -27,6 +27,9 @@ For licensing, see LICENSE.html or http://ckeditor.com/license return false; }; + /** + * @class + */ CKEDITOR.dom.elementPath = function( lastNode ) { var block = null; @@ -100,5 +103,17 @@ CKEDITOR.dom.elementPath.prototype = } return true; + }, + + contains : function( tagNames ) + { + var elements = this.elements; + for ( var i = 0 ; i < elements.length ; i++ ) + { + if ( elements[ i ].getName() in tagNames ) + return elements[ i ]; + } + + return null; } };