Bug 127958 - Making URL stop treating an assigned empty port as "0" instead of ""
Summary: Making URL stop treating an assigned empty port as "0" instead of ""
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 128023
  Show dependency treegraph
 
Reported: 2014-01-30 15:04 PST by Maciej Stachowiak
Modified: 2023-08-23 00:22 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Maciej Stachowiak 2014-01-30 15:04:59 PST
Making URL stop treating an assigned empty port as "0" instead of "". Other browsers don't do it and it's probably wrong.
Comment 1 akirk 2020-01-07 02:39:21 PST
The spec (https://url.spec.whatwg.org/#dom-url-port) actually says this:

> If the given value is the empty string, then set context object’s url’s port to null.
And in the getter:

> If context object’s url’s port is null, return the empty string.
So in my opinion this needs to be changed to what the other browsers implemented.
Comment 2 Anne van Kesteren 2023-08-23 00:22:38 PDT
From our text expectation files:

PASS URL: Setting <http://example.net:8080>.port = '' Port number is removed if empty is the new value