2 Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
\r
3 For licensing, see LICENSE.html or http://ckeditor.com/license
\r
7 * @fileOverview Defines the {@link CKEDITOR.dom.comment} class, which represents
\r
8 * a DOM comment node.
\r
12 * Represents a DOM comment node.
\r
14 * @augments CKEDITOR.dom.node
\r
15 * @param {Object|String} comment A native DOM comment node or a string containing
\r
16 * the text to use to create a new comment node.
\r
17 * @param {CKEDITOR.dom.document} [ownerDocument] The document that will contain
\r
18 * the node in case of new node creation. Defaults to the current document.
\r
20 * var nativeNode = document.createComment( 'Example' );
\r
21 * var comment = CKEDITOR.dom.comment( nativeNode );
\r
23 * var comment = CKEDITOR.dom.comment( 'Example' );
\r
25 CKEDITOR.dom.comment = function( comment, ownerDocument )
\r
27 if ( typeof comment == 'string' )
\r
28 comment = ( ownerDocument ? ownerDocument.$ : document ).createComment( comment );
\r
30 CKEDITOR.dom.domObject.call( this, comment );
\r
33 CKEDITOR.dom.comment.prototype = new CKEDITOR.dom.node();
\r
35 CKEDITOR.tools.extend( CKEDITOR.dom.comment.prototype,
\r
36 /** @lends CKEDITOR.dom.comment.prototype */
\r
38 type : CKEDITOR.NODE_COMMENT,
\r
40 getOuterHtml : function()
\r
42 return '<!--' + this.$.nodeValue + '-->';
\r