4 <script src=
"../../../resources/js-test.js"></script>
7 <span id=
"not-editable" contenteditable
>I'm not editable.
</span>
9 <span id=
"editable" contenteditable
>I'm editable.
</span>
12 function clickOn(element
)
14 if (!window
.eventSender
)
19 for (var parentNode
= element
; parentNode
; parentNode
= parentNode
.offsetParent
) {
20 absoluteLeft
+= parentNode
.offsetLeft
;
21 absoluteTop
+= parentNode
.offsetTop
;
24 var x
= absoluteLeft
+ element
.offsetWidth
/ 2;
25 var y
= absoluteTop
+ element
.offsetHeight
/ 2;
26 eventSender
.mouseMoveTo(x
, y
);
27 eventSender
.mouseDown();
28 eventSender
.mouseUp();
29 eventSender
.mouseMoveTo(0, 0);
34 description('Test that inert nodes cannot be edited. The test passes if the only text you can edit is in the dialog.');
36 dialog
= document
.querySelector('dialog');
38 notEditable
= document
.querySelector('#not-editable');
39 editable
= document
.querySelector('#editable');
41 if (!window
.eventSender
)
44 oldValue
= notEditable
.textContent
;
45 eventSender
.keyDown('a');
46 shouldBe('notEditable.textContent', 'oldValue');
49 oldValue
= editable
.textContent
;
50 eventSender
.keyDown('a');
51 shouldNotBe('editable.textContent', 'oldValue');