mediawiki-extensions-Visual.../modules/ve-mw/preinit
Bartosz Dziewoński 461c76981f Rewrite mw.libs.ve.getTargetDataFromHref with URL API
At first I was going for a more minimal replacement of mw.Uri with URL,
until I discovered that this code depends on a mw.Uri bug that would be
difficult to replicate:

  // Expected: Relative URLs are accepted
  new mw.Uri( '/foo' ).toString() // => 'https://localhost/foo'
  // Expected: Protocol is optional
  new mw.Uri( 'example.com/foo' ).toString() // => 'https://example.com/foo'
  // Unexpected: Treated as empty domain with no protocol rather than relative URL
  new mw.Uri( './foo' ).toString() // => 'https://./foo'

So I went for a bigger rewrite to preserve the intent rather than the
exact logic.

I had to change some test cases to use more realistic fake data. They
previously relied on bugs in our URL handling to pass despite the base
URLs being incorrect, particularly for non-short URLs (see T270219).
In my testing non-short URLs behave the same as before in practice.

Depends-On: I07a8c097dba0f5572c0aedf4febdf1434063ea6f
Bug: T325249
Change-Id: I232361266c1dda795b88018c3aaa3d9ecbe42b93
2023-01-23 14:59:23 +00:00
..
styles Only hide #siteNotice on skins where it's shown in the editable area 2022-11-29 21:19:46 +01:00
.eslintrc.json Prefere ve.extendObject over $.extend 2021-11-15 21:30:19 +00:00
ve.init.mw.ArticleTargetLoader.js Replace mediawiki.Uri with native URL (easy cases) 2023-01-03 22:18:01 +01:00
ve.init.mw.ArticleTargetSaver.js Merge "Log whenever browser plugin spam is detected" 2022-02-21 23:29:39 +00:00
ve.init.mw.DesktopArticleTarget.init.js Replace mediawiki.Uri with native URL (ArticleTarget) 2023-01-09 20:34:27 +00:00
ve.init.mw.DiffLoader.js Move vars inline in preinit code 2021-05-05 18:06:37 +01:00
ve.init.mw.DiffPage.init.js Replace mediawiki.Uri with native URL (easy cases) 2023-01-03 22:18:01 +01:00
ve.init.mw.ProgressBarWidget.js doc: Bump copyright year for 2020 2020-01-08 09:13:24 -08:00
ve.init.mw.TempWikitextEditorWidget.js Use term "wikitext" when working with TempWikitextEditorWidget 2021-06-09 10:23:36 +02:00
ve.init.MWEditingTabDialog.js build: Update eslint-config-wikimedia to 0.17.0 2020-08-18 13:16:49 +01:00
ve.init.MWEditModeTool.js Update and fix all @param config and @cfg documentation 2021-09-12 12:35:27 +00:00
ve.init.MWVESwitchConfirmDialog.js doc: Bump copyright year for 2020 2020-01-08 09:13:24 -08:00
ve.init.MWVESwitchPopupWidget.js Move vars inline in preinit code 2021-05-05 18:06:37 +01:00
ve.init.MWWelcomeDialog.js eslint: Enable no-jquery/no-append-html 2021-12-16 02:04:11 +01:00
ve.utils.parsoid.js Rewrite mw.libs.ve.getTargetDataFromHref with URL API 2023-01-23 14:59:23 +00:00