A new URL elision function may land soon, which differs from ElideUrl() in a number of ways.
- It doesn't favor the filename in a path.
- It elides the hostname blindly from the left, without special handling of subdomain.
- It returns a Parsed struct describing the shortened URL, which can be used to emphasize and style the result.
The new method targets URLs displayed in VR. Currently, for security, if the VR browser encounters a URL with a hostname too long for the URL bar, the browser kicks out of VR completely. We need to fix this, allowing the URL to be both shortened and properly styled.
At the same time, VR can't afford the runtime penalty imposed by ElideUrl()'s n^2 path elision approach.
This bug tracks the convergence of these two approaches. That means (at least):
- Updating both methods to measure text in LTR direction, matching how the string should later be rendered.
- Reworking the file-preserving path elision algorithm to be faster, such that VR can leverage it.
- Getting approval to have ElideUrl() drop its special handling of subdomains, in favor of Enamel's recommendation to simply elide the host from the left side.
- Settling on one or more wrapper functions around a single elision method, or, using a unified ElideUrl() everywhere.
Comment 1 by est...@chromium.org
, Nov 10 2017