On 6/20/2017 5:28 AM, Brian Grinstead wrote:
I was wondering what would need to be done in order to use the accesskey 
attribute on HTML elements in the browser chrome. Here are some of the 
differences between the attribute in HTML and XUL that I've found so far:

1) In XUL 
(https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/accesskey) 
the shortcut is `Control + key` on Windows and `Command + key` on Mac.

Wow, the document is wrong. Ctrl+foo or Cmd+foo are usually called as "shortcut key" which are different from "access key".

On Windows, chrome's access key works with Alt.

In HTML 
(https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/accesskey) 
the shortcut is `Alt + Shift + key` on Windows and `Control + Alt + key` on Mac.

Yes, this is right.

Would we want to change the HTML shortcut (in browser chrome) to match XUL 
behavior?

So, I'm not sure if you are talking about access key or shortcut key here. But I guess, you're talking about access key.

Then, it depends on the type of DocShell (chrome vs. content). So, not related to the file type. E.g., we have this bug: https://bugzil.la/349943

2) The FAQ & Policies page 
(https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/XUL_Accesskey_FAQ_and_Policies)
 conflicts the with previous point when it says that accesskey is only available on 
Mac in HTML. If this is correct, would we want to disable accesskey functionality 
on Mac for HTML (in browser chrome) to maintain the current behavior, or would it 
working be a benefit of using HTML?

On macOS, native UI doesn't have access key. Therefore, we don't support it only on macOS.

3) The formatting / underlining is controlled by the label-control xbl binding 
at 
http://searchfox.org/mozilla-central/source/toolkit/content/widgets/text.xml#66.
 Presumably this is something that would need to be reimplemented for HTML 
elements in order to use them in the browser chrome.

Yes. Underlining access key's character needs additional hack. I have no idea how to implement it easily in HTML. Perhaps, capsuling with Shadow DOM?

--
Masayuki Nakano <masay...@d-toybox.com>
Software Engineer, Mozilla
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to