Closed Bug 1760709 Opened 3 years ago Closed 3 years ago

Arrowkeys navigation for the Website appearance section is in reverse for RTL

Categories

(Core :: DOM: Core & HTML, defect)

defect

Tracking

()

VERIFIED FIXED
100 Branch
Tracking Status
firefox100 --- verified

People

(Reporter: itiel_yn8, Assigned: emilio)

References

Details

(Keywords: rtl)

Attachments

(3 files)

STR:

  1. Enable bidi on the toolbox (or otherwise use an RTL build)
  2. Open about:preferences, scroll to the Website appearance section
  3. Select the last (leftmost) option there, hit the Left arrow key

AR & ER:
Selection goes to the Light theme instead of Nightly's theme

Component: Theme → Preferences
Attached file Test-case. (deleted) —

This is a more general issue, afaict.

Test-case works ok in Blink, need to check WebKit. Indeed they reverse the forward / backward meaning for RTL: https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/html/forms/radio_input_type.cc;l=135-137;drc=a46c11e44a13db20a366c86418679740516a4401

A spot-fix would be something like:

diff --git a/browser/themes/shared/preferences/preferences.css b/browser/themes/shared/preferences/preferences.css
index d8478c3f21ce7..95c49671e84e4 100644
--- a/browser/themes/shared/preferences/preferences.css
+++ b/browser/themes/shared/preferences/preferences.css
@@ -1482,6 +1482,11 @@ richlistitem .text-link:hover {
   gap: 16px;
 }
 
+#web-appearance-chooser:dir(rtl) {
+  /* Ensure that item order matches markup for key navigation to work */
+  flex-direction: row-reverse;
+}
+
 #web-appearance-chooser,
 #web-appearance-override-warning {
   margin: 12px 0;

Which would ensure markup order. But I think the Blink behavior is reasonable, and a bit less surprising.

Assignee: nobody → emilio

We have similar code for range inputs. This matches Blink (but not
WebKit), but I think it's a better default.

The spec seems to leave this up to UAs, so for now landing a
moz-specific WPT. Should be trivial to upstream if we want.

Depends on D141705

Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/6c97b9e07bf5 Remove some useless namespacing in HTMLInputElement. r=smaug https://hg.mozilla.org/integration/autoland/rev/41164ab04484 Take directionality into account when handling left/right on radios. r=smaug

The patches are in DOM code so moving over there.

Component: Preferences → DOM: Core & HTML
Product: Firefox → Core
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 100 Branch

This works great now, thanks!

Status: RESOLVED → VERIFIED
Blocks: 1603156
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: