Support D3E EventModifierInit

RESOLVED FIXED in Firefox 40

Status

()

Core
DOM: Events
RESOLVED FIXED
3 years ago
7 months ago

People

(Reporter: masayuki, Assigned: masayuki)

Tracking

({dev-doc-needed})

Trunk
mozilla40
dev-doc-needed
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox40 fixed)

Details

Attachments

(1 attachment, 1 obsolete attachment)

dictionary SharedKeyboardAndMouseEventInit : UIEventInit {
    boolean ctrlKey = false;
    boolean shiftKey = false;
    boolean altKey = false;
    boolean metaKey = false;
    boolean keyModifierStateAltGraph = false;
    boolean keyModifierStateCapsLock = false;
    boolean keyModifierStateFn = false;
    boolean keyModifierStateFnLock = false;
    boolean keyModifierStateHyper = false;
    boolean keyModifierStateNumLock = false;
    boolean keyModifierStateOS = false;
    boolean keyModifierStateScrollLock = false;
    boolean keyModifierStateSuper = false;
    boolean keyModifierStateSymbol = false;
    boolean keyModifierStateSymbolLock = false;
};

This is necessary for supporting to initialize all modifier states at creating a KeyboardEvent or MouseEvent.

Comment 1

3 years ago
and MouseEventInit and KeyboardEventInit extends this one?

Please call the dictionary something else.
Like EventModifierInit : UIEventInit
(In reply to Olli Pettay [:smaug] from comment #1)
> and MouseEventInit and KeyboardEventInit extends this one?

Yes, D3E spec defines so.

> Please call the dictionary something else.
> Like EventModifierInit : UIEventInit

Okay, thank you.
Created attachment 8554108 [details] [diff] [review]
Patch
Attachment #8554108 - Flags: review?(bugs)

Comment 4

3 years ago
Comment on attachment 8554108 [details] [diff] [review]
Patch


>+// Called as SharedKeyboardAndMouseEventInit in D3E spec.
Please get the dictionary fixed there too.
What if some other event type wants to use the dictionary? Then it won't 
be only for KeyboardEvent or MouseEvent


>+// NOTE: Gecko doesn't support commented out modifiers yet.
>+dictionary EventModifierInit : UIEventInit
>+{
>+  boolean ctrlKey = false;
>+  boolean shiftKey = false;
>+  boolean altKey = false;
>+  boolean metaKey = false;
>+  boolean keyModifierStateAltGraph = false;
>+  boolean keyModifierStateCapsLock = false;
>+  boolean keyModifierStateFn = false;
>+  // boolean keyModifierStateFnLock = false;
>+  // boolean keyModifierStateHyper = false;
>+  boolean keyModifierStateNumLock = false;
>+  boolean keyModifierStateOS = false;
>+  boolean keyModifierStateScrollLock = false;
>+  // boolean keyModifierStateSuper = false;
>+  // boolean keyModifierStateSymbol = false;
>+  boolean keyModifierStateSymbolLock = false;
>+};

Why the new names are so super long.
This feels a bit developer hostile.

Sorry that I didn't realize this earlier.
Attachment #8554108 - Flags: review?(bugs) → review-
Hmm, so, do you think that these issues should be fixed in the spec side?
Flags: needinfo?(bugs)

Comment 6

3 years ago
yes. I think we should figure out better API and get that spec'ed and implement that.

It is not clear to me why the properties in the dictionary need to be so long and repetitive.
Flags: needinfo?(bugs)
Filed:
https://www.w3.org/Bugs/Public/show_bug.cgi?id=27902
https://www.w3.org/Bugs/Public/show_bug.cgi?id=27903
renamed:

dictionary EventModifierInit : UIEventInit {
    boolean ctrlKey = false;
    boolean shiftKey = false;
    boolean altKey = false;
    boolean metaKey = false;
    boolean modifierAltGraph = false;
    boolean modifierCapsLock = false;
    boolean modifierFn = false;
    boolean modifierFnLock = false;
    boolean modifierHyper = false;
    boolean modifierNumLock = false;
    boolean modifierOS = false;
    boolean modifierScrollLock = false;
    boolean modifierSuper = false;
    boolean modifierSymbol = false;
    boolean modifierSymbolLock = false;
};

https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/DOM3-Events.html#idl-def-EventModifierInit
Summary: Support D3E SharedKeyboardAndMouseEventInit → Support D3E EventModifierInit
Created attachment 8589645 [details] [diff] [review]
Patch
Attachment #8554108 - Attachment is obsolete: true
Attachment #8589645 - Flags: review?(bugs)

Updated

3 years ago
Attachment #8589645 - Flags: review?(bugs) → review+
Keywords: dev-doc-needed
https://hg.mozilla.org/integration/mozilla-inbound/rev/1443401a43fb

teoli:

Looks like there are no entry for Event*Init dictionary in MDN. For example, https://developer.mozilla.org/en/docs/Web/API/Event/Event documents it as just an argument of Event constructor. However, the series of Event*Init has independent hierarchy. E.g.,

interface: Event -> UIEvent -> MouseEvent
dictionary: EventInit -> UIEventInit -> EventModifierInit -> MouseEventInit

So, I think that MDN should have /docs/Web/API/Event/(Init|Dictionary)/ or something.
Flags: needinfo?(jypenator)
https://hg.mozilla.org/mozilla-central/rev/1443401a43fb
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
status-firefox40: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla40
Flags: needinfo?(jypenator)
You need to log in before you can comment on or make changes to this bug.