Adds a flag #left-to-right-urls to change BiDi URL rendering.

Normally, RTL characters in URLs can cause the URL to render certain
segments from right to left, in some cases placing the domain on the
right, or ordering domain labels from right to left. With this flag
enabled, components are always rendered from left to right, even if the
characters inside them are RTL.

For example (ASCII uppercase characters representing RTL): AB.CD.com
(domain CD.com) normally renders as DC.BA.com; with this flag, it
renders as BA.DC.com.

gfx::RenderText can now have its directionality mode set to
DIRECTIONALITY_AS_URL, which forces general URI delimeters and periods
as strong level 0 left-to-right sequences. Sequences of RTL characters
in between the delimiters retain their RTL direction, but the delimiters
themselves are forced to be LTR.

Only affects Views version of the Omnibox.

Bug: 351639
Change-Id: I514fe77c1a10273e3dcb69ced1a7dac3e8d85631
Reviewed-on: https://chromium-review.googlesource.com/624829
Commit-Queue: Matt Giuca <mgiuca@chromium.org>
Reviewed-by: Michael Wasserman <msw@chromium.org>
Reviewed-by: Jungshik Shin <jshin@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Reviewed-by: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#507005}

CrOS-Libchrome-Original-Commit: c399982f7c0763ece6947bd60e65b26fb482c2a8
3 files changed
tree: adb725bba47e3b8167418add5a2d6c6bbfa78035
  1. base/
  2. build/
  3. components/
  4. dbus/
  5. device/
  6. ipc/
  7. mojo/
  8. testing/
  9. third_party/
  10. ui/