Ticket #8413: 8413.patch

File 8413.patch, 2.7 KB (added by Garry Yao, 12 years ago)
  • _source/core/dom/comment.js

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    1212{
    1313        base : CKEDITOR.dom.node,
    1414
    15         $ : function( text, ownerDocument )
     15    /**
     16     * The comment node type.
     17     * {@link CKEDITOR.NODE_COMMENT}.
     18     * @type Number
     19     * @example
     20     */
     21    type : CKEDITOR.NODE_COMMENT,
     22
     23        $ : function( comment, ownerDocument )
    1624        {
    17                 if ( typeof text == 'string' )
    18                         text = ( ownerDocument ? ownerDocument.$ : document ).createComment( text );
     25                if ( typeof comment == 'string' )
     26                        comment = ( ownerDocument ? ownerDocument.$ : document ).createComment( comment );
    1927
    20                 this.base( text );
     28                // Call the base constructor (we must not call CKEDITOR.dom.node).
     29                CKEDITOR.dom.domObject.call( this, comment );
    2130        },
    2231
    2332        proto :
  • _source/core/dom/node.js

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    2323{
    2424        if ( domNode )
    2525        {
    26                 switch ( domNode.nodeType )
    27                 {
    28                         // Safari don't consider document as element node type. (#3389)
    29                         case CKEDITOR.NODE_DOCUMENT :
    30                                 return new CKEDITOR.dom.document( domNode );
     26                var constructor = domNode.nodeType == CKEDITOR.NODE_DOCUMENT ? 'document'
     27                        : domNode.nodeType == CKEDITOR.NODE_ELEMENT ? 'element'
     28                        : domNode.nodeType == CKEDITOR.NODE_TEXT ? 'text'
     29                        : domNode.nodeType == CKEDITOR.NODE_COMMENT ? 'comment'
     30                        : 'domObject';  // Call the base constructor otherwise.
    3131
    32                         case CKEDITOR.NODE_ELEMENT :
    33                                 return new CKEDITOR.dom.element( domNode );
    34 
    35                         case CKEDITOR.NODE_TEXT :
    36                                 return new CKEDITOR.dom.text( domNode );
    37                 }
    38 
    39                 // Call the base constructor.
    40                 CKEDITOR.dom.domObject.call( this, domNode );
     32                return new CKEDITOR.dom[ constructor ]( domNode );
    4133        }
    4234
    4335        return this;
  • _source/core/dom/range.js

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    10141014                                                        // whitespaces at the end.
    10151015                                                        isWhiteSpace = false;
    10161016
    1017                                                         if ( sibling.type == CKEDITOR.NODE_TEXT )
     1017                                                        if ( sibling.type == CKEDITOR.NODE_COMMENT )
     1018                                                        {
     1019                                                                sibling = sibling.getPrevious();
     1020                                                                continue;
     1021                                                        }
     1022                                                        else if ( sibling.type == CKEDITOR.NODE_TEXT )
    10181023                                                        {
    10191024                                                                siblingText = sibling.getText();
    10201025
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy