Opened 12 years ago

Last modified 12 years ago

#9520 confirmed Bug

Shorter way for node's type check — at Initial Version

Reported by: Piotrek Koszuliński Owned by:
Priority: Normal Milestone:
Component: Performance Version: 3.0
Keywords: Cc:

Description

The current way is long and isn't minifiable at all:

node.type == CKEDITOR.NODE_TEXT || node.type == CKEDITOR.NODE_ELEMENT

We may introduce shorter version. E.g. method 'is' may be added to node:

node.is( '#doc' );
// or
node.is( [ '#text', '#element' ] );

Tokens have to be prepended with hash, because we already have is method to check element name. Also, it was used to duck typing, what would has to be fixed.

This solution's flaw is that additional check has to be done when method is called on element. Thus, we may think of other method's name specialized in type checking.

Change History (0)

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy