From 98351fbcf30b03dae1dd8b23f36500cd291624e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Dziewo=C5=84ski?= Date: Thu, 7 Sep 2017 14:06:24 +0200 Subject: [PATCH] Do not "resolve attributes" in toDomElements() overrides Resolving attributes means turning 'href' and 'src' URLs from possibly relative to absolute, so that they don't depend on the base URI of the document. This is necessary when rendering for clipboard (and in some other cases), but at the point when toDomElements() is called, the document these elements are in does not necessary have a sane base URI set, giving us hrefs pointing to nonexistent pages. Don't do it here; it will happen later when we know what the right document (and right base URI) is, e.g. in ve.ce.Surface#onCopy or ve.ui.PreviewElement#replaceWithModelDom. Bug: T169675 Bug: T175157 Change-Id: Ie0a5d6e1c57b8efdbbfba0c24f31ca91d156e200 --- modules/ve-mw/dm/nodes/ve.dm.MWExtensionNode.js | 4 ---- modules/ve-mw/dm/nodes/ve.dm.MWTransclusionNode.js | 3 --- 2 files changed, 7 deletions(-) diff --git a/modules/ve-mw/dm/nodes/ve.dm.MWExtensionNode.js b/modules/ve-mw/dm/nodes/ve.dm.MWExtensionNode.js index 9ffe0a48e0..ad62654590 100644 --- a/modules/ve-mw/dm/nodes/ve.dm.MWExtensionNode.js +++ b/modules/ve-mw/dm/nodes/ve.dm.MWExtensionNode.js @@ -121,10 +121,6 @@ ve.dm.MWExtensionNode.static.toDomElements = function ( dataElement, doc, conver els = [ el ]; } } - if ( converter.isForClipboard() ) { - // Resolve attributes - ve.resolveAttributes( $( els ), doc, ve.dm.Converter.static.computedAttributes ); - } return els; }; diff --git a/modules/ve-mw/dm/nodes/ve.dm.MWTransclusionNode.js b/modules/ve-mw/dm/nodes/ve.dm.MWTransclusionNode.js index 0d757c3e61..f28a5aad99 100644 --- a/modules/ve-mw/dm/nodes/ve.dm.MWTransclusionNode.js +++ b/modules/ve-mw/dm/nodes/ve.dm.MWTransclusionNode.js @@ -203,9 +203,6 @@ ve.dm.MWTransclusionNode.static.toDomElements = function ( dataElement, doc, con els[ i ] = wrapTextNode( els[ i ] ); els[ i ].setAttribute( 'data-ve-ignore', 'true' ); } - - // Resolve attributes - ve.resolveAttributes( $( els ), doc, ve.dm.Converter.static.computedAttributes ); } return els; };