Re: [whatwg/url] Restructure URL rendering section and add additional guidance (#434)

estark37 commented on this pull request.



>  
- <li><p>Other parts of the <a for=/>URL</a> should have their sequences of
- <a>percent-encoded bytes</a> replaced with code points resulting from
- <a>percent decoding</a> those sequences converted to bytes, unless that renders those
- sequences invisible.
+ <li><p>A URL can be rendered without its <a for=url>scheme</a> if the display surface only ever
+ permits a single scheme (such as a browser feature that omits <code>https://</code> because it is
+ only enabled for secure origins). Otherwise, the scheme may be replaced or supplemented with a
+ human-readable string (e.g., "Not secure") and/or a security indicator icon.
+
+ <li><p>A leading <code>www</code> domain label can be omitted to simplify the host, except when it
+ is part of the <a for=host>registrable domain</a>.

The main issue was a bug in the implementation, which has now been fixed. We are planning on re-landing the change in Chrome and so it would be great to have it documented here.

Chrome's implementation unelides and shows the full domain when you copy/select/edit the URL, which is intended to minimize confusion if the site is not reachable without 'www'. We also did an analysis of top sites and found that it's uncommon to serve different content at www vs bare domain, or have one be reachable but not the other. (Only 2% of Alexa top 500 hosts serve different content at www vs bare domain.)

Finally, I think this guidance is also somewhat in line with what Safari does: they don't elide www specifically, but they show the registrable domain only. The underlying reasoning is the same -- it's okay to show a subset of the actual host in service of helping users understand the site identity better. (In fact, one possibility might be to fold this bullet in with the first bullet and phrase it more as "Browsers are encouraged to render a URL's host only. Browsers may further consider rendering only the most relevant parts of a host, such as omitting a leading 'www' domain label or rendering the registrable domain only.") WDYT?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/url/pull/434#discussion_r267486394

Received on Wednesday, 20 March 2019 18:30:10 UTC