Esanders has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/203014

Change subject: Follow-up I23d37e3d: Remove unused converter method
......................................................................

Follow-up I23d37e3d: Remove unused converter method

We no longer create meta templates.

Change-Id: I6e370be3f11cf4d090327dea93c22c7388b9f898
---
M src/dm/ve.dm.Converter.js
1 file changed, 0 insertions(+), 46 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor 
refs/changes/14/203014/1

diff --git a/src/dm/ve.dm.Converter.js b/src/dm/ve.dm.Converter.js
index 99ac597..10c38e4 100644
--- a/src/dm/ve.dm.Converter.js
+++ b/src/dm/ve.dm.Converter.js
@@ -1009,52 +1009,6 @@
 };
 
 /**
- * Check if all the domElements provided are metadata or whitespace.
- *
- * A list of model names to exclude when matching can optionally be passed.
- *
- * @param {Node[]} domElements DOM elements to check
- * @param {string[]} [excludeTypes] Model names to exclude when matching DOM 
elements
- * @returns {boolean} All the elements are metadata or whitespace
- */
-ve.dm.Converter.prototype.isDomAllMetaOrWhitespace = function ( domElements, 
excludeTypes ) {
-       var i, childNode, modelName, modelClass;
-
-       for ( i = 0; i < domElements.length; i++ ) {
-               childNode = domElements[i];
-               switch ( childNode.nodeType ) {
-                       case Node.ELEMENT_NODE:
-                       case Node.COMMENT_NODE:
-                               modelName = this.modelRegistry.matchElement( 
childNode, false, excludeTypes );
-                               modelClass = this.modelRegistry.lookup( 
modelName ) || ve.dm.AlienNode;
-                               if (
-                                       !( modelClass.prototype instanceof 
ve.dm.Annotation ) &&
-                                       !( modelClass.prototype instanceof 
ve.dm.MetaItem )
-                               ) {
-                                       // If the element not meta or an 
annotation, then we must have content
-                                       return false;
-                               }
-                               // Recursively check children
-                               if (
-                                       childNode.childNodes.length &&
-                                       !this.isDomAllMetaOrWhitespace( 
childNode.childNodes, excludeTypes )
-                               ) {
-                                       return false;
-                               }
-                               continue;
-                       case Node.TEXT_NODE:
-                               // Check for whitespace-only
-                               if ( !childNode.data.match( /\S/ ) ) {
-                                       continue;
-                               }
-                               break;
-               }
-               return false;
-       }
-       return true;
-};
-
-/**
  * Convert document model to an HTML DOM
  *
  * @method

-- 
To view, visit https://gerrit.wikimedia.org/r/203014
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6e370be3f11cf4d090327dea93c22c7388b9f898
Gerrit-PatchSet: 1
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to