New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 630481 link

Starred by 4 users

Issue metadata

Status: Fixed
Owner:
Long OOO (go/where-is-mgiuca)
Closed: Aug 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug



Sign in to add a comment

URLs in title bar should be in LTR embedding

Project Member Reported by mgiuca@chromium.org, Jul 22 2016

Issue description

Version: 54
OS: All

What steps will reproduce the problem?
(1) Make an empty file site/ا/test.html.
(2) cd site
(3) Run python -m SimpleHTTPServer.
(4) Visit: http://127.0.0.1:8000/%D8%A7/test.html

The key here is that you used an IP address, not a domain, and that the path contains an Arabic character U+FE70 ARABIC FATHATAN ISOLATED FORM). This is essentially the same bug as  Issue 495933  but in the title, not the Omnibox (so it isn't security).

What is the expected output?
The tab title shows:
127.0.0.1:8000/‎ا‬/test.html

What do you see instead?
The tab title shows:
test.html/‪ا‬‬/127.0.0.1:8000

This is due to the Arabic character causing the entire URL to be rendered in an RTL context (so the domain is shown on the right). We fixed this in the Omnibox in  Issue 495933 ; we should fix it elsewhere.

RFC 3987 § 4.1 states: "Bidirectional IRIs MUST be rendered in the same way as they would be if they were in a left-to-right embedding; i.e., as if they were preceded by U+202A, LEFT-TO-RIGHT EMBEDDING (LRE), and followed by U+202C, POP DIRECTIONAL FORMATTING (PDF)."; we are not compliant here. Because it is non-editable, we can literally just insert U+202A and U+202C here.

There is a function url_formatter::FormatUrl which is responsible for making URLs presentable throughout Chrome. We could add it here, but it might have unintended consequences. A more targeted approach would be to add it in NavigationEntryImpl::GetTitleForDisplay.
 
title-rtl.png
6.6 KB View Download
Project Member

Comment 2 by bugdroid1@chromium.org, Aug 1 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c2099b61204ff4d273fdf9fc136bcb02d76093f6

commit c2099b61204ff4d273fdf9fc136bcb02d76093f6
Author: mgiuca <mgiuca@chromium.org>
Date: Mon Aug 01 06:50:20 2016

Default page title (the page's URL) is now in an LTR embedding.

Only affects URLs with strong right-to-left characters.

This fixes the case where the URL contains RTL characters, causing the
components of the URL to be rendered from right to left. The display is
now consistent with the Omnibox display of URLs and compliant with RFC
3987.

BUG= 630481 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation

Review-Url: https://codereview.chromium.org/2176463002
Cr-Commit-Position: refs/heads/master@{#408920}

[modify] https://crrev.com/c2099b61204ff4d273fdf9fc136bcb02d76093f6/content/browser/frame_host/navigation_entry_impl.cc
[modify] https://crrev.com/c2099b61204ff4d273fdf9fc136bcb02d76093f6/content/browser/frame_host/navigation_entry_impl_unittest.cc

Status: Fixed (was: Started)

Sign in to add a comment