VisualDiff: Don't compare images with different src's

Bug: T196343
Change-Id: I99ddce806e044ca427bf01b41d164c89dd2e15fd
This commit is contained in:
Ed Sanders 2018-06-04 18:14:45 +01:00
parent b998e3cae3
commit bb6cd33821

View file

@ -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' ],