From 8328fc8786d5b08156bd2bac0a87ff5730c874d1 Mon Sep 17 00:00:00 2001 From: Trevor Parscal Date: Fri, 25 May 2012 17:57:20 -0700 Subject: [PATCH] Removed aliases for node type constants, on the client we have them already in Node Change-Id: Id68dd43930a51a857e73af0215fd215c89e9bbbe --- modules/ve2/dm/ve.dm.HTMLConverter.js | 30 +++------------------------ 1 file changed, 3 insertions(+), 27 deletions(-) diff --git a/modules/ve2/dm/ve.dm.HTMLConverter.js b/modules/ve2/dm/ve.dm.HTMLConverter.js index e9f94e3a40..400bc79513 100644 --- a/modules/ve2/dm/ve.dm.HTMLConverter.js +++ b/modules/ve2/dm/ve.dm.HTMLConverter.js @@ -17,29 +17,6 @@ ve.dm.HTMLConverter = function( options ) { /* Static Members */ -/** - * HTML DOM node types. - * - * If this will be used more than once in a method, it should be aliased locally to avoid excessive - * lookups. - * - * @see https://developer.mozilla.org/en/nodeType - */ -ve.dm.HTMLConverter.Node = { - 'ELEMENT_NODE': 1, - 'ATTRIBUTE_NODE': 2, - 'TEXT_NODE': 3, - 'CDATA_SECTION_NODE': 4, - 'ENTITY_REFERENCE_NODE': 5, - 'ENTITY_NODE': 6, - 'PROCESSING_INSTRUCTION_NODE': 7, - 'COMMENT_NODE': 8, - 'DOCUMENT_NODE': 9, - 'DOCUMENT_TYPE_NODE': 10, - 'DOCUMENT_FRAGMENT_NODE': 11, - 'NOTATION_NODE': 12 -}; - /** * Object mapping HTML DOM node names to linear model element names. * @@ -244,7 +221,6 @@ ve.dm.HTMLConverter.getLinearModel = function( node, options ) { */ ve.dm.HTMLConverter.prototype.convert = function( node, annotations, typeData ) { var data = [], - types = ve.dm.HTMLConverter.Node, i, child, annotation, @@ -271,7 +247,7 @@ ve.dm.HTMLConverter.prototype.convert = function( node, annotations, typeData ) for ( i = 0; i < node.childNodes.length; i++ ) { child = node.childNodes[i]; switch ( child.nodeType ) { - case types.ELEMENT_NODE: + case Node.ELEMENT_NODE: // Check if this is an annotation annotation = ve.dm.HTMLConverter.getAnnotation( child ); if ( annotation ) { @@ -330,7 +306,7 @@ ve.dm.HTMLConverter.prototype.convert = function( node, annotations, typeData ) } } break; - case types.TEXT_NODE: + case Node.TEXT_NODE: // If we have annotated text within a branch node, open a paragraph if ( !paragraphOpened && typeData && !typeData.canContainContent ) { data.push( { 'type': 'paragraph' } ); @@ -341,7 +317,7 @@ ve.dm.HTMLConverter.prototype.convert = function( node, annotations, typeData ) ve.dm.HTMLConverter.generateAnnotatedContent( child.data, annotations ) ); break; - case types.COMMENT_NODE: + case Node.COMMENT_NODE: // Comment, do nothing break; default: