mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Fix all the links to the UI Events spec
DOM3Events is no more.
This commit is contained in:
parent
c87aa399ed
commit
be334efe2f
9 changed files with 24 additions and 25 deletions
|
@ -577,7 +577,7 @@ impl Document {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Return the element that currently has focus.
|
/// Return the element that currently has focus.
|
||||||
// https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/DOM3-Events.html#events-focusevent-doc-focus
|
// https://w3c.github.io/uievents/#events-focusevent-doc-focus
|
||||||
pub fn get_focused_element(&self) -> Option<Root<Element>> {
|
pub fn get_focused_element(&self) -> Option<Root<Element>> {
|
||||||
self.focused.get()
|
self.focused.get()
|
||||||
}
|
}
|
||||||
|
@ -706,7 +706,7 @@ impl Document {
|
||||||
self.begin_focus_transaction();
|
self.begin_focus_transaction();
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/DOM3-Events.html#event-type-click
|
// https://w3c.github.io/uievents/#event-type-click
|
||||||
let client_x = client_point.x as i32;
|
let client_x = client_point.x as i32;
|
||||||
let client_y = client_point.y as i32;
|
let client_y = client_point.y as i32;
|
||||||
let clickCount = 1;
|
let clickCount = 1;
|
||||||
|
@ -728,7 +728,7 @@ impl Document {
|
||||||
None);
|
None);
|
||||||
let event = event.upcast::<Event>();
|
let event = event.upcast::<Event>();
|
||||||
|
|
||||||
// https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/DOM3-Events.html#trusted-events
|
// https://w3c.github.io/uievents/#trusted-events
|
||||||
event.set_trusted(true);
|
event.set_trusted(true);
|
||||||
// https://html.spec.whatwg.org/multipage/#run-authentic-click-activation-steps
|
// https://html.spec.whatwg.org/multipage/#run-authentic-click-activation-steps
|
||||||
match mouse_event_type {
|
match mouse_event_type {
|
||||||
|
@ -1093,9 +1093,9 @@ impl Document {
|
||||||
event.fire(target);
|
event.fire(target);
|
||||||
let mut prevented = event.DefaultPrevented();
|
let mut prevented = event.DefaultPrevented();
|
||||||
|
|
||||||
// https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/DOM3-Events.html#keys-cancelable-keys
|
// https://w3c.github.io/uievents/#keys-cancelable-keys
|
||||||
if state != KeyState::Released && props.is_printable() && !prevented {
|
if state != KeyState::Released && props.is_printable() && !prevented {
|
||||||
// https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/DOM3-Events.html#keypress-event-order
|
// https://w3c.github.io/uievents/#keypress-event-order
|
||||||
let event = KeyboardEvent::new(&self.window,
|
let event = KeyboardEvent::new(&self.window,
|
||||||
DOMString::from("keypress"),
|
DOMString::from("keypress"),
|
||||||
true,
|
true,
|
||||||
|
|
|
@ -647,7 +647,7 @@ fn key_location(key: Key) -> u32 {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/DOM3-Events.html#widl-KeyboardEvent-charCode
|
// https://w3c.github.io/uievents/#dom-keyboardevent-charcode
|
||||||
fn key_charcode(key: Key, mods: KeyModifiers) -> Option<u32> {
|
fn key_charcode(key: Key, mods: KeyModifiers) -> Option<u32> {
|
||||||
let key_string = key_value(key, mods);
|
let key_string = key_value(key, mods);
|
||||||
if key_string.len() == 1 {
|
if key_string.len() == 1 {
|
||||||
|
@ -657,10 +657,10 @@ fn key_charcode(key: Key, mods: KeyModifiers) -> Option<u32> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/DOM3-Events.html#legacy-key-models
|
// https://w3c.github.io/uievents/#legacy-key-models
|
||||||
fn key_keycode(key: Key) -> u32 {
|
fn key_keycode(key: Key) -> u32 {
|
||||||
match key {
|
match key {
|
||||||
// https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/DOM3-Events.html#legacy-key-models
|
// https://w3c.github.io/uievents/#legacy-key-models
|
||||||
Key::Backspace => 8,
|
Key::Backspace => 8,
|
||||||
Key::Tab => 9,
|
Key::Tab => 9,
|
||||||
Key::Enter => 13,
|
Key::Enter => 13,
|
||||||
|
@ -680,7 +680,7 @@ fn key_keycode(key: Key) -> u32 {
|
||||||
Key::Down => 40,
|
Key::Down => 40,
|
||||||
Key::Delete => 46,
|
Key::Delete => 46,
|
||||||
|
|
||||||
// https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/DOM3-Events.html#optionally-fixed-virtual-key-codes
|
// https://w3c.github.io/uievents/#optionally-fixed-virtual-key-codes
|
||||||
Key::Semicolon => 186,
|
Key::Semicolon => 186,
|
||||||
Key::Equal => 187,
|
Key::Equal => 187,
|
||||||
Key::Comma => 188,
|
Key::Comma => 188,
|
||||||
|
@ -820,7 +820,7 @@ impl KeyboardEventMethods for KeyboardEvent {
|
||||||
self.is_composing.get()
|
self.is_composing.get()
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/DOM3-Events.html#widl-KeyboardEvent-getModifierState
|
// https://w3c.github.io/uievents/#dom-keyboardevent-getmodifierstate
|
||||||
fn GetModifierState(&self, keyArg: DOMString) -> bool {
|
fn GetModifierState(&self, keyArg: DOMString) -> bool {
|
||||||
match &*keyArg {
|
match &*keyArg {
|
||||||
"Ctrl" => self.CtrlKey(),
|
"Ctrl" => self.CtrlKey(),
|
||||||
|
|
|
@ -18,7 +18,7 @@ use std::cell::Cell;
|
||||||
use std::default::Default;
|
use std::default::Default;
|
||||||
use string_cache::Atom;
|
use string_cache::Atom;
|
||||||
|
|
||||||
// https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/DOM3-Events.html#interface-UIEvent
|
// https://w3c.github.io/uievents/#interface-uievent
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
pub struct UIEvent {
|
pub struct UIEvent {
|
||||||
event: Event,
|
event: Event,
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
/*
|
/*
|
||||||
* The origin of this IDL file is
|
* The origin of this IDL file is
|
||||||
* https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/DOM3-Events.html#interface-KeyboardEvent
|
* https://w3c.github.io/uievents/#interface-keyboardevent
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ interface KeyboardEvent : UIEvent {
|
||||||
boolean getModifierState (DOMString keyArg);
|
boolean getModifierState (DOMString keyArg);
|
||||||
};
|
};
|
||||||
|
|
||||||
// https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/DOM3-Events.html#idl-interface-KeyboardEvent-initializers
|
// https://w3c.github.io/uievents/#idl-interface-KeyboardEvent-initializers
|
||||||
partial interface KeyboardEvent {
|
partial interface KeyboardEvent {
|
||||||
// Originally introduced (and deprecated) in DOM Level 3
|
// Originally introduced (and deprecated) in DOM Level 3
|
||||||
void initKeyboardEvent (DOMString typeArg, boolean bubblesArg, boolean cancelableArg, Window? viewArg,
|
void initKeyboardEvent (DOMString typeArg, boolean bubblesArg, boolean cancelableArg, Window? viewArg,
|
||||||
|
@ -34,7 +34,7 @@ partial interface KeyboardEvent {
|
||||||
boolean repeat, DOMString locale);
|
boolean repeat, DOMString locale);
|
||||||
};
|
};
|
||||||
|
|
||||||
// https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/DOM3-Events.html#KeyboardEvent-supplemental-interface
|
// https://w3c.github.io/uievents/#legacy-interface-KeyboardEvent
|
||||||
partial interface KeyboardEvent {
|
partial interface KeyboardEvent {
|
||||||
// The following support legacy user agents
|
// The following support legacy user agents
|
||||||
readonly attribute unsigned long charCode;
|
readonly attribute unsigned long charCode;
|
||||||
|
@ -42,7 +42,7 @@ partial interface KeyboardEvent {
|
||||||
readonly attribute unsigned long which;
|
readonly attribute unsigned long which;
|
||||||
};
|
};
|
||||||
|
|
||||||
// https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/DOM3-Events.html#interface-KeyboardEvent
|
// https://w3c.github.io/uievents/#dictdef-keyboardeventinit
|
||||||
dictionary KeyboardEventInit : SharedKeyboardAndMouseEventInit {
|
dictionary KeyboardEventInit : SharedKeyboardAndMouseEventInit {
|
||||||
DOMString key = "";
|
DOMString key = "";
|
||||||
DOMString code = "";
|
DOMString code = "";
|
||||||
|
@ -51,7 +51,7 @@ dictionary KeyboardEventInit : SharedKeyboardAndMouseEventInit {
|
||||||
boolean isComposing = false;
|
boolean isComposing = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
// https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/DOM3-Events.html#events-KeyboardEventInit-supplemental
|
// https://w3c.github.io/uievents/#legacy-dictionary-KeyboardEventInit
|
||||||
/*partial dictionary KeyboardEventInit {
|
/*partial dictionary KeyboardEventInit {
|
||||||
unsigned long charCode = 0;
|
unsigned long charCode = 0;
|
||||||
unsigned long keyCode = 0;
|
unsigned long keyCode = 0;
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* 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-MouseEvent
|
// https://w3c.github.io/uievents/#interface-mouseevent
|
||||||
[Constructor(DOMString typeArg, optional MouseEventInit mouseEventInitDict)]
|
[Constructor(DOMString typeArg, optional MouseEventInit mouseEventInitDict)]
|
||||||
interface MouseEvent : UIEvent {
|
interface MouseEvent : UIEvent {
|
||||||
readonly attribute long screenX;
|
readonly attribute long screenX;
|
||||||
|
@ -23,7 +23,7 @@ interface MouseEvent : UIEvent {
|
||||||
readonly attribute long which;
|
readonly attribute long which;
|
||||||
};
|
};
|
||||||
|
|
||||||
// https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/DOM3-Events.html#idl-def-MouseEventInit
|
// https://w3c.github.io/uievents/#dictdef-eventmodifierinit
|
||||||
dictionary MouseEventInit : SharedKeyboardAndMouseEventInit {
|
dictionary MouseEventInit : SharedKeyboardAndMouseEventInit {
|
||||||
long screenX = 0;
|
long screenX = 0;
|
||||||
long screenY = 0;
|
long screenY = 0;
|
||||||
|
@ -34,7 +34,7 @@ dictionary MouseEventInit : SharedKeyboardAndMouseEventInit {
|
||||||
EventTarget? relatedTarget = null;
|
EventTarget? relatedTarget = null;
|
||||||
};
|
};
|
||||||
|
|
||||||
// https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/DOM3-Events.html#idl-def-MouseEvent-1
|
// https://w3c.github.io/uievents/#idl-interface-MouseEvent-initializers
|
||||||
partial interface MouseEvent {
|
partial interface MouseEvent {
|
||||||
// Deprecated in DOM Level 3
|
// Deprecated in DOM Level 3
|
||||||
void initMouseEvent (DOMString typeArg, boolean bubblesArg, boolean cancelableArg,
|
void initMouseEvent (DOMString typeArg, boolean bubblesArg, boolean cancelableArg,
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* 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
|
// https://w3c.github.io/uievents/#dictdef-eventmodifierinit
|
||||||
dictionary SharedKeyboardAndMouseEventInit : UIEventInit {
|
dictionary SharedKeyboardAndMouseEventInit : UIEventInit {
|
||||||
boolean ctrlKey = false;
|
boolean ctrlKey = false;
|
||||||
boolean shiftKey = false;
|
boolean shiftKey = false;
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* 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-UIEvent
|
// https://w3c.github.io/uievents/#interface-uievent
|
||||||
[Constructor(DOMString type, optional UIEventInit eventInitDict)]
|
[Constructor(DOMString type, optional UIEventInit eventInitDict)]
|
||||||
interface UIEvent : Event {
|
interface UIEvent : Event {
|
||||||
// readonly attribute WindowProxy? view;
|
// readonly attribute WindowProxy? view;
|
||||||
|
@ -10,14 +10,14 @@ interface UIEvent : Event {
|
||||||
readonly attribute long detail;
|
readonly attribute long detail;
|
||||||
};
|
};
|
||||||
|
|
||||||
// https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/DOM3-Events.html#idl-def-UIEventInit
|
// https://w3c.github.io/uievents/#dictdef-uieventinit-uieventinit
|
||||||
dictionary UIEventInit : EventInit {
|
dictionary UIEventInit : EventInit {
|
||||||
// WindowProxy? view = null;
|
// WindowProxy? view = null;
|
||||||
Window? view = null;
|
Window? view = null;
|
||||||
long detail = 0;
|
long detail = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
// https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/DOM3-Events.html#idl-def-UIEvent-1
|
// https://w3c.github.io/uievents/#idl-interface-UIEvent-initializers
|
||||||
partial interface UIEvent {
|
partial interface UIEvent {
|
||||||
// Deprecated in DOM Level 3
|
// Deprecated in DOM Level 3
|
||||||
void initUIEvent (DOMString typeArg, boolean bubblesArg, boolean cancelableArg, Window? viewArg, long detailArg);
|
void initUIEvent (DOMString typeArg, boolean bubblesArg, boolean cancelableArg, Window? viewArg, long detailArg);
|
||||||
|
|
|
@ -1920,7 +1920,6 @@ impl ScriptThread {
|
||||||
}
|
}
|
||||||
|
|
||||||
// http://dev.w3.org/csswg/cssom-view/#resizing-viewports
|
// http://dev.w3.org/csswg/cssom-view/#resizing-viewports
|
||||||
// https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/DOM3-Events.html#event-type-resize
|
|
||||||
if size_type == WindowSizeType::Resize {
|
if size_type == WindowSizeType::Resize {
|
||||||
let uievent = UIEvent::new(window.r(),
|
let uievent = UIEvent::new(window.r(),
|
||||||
DOMString::from("resize"), EventBubbles::DoesNotBubble,
|
DOMString::from("resize"), EventBubbles::DoesNotBubble,
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<body>
|
<body>
|
||||||
<script>
|
<script>
|
||||||
window.addEventListener("resize", function (aEvent) {
|
window.addEventListener("resize", function (aEvent) {
|
||||||
// https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/DOM3-Events.html#event-type-resize
|
// http://dev.w3.org/csswg/cssom-view/#resizing-viewports
|
||||||
is_a(aEvent, UIEvent, "event should be UIEvent.");
|
is_a(aEvent, UIEvent, "event should be UIEvent.");
|
||||||
is(aEvent.bubbles, false, "Bubbles should be No.");
|
is(aEvent.bubbles, false, "Bubbles should be No.");
|
||||||
is(aEvent.cancelable, false, "Cancelable should be No.");
|
is(aEvent.cancelable, false, "Cancelable should be No.");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue