Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f7c596a
commit cc3ed96
Showing
9 changed files
with
122 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
use dom::bindings::codegen::Bindings::KeyboardEventBinding; | ||
use dom::bindings::codegen::Bindings::KeyboardEventBinding::KeyboardEventMethods; | ||
use dom::bindings::codegen::InheritTypes::KeyboardEventDerived; | ||
use dom::bindings::error::Fallible; | ||
use dom::bindings::global::GlobalRef; | ||
use dom::bindings::js::{JSRef, Temporary}; | ||
use dom::bindings::utils::{Reflectable, Reflector/*, reflect_dom_object*/}; | ||
use dom::event::{Event, KeyboardEventTypeId}; | ||
use dom::uievent::UIEvent; | ||
use servo_util::str::DOMString; | ||
|
||
#[jstraceable] | ||
#[must_root] | ||
pub struct KeyboardEvent { | ||
uievent: UIEvent, | ||
} | ||
|
||
impl KeyboardEventDerived for Event { | ||
fn is_keyboardevent(&self) -> bool { | ||
*self.type_id() == KeyboardEventTypeId | ||
} | ||
} | ||
|
||
impl KeyboardEvent { | ||
pub fn Constructor(_global: &GlobalRef, | ||
_type_: DOMString, | ||
_init: &KeyboardEventBinding::KeyboardEventInit) -> Fallible<Temporary<KeyboardEvent>> { | ||
fail!() | ||
} | ||
} | ||
|
||
impl<'a> KeyboardEventMethods for JSRef<'a, KeyboardEvent> { | ||
} | ||
|
||
impl Reflectable for KeyboardEvent { | ||
fn reflector<'a>(&'a self) -> &'a Reflector { | ||
self.uievent.reflector() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at http://mozilla.org/MPL/2.0/. | ||
* | ||
* The origin of this IDL file is | ||
* https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/DOM3-Events.html#interface-KeyboardEvent | ||
* | ||
*/ | ||
|
||
[Constructor(DOMString typeArg, optional KeyboardEventInit keyboardEventInitDict)] | ||
interface KeyboardEvent : UIEvent { | ||
// KeyLocationCode | ||
const unsigned long DOM_KEY_LOCATION_STANDARD = 0x00; | ||
const unsigned long DOM_KEY_LOCATION_LEFT = 0x01; | ||
const unsigned long DOM_KEY_LOCATION_RIGHT = 0x02; | ||
const unsigned long DOM_KEY_LOCATION_NUMPAD = 0x03; | ||
//readonly attribute DOMString key; | ||
//readonly attribute DOMString code; | ||
//readonly attribute unsigned long location; | ||
//readonly attribute boolean ctrlKey; | ||
//readonly attribute boolean shiftKey; | ||
//readonly attribute boolean altKey; | ||
//readonly attribute boolean metaKey; | ||
//readonly attribute boolean repeat; | ||
//readonly attribute boolean isComposing; | ||
//boolean getModifierState (DOMString keyArg); | ||
}; | ||
|
||
dictionary KeyboardEventInit : SharedKeyboardAndMouseEventInit { | ||
DOMString key = ""; | ||
DOMString code = ""; | ||
unsigned long location = 0; | ||
boolean repeat = false; | ||
boolean isComposing = false; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
components/script/dom/webidls/SharedMouseAndKeyboardEventInit.webidl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
// https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/DOM3-Events.html#idl-def-SharedKeyboardAndMouseEventInit | ||
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 file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters