mirror of
https://github.com/servo/servo.git
synced 2025-07-23 15:23:42 +01:00
This commit refactors shiftKey to shift_key where possible.
This commit is contained in:
parent
77170a14bc
commit
fd0622a741
6 changed files with 10 additions and 10 deletions
|
@ -63,7 +63,7 @@ pub enum ActivationSource {
|
||||||
// https://html.spec.whatwg.org/multipage/#run-synthetic-click-activation-steps
|
// https://html.spec.whatwg.org/multipage/#run-synthetic-click-activation-steps
|
||||||
pub fn synthetic_click_activation(element: &Element,
|
pub fn synthetic_click_activation(element: &Element,
|
||||||
ctrl_key: bool,
|
ctrl_key: bool,
|
||||||
shiftKey: bool,
|
shift_key: bool,
|
||||||
altKey: bool,
|
altKey: bool,
|
||||||
metaKey: bool,
|
metaKey: bool,
|
||||||
source: ActivationSource) {
|
source: ActivationSource) {
|
||||||
|
@ -94,7 +94,7 @@ pub fn synthetic_click_activation(element: &Element,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
ctrl_key,
|
ctrl_key,
|
||||||
shiftKey,
|
shift_key,
|
||||||
altKey,
|
altKey,
|
||||||
metaKey,
|
metaKey,
|
||||||
0,
|
0,
|
||||||
|
|
|
@ -540,7 +540,7 @@ impl Activatable for HTMLAnchorElement {
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO:https://html.spec.whatwg.org/multipage/#the-a-element
|
//TODO:https://html.spec.whatwg.org/multipage/#the-a-element
|
||||||
fn implicit_submission(&self, _ctrl_key: bool, _shiftKey: bool, _altKey: bool, _metaKey: bool) {
|
fn implicit_submission(&self, _ctrl_key: bool, _shift_key: bool, _altKey: bool, _metaKey: bool) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -283,7 +283,7 @@ impl Activatable for HTMLButtonElement {
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/multipage/#implicit-submission
|
// https://html.spec.whatwg.org/multipage/#implicit-submission
|
||||||
#[allow(unsafe_code)]
|
#[allow(unsafe_code)]
|
||||||
fn implicit_submission(&self, ctrl_key: bool, shiftKey: bool, altKey: bool, metaKey: bool) {
|
fn implicit_submission(&self, ctrl_key: bool, shift_key: bool, altKey: bool, metaKey: bool) {
|
||||||
let doc = document_from_node(self);
|
let doc = document_from_node(self);
|
||||||
let node = doc.upcast::<Node>();
|
let node = doc.upcast::<Node>();
|
||||||
let owner = self.form_owner();
|
let owner = self.form_owner();
|
||||||
|
@ -295,7 +295,7 @@ impl Activatable for HTMLButtonElement {
|
||||||
.find(|r| r.form_owner() == owner)
|
.find(|r| r.form_owner() == owner)
|
||||||
.map(|s| synthetic_click_activation(s.r().as_element(),
|
.map(|s| synthetic_click_activation(s.r().as_element(),
|
||||||
ctrl_key,
|
ctrl_key,
|
||||||
shiftKey,
|
shift_key,
|
||||||
altKey,
|
altKey,
|
||||||
metaKey,
|
metaKey,
|
||||||
ActivationSource::NotFromClick));
|
ActivationSource::NotFromClick));
|
||||||
|
|
|
@ -1275,7 +1275,7 @@ impl Activatable for HTMLInputElement {
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/multipage/#implicit-submission
|
// https://html.spec.whatwg.org/multipage/#implicit-submission
|
||||||
#[allow(unsafe_code)]
|
#[allow(unsafe_code)]
|
||||||
fn implicit_submission(&self, ctrl_key: bool, shiftKey: bool, altKey: bool, metaKey: bool) {
|
fn implicit_submission(&self, ctrl_key: bool, shift_key: bool, altKey: bool, metaKey: bool) {
|
||||||
let doc = document_from_node(self);
|
let doc = document_from_node(self);
|
||||||
let node = doc.upcast::<Node>();
|
let node = doc.upcast::<Node>();
|
||||||
let owner = self.form_owner();
|
let owner = self.form_owner();
|
||||||
|
@ -1296,7 +1296,7 @@ impl Activatable for HTMLInputElement {
|
||||||
if button.is_instance_activatable() {
|
if button.is_instance_activatable() {
|
||||||
synthetic_click_activation(button.as_element(),
|
synthetic_click_activation(button.as_element(),
|
||||||
ctrl_key,
|
ctrl_key,
|
||||||
shiftKey,
|
shift_key,
|
||||||
altKey,
|
altKey,
|
||||||
metaKey,
|
metaKey,
|
||||||
ActivationSource::NotFromClick)
|
ActivationSource::NotFromClick)
|
||||||
|
|
|
@ -76,7 +76,7 @@ impl Activatable for HTMLLabelElement {
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/multipage/#implicit-submission
|
// https://html.spec.whatwg.org/multipage/#implicit-submission
|
||||||
fn implicit_submission(&self, _ctrl_key: bool, _shiftKey: bool, _altKey: bool, _metaKey: bool) {
|
fn implicit_submission(&self, _ctrl_key: bool, _shift_key: bool, _altKey: bool, _metaKey: bool) {
|
||||||
//FIXME: Investigate and implement implicit submission for label elements
|
//FIXME: Investigate and implement implicit submission for label elements
|
||||||
// Issue filed at https://github.com/servo/servo/issues/8263
|
// Issue filed at https://github.com/servo/servo/issues/8263
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,7 +64,7 @@ impl TouchEvent {
|
||||||
target_touches: &TouchList,
|
target_touches: &TouchList,
|
||||||
ctrl_key: bool,
|
ctrl_key: bool,
|
||||||
altKey: bool,
|
altKey: bool,
|
||||||
shiftKey: bool,
|
shift_key: bool,
|
||||||
metaKey: bool) -> Root<TouchEvent> {
|
metaKey: bool) -> Root<TouchEvent> {
|
||||||
let ev = TouchEvent::new_uninitialized(window, touches, changed_touches, target_touches);
|
let ev = TouchEvent::new_uninitialized(window, touches, changed_touches, target_touches);
|
||||||
ev.upcast::<UIEvent>().InitUIEvent(type_,
|
ev.upcast::<UIEvent>().InitUIEvent(type_,
|
||||||
|
@ -73,7 +73,7 @@ impl TouchEvent {
|
||||||
view, detail);
|
view, detail);
|
||||||
ev.ctrl_key.set(ctrl_key);
|
ev.ctrl_key.set(ctrl_key);
|
||||||
ev.alt_key.set(altKey);
|
ev.alt_key.set(altKey);
|
||||||
ev.shift_key.set(shiftKey);
|
ev.shift_key.set(shift_key);
|
||||||
ev.meta_key.set(metaKey);
|
ev.meta_key.set(metaKey);
|
||||||
ev
|
ev
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue