Closed Bug 1297342 Opened 8 years ago Closed 8 years ago

"reserved" attribute should be on <key> elements instead of <command> ones

Categories

(Core :: XUL, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla53
Tracking Status
firefox53 --- fixed

People

(Reporter: Gijs, Assigned: enndeakin)

References

Details

Attachments

(1 file)

It's not clear to me why the "reserved" attribute was added on command elements instead of <key> ones. AIUI, because the keys are the things we're actually "blocking" content from seeing / getting, it would make more sense to have the attribute directly on those elements than via 1 level of indirection on the <command> they refer to. The current implementation also means that you need that level of indirection, whereas without it you can just use an oncommand attribute on a <key> element without having to create a <command> element. This hurt us in bug 1296863 when we tried to detach the accel-t binding from the <command> element to make some of the code a bit saner. Masayuki-san, Felipe, do either of you know why this lives on <command> elements instead?
I don't know, I was involved when we got some bug reports about the implementation. I think that available either <command> or <key> is better.
Component: XBL → XUL
Flags: needinfo?(felipc)
I don't recall if there was a solid reasoning or if it was just implementation simplicity. Trying to back-fill a reason, I believe that it's the action that should be reserved (e.g. "it shouldn't be possible to prevent a user from creating a new tab") instead of the key ("it shouldn't be possible to prevent a user from using ctrl + t"). But if changing it will make things better I'm not opposed.
Flags: needinfo?(felipc)
A <key> is always associated with an action, so I fail to see how putting the attribute on the <command> provides any benefit.
Assignee: nobody → enndeakin
Status: NEW → ASSIGNED
Attachment #8825796 - Flags: review?(felipc)
Comment on attachment 8825796 [details] [diff] [review] Move reserved attribute to keys Review of attachment 8825796 [details] [diff] [review]: ----------------------------------------------------------------- The code looks sane to me. But I know that a lot of this reserved handling has changed since the first version to deal with the non-e10s case, so I'm not 100% if this is enough. Did you test both on e10s and non-e10s?
Attachment #8825796 - Flags: review?(felipc) → review+
> Did you test both on e10s and non-e10s? Yes, it works in both.
Pushed by neil@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/c8db5ac137c5 reserved attribute should be on key element not on the command, r=felipe
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla53
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: