Closed Bug 1272012 Opened 8 years ago Closed 8 years ago

Up/Down key on a combobox with a closed dropdown menu should open it on OSX

Categories

(Core :: Layout: Form Controls, defect)

All
macOS
defect
Not set
minor

Tracking

()

RESOLVED FIXED
mozilla49
Tracking Status
firefox49 --- fixed

People

(Reporter: MatsPalmgren_bugz, Assigned: MatsPalmgren_bugz)

References

(Depends on 1 open bug)

Details

Attachments

(2 files, 1 obsolete file)

      No description provided.
Attached patch fix (obsolete) — Splinter Review
Attachment #8752329 - Flags: review?(enndeakin)
Attached patch test tweaksSplinter Review
I'll file a follow-up bug on enabling the few a11y tests I've disabled on OSX.

https://treeherder.mozilla.org/#/jobs?repo=try&revision=b996953f0b32
Comment on attachment 8752329 [details] [diff] [review]
fix

>+  bool dropDownMenuOnUpDown =
>+#ifdef XP_MACOSX
>+    IsInDropDownMode() && !mComboboxFrame->IsDroppedDown();
>+#else
>+    keyEvent->IsAlt();
>+#endif
>+  if (dropDownMenuOnUpDown &&
>+      (keyEvent->keyCode == NS_VK_UP || keyEvent->keyCode == NS_VK_DOWN)) {
>+    DropDownToggleKey(aKeyEvent);
>+    if (keyEvent->DefaultPrevented()) {
>+      return NS_OK;
>+    }
>+  }

Does your comment earlier in this method relate to the extra DefaultPrevented check here?

As an aside, Mac also opens dropdowns on a modified space key.
Attachment #8752329 - Flags: review?(enndeakin) → review+
(In reply to Neil Deakin from comment #3)
> Does your comment earlier in this method relate to the extra
> DefaultPrevented check here?

I intended it as an early return for the case we do open the menu -
DropDownToggleKey calls PreventDefault() here:
http://mxr.mozilla.org/mozilla-central/source/layout/forms/nsListControlFrame.cpp#2067

But you're right, it could have already been PreventDefault'ed
before that.  Given my earlier code comment there, that's probably
OK though.

> As an aside, Mac also opens dropdowns on a modified space key.

Good point, let's fix that while we're here.

My quick testing shows that:
OSX: spacebar *toggles* the menu, but not if Alt, Ctrl or Cmd is pressed.
IE11 on Windows 7, and native GTK apps behaves the same: spacebar *opens*
the menu but doesn't close it (with/without any key modifiers).

https://treeherder.mozilla.org/#/jobs?repo=try&revision=0f6864653aaf
Attached patch fix, v2Splinter Review
Added support for Space key.
Attachment #8752329 - Attachment is obsolete: true
Attachment #8752414 - Flags: review?(enndeakin)
Attachment #8752414 - Flags: review?(enndeakin) → review+
Filed bug 1275513 to re-enable the a11y tests I disabled on OSX in this bug.
Depends on: 1275513
sorry had to back this out for test failures like https://treeherder.mozilla.org/logviewer.html#?job_id=28650912&repo=mozilla-inbound
Flags: needinfo?(mats)
Hmm, yeah that test was added after I did my Try runs.
I totally blame Neil ;-)
Flags: needinfo?(mats)
https://hg.mozilla.org/mozilla-central/rev/e9c2a7a3f9ca
https://hg.mozilla.org/mozilla-central/rev/bd4592d84a9e
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla49
Flags: needinfo?(mats) → in-testsuite?
Depends on: 1305282
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: