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

Issue metadata

Status: Verified
Owner:
Closed: Apr 2014
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Chrome
Pri: 2
Type: Feature

Blocked on:
issue 327294



Sign in to add a comment

There seems to be no way to set an input's direction on Linux nor Chrome OS

Reported by aharon.l...@gmail.com, Aug 1 2011

Issue description

Chrome Version       : 13.0.782.107 beta
URLs (if applicable) : data:text/html,<textarea> or data:text/html,<input>
Other browsers tested:
Add OK or FAIL after other browsers where you have tested this issue:
     Safari 5: OK
  Firefox 4.x: OK
       IE 7/8/9: OK

What steps will reproduce the problem?
1. Go to the url above or any other page with a textarea or text input in Chrome on Linux.
2. Try to set the direction of the element to RTL. In IE and in Chrome on Windows, this is done using Ctrl-Right-SHIFT. In Safari, this is done using the right-click menu. In Firefox, this is done using Ctrl-Shift-X.

What is the expected result?
The browser should provide some method to set the input/textarea direction. This is even a "should" in HTML5 ("If the element is mutable, the user agent should allow the user to change the writing direction of the element, setting it either to a left-to-right writing direction or a right-to-left writing direction.").

What happens instead?
None of the methods listed above seem to work in Chrome on Linux.

Please provide any additional information below. Attach a screenshot if
possible.

 

Comment 1 by tkent@chromium.org, Aug 2 2011

Labels: -Type-Bug -Area-Undefined Type-Feature Area-WebKit WebKit-Forms WebKit-Editing OS-Linux

Comment 2 by tkent@chromium.org, Aug 2 2011

Labels: Feature-I18N
Cc: evan@chromium.org gaal@google.com hbono@chromium.org progame@chromium.org
Evan, Gaal: Do you know of a way to do this?
Labels: WebKit-RTL

Comment 5 by gaal@google.com, Aug 2 2011

My intuition is that this belongs in a toolkit layer like GTK+. But there seems to be no standard way to do it there either, yet? So I really don't have a strong opinion here.

FWIW, Firefox 3.6.18 still has bugs with its implementation of ctrl-shift-x: el.dir stays "" after using it, and the firebug console input field gets confused too. This may have been fixed in newer versions, though.

Comment 6 by prog...@gmail.com, Aug 2 2011

it's surprising we don't already have an issue about this, we discussed it previously in the related  issue 15901 
> FWIW, Firefox 3.6.18 still has bugs with its implementation of ctrl-shift-x:
> el.dir stays "" after using it, and the firebug console input field gets confused
> too. This may have been fixed in newer versions, though.

I have a filed a bug on Mozilla about that: https://bugzilla.mozilla.org/show_bug.cgi?id=675579. I also have a bug on WebKit that it doesn't fire the input event when the user changes the direction (https://bugs.webkit.org/show_bug.cgi?id=50952). Both are required by HTML5.

Comment 8 by hbono@chromium.org, Aug 3 2011

Greetings,

If I understand this thread correctly, Linux Chrome needs to add the ctrl+shift+x shortcut so Linux users can toggle the input direction as Linux Firefox does, right? (If this shortcut does not cause conflicts with existing shortcuts of Linux Chrome, it is easy to add it.)

Regards,
Ctrl-Shift-X is the shortcut that Firefox uses for toggling direction. It is a Firefox thing. It is *not* what IE and Chrome/Windows use (which is Ctrl-Left Shift for LTR and Ctrl-Right Shift for RTL), and it is not what Safari and Chrome/Mac use (which is a Writing Direction entry in the right-click menu for the control). I think that we should prefer either (or both!) of the two latter methods, since RTL users are more familiar with them, and for the sake of consistency within Chrome.
A few more random thoughts:

- I really don't know the Chrome internals, but it could well be that the reason Chrome supports the Ctrl-Shifts in Windows and the right-click menu item in Mac is that it is simply letting the OS native control do its thing.

- That does not mean that Chrome doesn't have to do anything if Linux native controls don't provide this functionality. It is important functionality, and HTML5 says Chrome "should" do it (regardless of what Linux does or does not do).

- I personally don't think that there is anything wrong with supporting all three methods. It's more a matter of what is feasible, not what is best. If the Ctrl-Shifts and the right-click menu item are impossible on Linux, then Ctrl-Shift-X it is.

- I personally think that the right-click menu item is great because it is the most discoverable. If it could be present in Chrome on all three platforms, that would be great. (That does not mean we should then stop supporting the Ctrl-Shifts on Windows - backwards compatibility and OS standards compatibility requires supporting them.)
Don't worry, there are no plans to change the behavior under Windows. Ctrl+Shift is supported in Chrome under Windows due to the hard work of hbono among others and not the "OS doing its thing".
Greetings,

(in reply to comment #10)
> - I personally think that the right-click menu item is great because it is
> the most discoverable. If it could be present in Chrome on all three
> platforms, that would be great. (That does not mean we should then stop
> supporting the Ctrl-Shifts on Windows - backwards compatibility and OS
> standards compatibility requires supporting them.)

Thank you for your suggestions. It is easy to add the right-click menu to Linux. (We just enable some Mac-specific code on Linux, including resource strings.) I'm happy to write a change that adds the right-click menu to Linux if there are any objections.

Regards,

Hironori Bono

Comment 13 by kareng@google.com, Aug 10 2011

Owner: hbono@chromium.org
Status: Assigned

Comment 14 by evan@chromium.org, Jun 11 2012

Cc: -evan@chromium.org
(Un-ccing myself from bugs.)

Comment 15 by evan@chromium.org, Jun 11 2012

(Un-ccing myself from bugs.)
So, Hironori, do you want to give it a wack?
Can somebody please on this? And can we make sure that it works for ChromeOS too?

I should note that WebKit also applies the paragraph direction command to contentEditable, which means that the feature would be very useful in Gmail and other editors based on contentEditable.
Owner: ----
Status: Available
Do you have an corresponding webkit bug filed? 

We need to find somebody to work on this.  

@jeremy, can you think of any?  


I do not have a WebKit bug filed, but I am not sure that one is necessary. Chrome does offer shortcuts to set the paragraph direction on Windows and Mac, as does Safari.
Cc: e...@chromium.org
jshin: no idea who can take this, can you find out whose working on Linux/ChromeOS UI.
erg: Do you know who might be able to look at this?
Project Member

Comment 21 by bugdroid1@chromium.org, Mar 10 2013

Labels: -Area-WebKit -WebKit-Forms -WebKit-Editing -Feature-I18N -WebKit-RTL Cr-Content-RTL Cr-Content Cr-Content-Forms Cr-Content-Editing Cr-UI-I18N
Project Member

Comment 22 by bugdroid1@chromium.org, Mar 20 2013

Labels: -Cr-UI-I18N Cr-UI-Internationalization
Project Member

Comment 23 by bugdroid1@chromium.org, Apr 6 2013

Labels: -Cr-Content Cr-Blink
Project Member

Comment 24 by bugdroid1@chromium.org, Apr 6 2013

Labels: -Cr-Content-RTL Cr-Blink-RTL
Project Member

Comment 25 by bugdroid1@chromium.org, Apr 6 2013

Labels: -Cr-Content-Editing Cr-Blink-Editing
Project Member

Comment 26 by bugdroid1@chromium.org, Apr 6 2013

Labels: -Cr-Content-Forms Cr-Blink-Forms
Cc: kenjibaheux@chromium.org
Summary: There seems to be no way to set an input's direction on Linux nor (was: There seems to be no way to set an input's direction on Linux)
Labels: OS-Chrome
Owner: kenjibaheux@chromium.org
Status: Assigned
Summary: There seems to be no way to set an input's direction on Linux nor Chrome OS (was: There seems to be no way to set an input's direction on Linux nor )
Could not find a shortcut or a context menu item in Chrome OS either.
I will try to reach out to Chrome OS folks to confirm the shortcut and UX if any.
Owner: ----
Status: Available
At the very least, there should be a way to do that from the context menu.

As for the shortcut if one is needed, we should opt for the Windows standard. For Chrome OS in particular, it's important to make sure that no one is using it already or was planning to use it.

Marking as available. 
Owner: hbono@chromium.org
hbono: I think we should move forward with your context-menu solution.  This is a top-issue for bidi users and your simple solution would at least make this possible.
Owner: ----
I'm told bono-san is no longer at Google.
According to our Bidi team, this is our #2 bidi issue.  It should be trivial to fix.

