normalize port after updating protocol

Issue #12555073 • Assigned to Kris K.

Details

Author
Timothy G.
Created
Jun 29, 2017
Privacy
This issue is public.
Found in
  • Microsoft Edge
Standard affected
URL Standard

Reports
Reported by 1 person

Sign in to watch or report this issue.

Steps to reproduce

var url = new URL('http://microsoft.com:443');
url.protocol = 'https:';
console.log(url.port);
  // Edge prints "443" ❌
  // Chrome, Safari, Firefox print "" ✅

Currently, the above piece of code prints the empty string on Chrome, Safari, and Firefox, yet in Edge “443” is printed. Indeed, Edge’s behavior is compliant with the WHATWG URL Standard as of right now, but WHATWG has decided to adopt Chrome, Safari, and Firefox’s behavior in whatwg/url#328 as it allows the URL interface to be idempotent. Appropriate tests for this spec change are added to Web Platform Tests in https://github.com/w3c/web-platform-tests/pull/6346

Interestingly, our test suite reveals that Edge’s HTMLAnchorElement and HTMLAreaElement interfaces already conform to the correct behavior, just not URL: https://travis-ci.org/w3c/web-platform-tests/jobs/247364803#L861

var el = document.createElement('a');
el.href = 'http://microsoft.com:443/';
el.protocol = 'https:';
console.log(el.port);
  // Edge, Chrome, Safari, Firefox all print "" ✅
  // Internet Explore 11 prints "443" ❌

Attachments

0 attachments

    Comments and activity

    • Changed Steps to Reproduce

      Changed Steps to Reproduce

    • Microsoft Edge Team

      Changed Assigned To to “Steven K.”

      Changed Assigned To to “Travis L.”

      Changed Assigned To from “Travis L.” to “Kris K.”

    You need to sign in to your Microsoft account to add a comment.

    Sign in