From bb6cd3382146627f5d249266fea37d54b58c1219 Mon Sep 17 00:00:00 2001 From: Ed Sanders Date: Mon, 4 Jun 2018 18:14:45 +0100 Subject: [PATCH] VisualDiff: Don't compare images with different src's Bug: T196343 Change-Id: I99ddce806e044ca427bf01b41d164c89dd2e15fd --- modules/ve-mw/dm/nodes/ve.dm.MWImageNode.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/ve-mw/dm/nodes/ve.dm.MWImageNode.js b/modules/ve-mw/dm/nodes/ve.dm.MWImageNode.js index d8ef51ee26..bf1fa07b80 100644 --- a/modules/ve-mw/dm/nodes/ve.dm.MWImageNode.js +++ b/modules/ve-mw/dm/nodes/ve.dm.MWImageNode.js @@ -104,6 +104,11 @@ ve.dm.MWImageNode.static.getMatchRdfaTypes = function () { ve.dm.MWImageNode.static.allowedRdfaTypes = [ 'mw:Error' ]; +ve.dm.MWImageNode.static.isDiffComparable = function ( element, other ) { + // Images with different src's shouldn't be diffed + return element.type === other.type && element.attributes.resource === other.attributes.resource; +}; + ve.dm.MWImageNode.static.describeChanges = function ( attributeChanges, attributes ) { var key, sizeFrom, sizeTo, change, customKeys = [ 'width', 'height', 'defaultSize', 'src', 'href' ],