4 <title>Document::nodesFromRect : inline image - bug
85849</title>
5 <script src=
"../../../resources/js-test.js"></script>
6 <script src=
"resources/nodesFromRect.js"></script>
15 #sandbox #container { padding:
2px; padding-bottom:
10px; }
16 #sandbox #container span { font-size:
36px; }
17 #sandbox img { background-color: black; }
24 <img width=
"100" height=
"100"></img>
29 <p id=
"description"></p>
30 <span id=
"console"></span>
31 <script type=
"application/javascript">
34 description(document.title);
35 window.scrollTo(
0,
0);
36 /* Point based test over the img only. */
37 checkRect(
20,
20,
1,
1,
"IMG");
38 /* Rect based test over the img only. */
39 checkRect(
15,
15,
10,
10,
"IMG");
40 /* Rect based test over the div only. */
41 checkRect(
0,
0,
2,
2,
"DIV#container");
42 /* Rect based test over the span only. */
43 checkRect(
3,
103,
2,
2,
"SPAN");
45 /* Note that for the tests below, the img bounds are considered to be (
2,
2) x (
100,
100). */
46 /* Rect based test over the entire img. */
47 checkRect(
2,
2,
100,
100,
"IMG");
48 /* Point based test over the img and the span. */
49 checkRect(
2,
99,
1,
1,
"IMG");
50 /* Rect based test over the img and the span with the img fully covering the hit region. */
51 checkRect(
2,
98,
2,
2,
"IMG");
52 /* Rect based test over the img and the span with the img not fully covering the hit region. */
53 checkRect(
3,
101,
2,
5,
"IMG, SPAN");
54 /* Rect based test over the img, span and their container. */
55 checkRect(
3,
101,
2,
18,
"IMG, SPAN, DIV#container");
56 /* Rect based test over just span and its container. */
57 checkRect(
3,
103,
2,
16,
"SPAN, DIV#container");
58 /* Rect based test over the img that is not over span with the img not fully covering the hit region. */
59 checkRect(
1,
1,
3,
3,
"IMG, DIV#container");