Merge "Efficiency improvement for MWLanguageVariantNode#hasRendering"

This commit is contained in:
jenkins-bot 2017-10-13 21:02:55 +00:00 committed by Gerrit Code Review
commit 82c8e64f8f

View file

@ -162,6 +162,16 @@ ve.ce.MWLanguageVariantNode.prototype.createInvisibleIcon = function () {
return icon.$element; return icon.$element;
}; };
/**
* @inheritdoc
*/
ve.ce.MWLanguageVariantNode.prototype.hasRendering = function () {
// Efficiency improvement: the superclass implementation does a bunch
// of DOM measurement to determine if the node is empty.
// Instead consult the model for a definitive answer.
return !this.model.isHidden();
};
/** /**
* ContentEditable MediaWiki language variant block node. * ContentEditable MediaWiki language variant block node.
* *