-
Notifications
You must be signed in to change notification settings - Fork 0
/
actions.txt
107 lines (92 loc) · 3.1 KB
/
actions.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
x = control the action should be executed on
h(x) = htmlelement backing the control x
y = another control
h(y) = htmlelement backing the control y
MouseOver x:
if the mouse is over h(x), we move the mouse out of h(x) including a mouse move on h(x).
if the mouse is over h(y), we move the mouse out of h(y) including a mouse move on h(y).
we move the mouse on the document.
we move the mouse over h(x) including a mouse move on h(x).
TODO this flow assumes that executing MouseOver twice for the same control moves the mouse
out of the control and back over again. i think this is the expected way e.g. to
display a tooltip again.
x.MouseOver {
if (mouse is over h(x)) {
h(x).mouseOut {
h(x).mouseMove
}
}
if (mouse is over h(y)) {
h(y).mouseOut {
h(y).mouseMove
}
}
document.mouseMove
h(x).mouseOver {
h(x).mouseMove
}
}
ClickOn x:
if the mouse is not over h(x), we move the mouse over h(x) (see MouseOver x).
we click on h(x).
this includes a focusing of h(x), if the focus is not on h(x).
TODO do we allow clicking on selectables? what happens then? does it depend on the element?
x.ClickOn {
if (mouse is not over h(x)) {
x.MouseOver
}
h(x).click {
h(x).focus
}
}
Select x:
if the mouse is not over h(x), we move the mouse over h(x) (see MouseOver x).
we click on h(x).
this includes a focusing of h(x), if the focus is not on h(x).
TODO only click on h(x) if it is not already selected? this is ok for checkboxes (as they are deselected by this)
but for radiobuttons and selects/options it is valid to select them twice (as they are not deselected by this).
this just triggers all javascript events but leaves the element selected.
x.Select {
if (mouse is not over h(x)) {
x.MouseOver
}
h(x).click {
h(x).focus
}
}
Deselect x:
if the mouse is not over h(x), we move the mouse over h(x) (see MouseOver x).
if h(x) is selected we click on h(x).
this includes a focusing of h(x), if the focus is not on h(x).
TODO only click on h(x) if it is not already deselected? this is ok for checkboxes (as they are selected by this)
but for selects/options it is a bit more difficult. it is only possible to deselect options of multiple selects.
but if you deselect an option twice for them, it is selected again. So it is the same as for checkboxes here
and we should just click on h(x) if it is not already deselected for all deselectables. what about a warning
in the log and the result here?
x.Deselect {
if (mouse is not over h(x)) {
x.MouseOver
}
if (h(x) is selected) {
h(x).click {
h(x).focus
}
}
}
Set x:
if the focus is not on h(x), we click on h(x) (see ClickOn x).
if the mouse is not over h(x), we move the mouse over h(x) (see MouseOver x).
we select the text in h(x).
we type the text in h(x).
TODO the current implementation selects the current text before typing. this is not correct but i think is the
expected behavior as the action should not append but replace.
x.Set {
if (focus is not on h(x)) {
x.Click
}
if (mouse is not over h(x)) {
x.MouseOver
}
h(x).select
h(x).type
}