1 function getHoverActiveState(e
)
4 "rgb(0, 0, 255)": "default",
5 "rgb(0, 255, 0)": "active",
6 "rgb(255, 0, 0)": "hovered",
7 "rgb(255, 255, 0)": "hoveredAndActive"
10 var color
= window
.getComputedStyle(e
).backgroundColor
;
11 var result
= states
[color
];
13 result
= "unknown: " + color
;
17 function elementCenter(e
)
20 x
: e
.offsetLeft
+ e
.offsetWidth
/ 2,
21 y
: e
.offsetTop
+ e
.offsetHeight
/ 2
25 function shouldBeDefault(e
) { shouldBeEqualToString(e
, "default"); }
26 function shouldBeOnlyActive(e
) { shouldBeEqualToString(e
, "active"); }
27 function shouldBeOnlyHovered(e
) { shouldBeEqualToString(e
, "hovered"); }
28 function shouldBeHoveredAndActive(e
) { shouldBeEqualToString(e
, "hoveredAndActive"); }