I tried:
diff --git a/Source/web/ContextMenuClientImpl.cpp b/Source/web/ContextMenuClientImpl.cpp
index 525c4c2..161f2c0 100644
--- a/Source/web/ContextMenuClientImpl.cpp
+++ b/Source/web/ContextMenuClientImpl.cpp
@@ -346,7 +346,7 @@ void ContextMenuClientImpl::showContextMenu(const WebCore::ContextMenu* defaultM
         }
     }
 
-#if OS(MACOSX)
+#if OS(MACOSX) || OS(LINUX)
     if (selectedFrame->editor().selectionHasStyle(CSSPropertyDirection, "ltr") != FalseTriState)
         data.writingDirectionLeftToRight |= WebContextMenuData::CheckableMenuItemChecked;
     if (selectedFrame->editor().selectionHasStyle(CSSPropertyDirection, "rtl") != FalseTriState)


But that didn't seem to change behavior in my testing.  I'm not quite sure where the context menu is built in Chrome/Blink.
Nevermind, missed a bunch of other plumbing.  Fixing now.
Blink: https://codereview.chromium.org/27236005
Chromium: https://codereview.chromium.org/27361002

Those don't work yet, but they should be close.  Unfortunately I have other pressing bugs to attend to today.
Cc: sanjoy@chromium.org
Cc: -sanjoy@chromium.org sanjoy....@samsung.com
Wrong Sanjoy. :(

Comment 38 by groby@chromium.org, Nov 13 2013

eseidel: Almost - you need to build the menu entries, too. See RenderContextMenuMac, look for IDC_WRITING_DIRECTION_LTR

(Sorry, swamped with other things or I'd add the code myself)
Cc: aharon.l...@gmail.com
void RenderViewContextMenuMac::AppendPlatformEditableItems() {
  // OS X provides a contextual menu to set writing direction for BiDi
  // languages.
  // This functionality is exposed as a keyboard shortcut on Windows & Linux.
  AppendBidiSubMenu();
}

Is that comment true?  Is this exposed as a keyboard shortcut on Linux?

My impression from the bidi meeting this morning was that we expose this as ctrl-shift on linux?  Do we still want this context menu on Linux too?
> My impression from the bidi meeting this morning
> was that we expose this as ctrl-shift on linux

Not sure what gave you that impression.

I know of no way to set direction on Chrome anything (native fields or elements) on Linux.
eseidel: looking into the patches posted by you, i shall upload an updated patch.
Project Member

Comment 42 by bugdroid1@chromium.org, Nov 20 2013

The following revision refers to this bug:
    http://src.chromium.org/viewvc/blink?view=rev&rev=162341

------------------------------------------------------------------------
r162341 | sanjoy.pal@samsung.com | 2013-11-20T07:47:39.355579Z

Changed paths:
   M http://src.chromium.org/viewvc/blink/trunk/public/web/WebContextMenuData.h?r1=162341&r2=162340&pathrev=162341
   M http://src.chromium.org/viewvc/blink/trunk/Source/web/ContextMenuClientImpl.cpp?r1=162341&r2=162340&pathrev=162341

Blink side changes for adding Writing direction to the context menu for linux gtk

Chromium side CL is here https://codereview.chromium.org/73963004/

BUG= 91178 

Review URL: https://codereview.chromium.org/66313007
------------------------------------------------------------------------
Project Member

Comment 43 by bugdroid1@chromium.org, Nov 21 2013

------------------------------------------------------------------------
r236515 | sanjoy.pal@samsung.com | 2013-11-21T13:10:11.923247Z

Changed paths:
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/common/view_messages.h?r1=236515&r2=236514&pathrev=236515
   M http://src.chromium.org/viewvc/chrome/trunk/src/chrome/app/chrome_command_ids.h?r1=236515&r2=236514&pathrev=236515
   M http://src.chromium.org/viewvc/chrome/trunk/src/chrome/browser/ui/gtk/tab_contents/render_view_context_menu_gtk.cc?r1=236515&r2=236514&pathrev=236515
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/public/common/context_menu_params.cc?r1=236515&r2=236514&pathrev=236515
   M http://src.chromium.org/viewvc/chrome/trunk/src/chrome/app/generated_resources.grd?r1=236515&r2=236514&pathrev=236515
   M http://src.chromium.org/viewvc/chrome/trunk/src/chrome/browser/ui/gtk/tab_contents/render_view_context_menu_gtk.h?r1=236515&r2=236514&pathrev=236515
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/public/common/context_menu_params.h?r1=236515&r2=236514&pathrev=236515
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/renderer/context_menu_params_builder.cc?r1=236515&r2=236514&pathrev=236515

Adding Writing direction to the context menu for linux gtk.

Blink side change is here https://codereview.chromium.org/66313007/

This CL takes care of the context menu on Linux Gtk. Most of the changes are copied from Writing direction context menu entry implementation on MacOSX. There seems to be no way to change writing direction on Aura. I would like create a separate CL to implement the same on Aura. 

BUG= 91178 
TBR=cpu@chromium.org

Review URL: https://codereview.chromium.org/73963004
------------------------------------------------------------------------
Review in progress for ChromeOs Aura https://codereview.chromium.org/83163002/. Some questions posted by pkasting, quoting from codereview.

"context menus should always be a secondary way of triggering some functionality.  It seems like adding a keyboard shortcut should happen either first or at least alongside this patch.

Also why wouldn't we be consistent and expose the context menu here on Windows
as well?  It doesn't make sense to me to implement this only for some platforms.
 Or is such an option already exposed in the Windows context menu some other
way?"

We need a decision. I shall update the patch once we have a decision.
Cc: pkasting@chromium.org
> is such an option already exposed in the Windows context menu?

There is no option to set directionality in the <input> context menu in Chrome on Windows (or, for that matter, in IE).

> why wouldn't we be consistent and expose the context menu here on Windows
as well?

I have no problem with that.

> context menus should always be a secondary way of triggering some functionality.

I am not sure that this is so cut-and-dry. The current context menu on <input> includes "Add as search engine..." and "Spellchecker options", and I see no way to trigger either of those except through the context menu. The context menu on <input> on Safari includes "Paragraph direction", but I am not aware of any shortcut or anything else to do that.

Regarding whether we should add Ctrl-Left-Shift and Ctrl-Right-Shift as shortcuts for setting direction in Chrome on ChromeOS and/or Linux, I have nothing against it - if it is actually feasible. It would indeed be the first thing that most RTL users (or at least those of them who are aware of the concept of setting direction) would try, since most of them were raised on Microsoft products, e.g. Word. But I do not think that doing that should block adding the option to the context menu.

I do not think we should consider using Ctrl-Shift-X because if we do so we should do it for all platforms, but that would block using Ctrl-Left-Shift and Ctrl-Right-Shift, and the latter are well known on Windows.
It sounds like the following would make everyone happy:

* Go ahead and land the context menu change, and do so for all platforms (including Windows).
* Attempt to add Ctrl-Shift shortcut support on CrOS and Linux to match the existing Windows behavior.
Cc: -hbono@chromium.org
Sanjoy posted a patch: https://codereview.chromium.org/83163002/
Project Member

Comment 49 by bugdroid1@chromium.org, Dec 6 2013

The following revision refers to this bug:
    http://src.chromium.org/viewvc/blink?view=rev&rev=163321

------------------------------------------------------------------------
r163321 | sanjoy.pal@samsung.com | 2013-12-06T12:53:38.076825Z

Changed paths:
   M http://src.chromium.org/viewvc/blink/trunk/Source/web/ContextMenuClientImpl.cpp?r1=163321&r2=163320&pathrev=163321
   M http://src.chromium.org/viewvc/blink/trunk/public/web/WebContextMenuData.h?r1=163321&r2=163320&pathrev=163321

[Blink] Adding Writing direction to the context menu for Aura.

Chromium side CL is here : https://codereview.chromium.org/83163002/

BUG= 91178 

Review URL: https://codereview.chromium.org/98453005
------------------------------------------------------------------------
Cc: yukishiino@chromium.org yukawa@chromium.org komatsu@chromium.org
Labels: Cr-UI-Input-Text-IME
#46
> * Attempt to add Ctrl-Shift shortcut support on CrOS and Linux to match the existing Windows behavior.

FYI, Ctrl-Shift on Windows is currently handled in ui/base/ime/input_method_win.cc.
http://src.chromium.org/viewvc/chrome/trunk/src/ui/base/ime/input_method_win.cc?revision=237976#l52

CCed IME folks (including me) to draw their attention.
Cc: stevet@chromium.org
Labels: Review-Product
Owner: stevet@chromium.org
Status: Assigned
Due considerations needs to happen before adding any additional shortcuts (on Chrome OS in particular); adding a shortcut also has additional obligations such as adding UMA => Assigned to stevet for his guidance.
Project Member

Comment 52 by bugdroid1@chromium.org, Dec 9 2013

------------------------------------------------------------------------
r239457 | sanjoy.pal@samsung.com | 2013-12-09T09:57:23.196157Z

Changed paths:
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/renderer/context_menu_params_builder.cc?r1=239457&r2=239456&pathrev=239457
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/common/view_messages.h?r1=239457&r2=239456&pathrev=239457
   M http://src.chromium.org/viewvc/chrome/trunk/src/chrome/app/chrome_command_ids.h?r1=239457&r2=239456&pathrev=239457
   M http://src.chromium.org/viewvc/chrome/trunk/src/chrome/browser/ui/views/tab_contents/render_view_context_menu_views.cc?r1=239457&r2=239456&pathrev=239457
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/public/common/context_menu_params.cc?r1=239457&r2=239456&pathrev=239457
   M http://src.chromium.org/viewvc/chrome/trunk/src/chrome/app/generated_resources.grd?r1=239457&r2=239456&pathrev=239457
   M http://src.chromium.org/viewvc/chrome/trunk/src/chrome/browser/ui/views/tab_contents/render_view_context_menu_views.h?r1=239457&r2=239456&pathrev=239457
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/public/common/context_menu_params.h?r1=239457&r2=239456&pathrev=239457

[Aura] Adding Writing direction to the context menu for Aura.

BUG= 91178 

Blink side changes are committed here https://codereview.chromium.org/66313007/

TBR=cpu@chromium.org,cdn@chromium.org

Review URL: https://codereview.chromium.org/83163002
------------------------------------------------------------------------
I'm not familiar with this feature on Windows w.r.t. how the keyboard shortcuts work, so I am trying to feel out a few things here before we go ahead assigning Ctrl+LShift/RShift.

* My main concern is that Ctrl+Shift is really easy to trigger accidentally, since there are a ton of Ctrl+Shift+something shortcuts. This could be very confusing for users if they trigger it by accident.

How does this behaviour work exactly, on Windows? Does RTL mode have to be enabled for this to be active at all, or is it active even in LTR cases?

Also, we would have to make this trigger on key release, since keying down Ctrl and Shift happens often before a Ctrl+Shift+something shortcut.

* Keyboard shortcuts should generally not be _primary_ way of triggering some functionality but this sounds moot now
* It does sound to me like they are a better option than Firefox's Ctrl+Shift+x 

> #53
Here is the implementation on Windows.
http://src.chromium.org/viewvc/chrome/trunk/src/ui/base/ime/input_method_win.cc?revision=237976#l52

My observations are:
- Ctrl+Shift+something never causes RTL/LTR flip  (fixed as  Issue 9762  and  Issue 9763 )
- Triggered on key release
- Triggered only when ui::IMM32Manager::IsRTLKeyboardLayoutInstalled() is true. (fixed as  Issue 9718 )

Hope this helps.
Owner: kenjibaheux@chromium.org
If this is only for RTL keyboard layouts, then it seems OK to have it for Ctrl+Shift (especially if it doesn't trigger easily).

Kenji, who should this go to?
Owner: sanjoy....@samsung.com
Sanjoy, can you help on the remaining bits? Thanks in advance.
Blockedon: chromium:327294
Filed  Issue 327294  to discuss how to implement these key combinations in a platform neutral way.
To implement these shortcuts, we need a similar API like ui::IMM32Manager::IsRTLKeyboardLayoutInstalled() for Linux and CrOS and also  Issue 327294  needs to be fixed.Then it will be just a wiring issue.  
This bug is now "Fixed" right?  We just have the shortcuts to implement?
In which version of Chrome should the context menu addition for Linux and ChromeOS start working?
Ok, the Writing Direction appears in the context menu in Version 33.0.1750.152 on Linux and ChromeOS, yay!

I am marking this bug as fixed.  Bug 327294  will track enabling Ctrl-Shift on Linux and ChromeOS.
Status: Verified

Sign in to add a comment