Commit ec556b1e authored by Carlos IL's avatar Carlos IL Committed by Commit Bot

Disable simplified domain display for URLs with bidi hosts

Elision can be broken for URLs in which the tld appears separate from
the rest of the host, which can happen for some bidirectional hosts.
This disables elision completely for any URL with a bidirectional
host component while the bugs are fixed.

Bug: 1117631
Change-Id: Ib47b77ec8331b82810383d8c558c33912aad992c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2388910Reviewed-by: default avatarTommy Li <tommycli@chromium.org>
Commit-Queue: Carlos IL <carlosil@chromium.org>
Cr-Commit-Position: refs/heads/master@{#804002}
parent b42738af
...@@ -2522,6 +2522,14 @@ bool OmniboxViewViews::IsURLEligibleForSimplifiedDomainEliding() { ...@@ -2522,6 +2522,14 @@ bool OmniboxViewViews::IsURLEligibleForSimplifiedDomainEliding() {
AutocompleteInput::ParseForEmphasizeComponents( AutocompleteInput::ParseForEmphasizeComponents(
text, model()->client()->GetSchemeClassifier(), &scheme, &host); text, model()->client()->GetSchemeClassifier(), &scheme, &host);
// TODO(crbug.com/1117631): Simplified domain elision can have bugs for some
// URLs with bidirectional hosts, disable elision for those URLs while the
// bugs are fixed.
const base::string16 url_host = text.substr(host.begin, host.len);
if (base::i18n::GetStringDirection(url_host) ==
base::i18n::TextDirection::UNKNOWN_DIRECTION) {
return false;
}
const base::string16 url_scheme = text.substr(scheme.begin, scheme.len); const base::string16 url_scheme = text.substr(scheme.begin, scheme.len);
// Simplified domain display only makes sense for http/https schemes; for now // Simplified domain display only makes sense for http/https schemes; for now
// we don't want to mess with the display of other URLs like data:, blob:, // we don't want to mess with the display of other URLs like data:, blob:,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment