Skip to content
Snippets Groups Projects

Issue #3519266: No need Node.cloneNode() in Drupal.url.toAbsolute()

Closed tom konda requested to merge issue/drupal-3519266:3519266-no-need-node.clonenode into 11.x
1 file
+ 1
4
Compare changes
  • Side-by-side
  • Inline
+ 1
4
@@ -404,7 +404,6 @@ window.Drupal = { behaviors: {}, locale: {} };
@@ -404,7 +404,6 @@ window.Drupal = { behaviors: {}, locale: {} };
*
*
* @see https://github.com/angular/angular.js/blob/v1.4.4/src/ng/urlUtils.js
* @see https://github.com/angular/angular.js/blob/v1.4.4/src/ng/urlUtils.js
* @see https://grack.com/blog/2009/11/17/absolutizing-url-in-javascript
* @see https://grack.com/blog/2009/11/17/absolutizing-url-in-javascript
* @see https://github.com/jquery/jquery-ui/blob/1.11.4/ui/tabs.js#L53
*/
*/
Drupal.url.toAbsolute = function (url) {
Drupal.url.toAbsolute = function (url) {
const urlParsingNode = document.createElement('a');
const urlParsingNode = document.createElement('a');
@@ -419,9 +418,7 @@ window.Drupal = { behaviors: {}, locale: {} };
@@ -419,9 +418,7 @@ window.Drupal = { behaviors: {}, locale: {} };
urlParsingNode.setAttribute('href', url);
urlParsingNode.setAttribute('href', url);
// IE <= 7 normalizes the URL when assigned to the anchor node similar to
return urlParsingNode.href;
// the other browsers.
return urlParsingNode.cloneNode(false).href;
};
};
/**
/**
Loading