Bartosz Dziewoński has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/376507 )

Change subject: Do not "resolve attributes" in toDomElements() overrides
......................................................................

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
---
M modules/ve-mw/dm/nodes/ve.dm.MWExtensionNode.js
M modules/ve-mw/dm/nodes/ve.dm.MWTransclusionNode.js
2 files changed, 0 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor 
refs/changes/07/376507/1

diff --git a/modules/ve-mw/dm/nodes/ve.dm.MWExtensionNode.js 
b/modules/ve-mw/dm/nodes/ve.dm.MWExtensionNode.js
index 9ffe0a4..ad62654 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 @@
                        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 0d757c3..f28a5aa 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 @@
                        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;
 };

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie0a5d6e1c57b8efdbbfba0c24f31ca91d156e200
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński <matma....@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to