1 <script src=
"../../resources/js-test.js"></script>
3 <p id=
"description"></p>
4 <div id=
"sample1" contenteditable=
"true">editable
</div>
5 <div id=
"sample2" contenteditable=
"false">uneditable
</div>
9 function $(id
) { return document
.getElementById(id
); }
10 description('Test setting CSSStyleDeclaration.webkitUserStyle');
12 var selection
= window
.getSelection();
13 function setSelection(node
)
15 var range
= document
.createRange();
16 range
.selectNodeContents(node
);
18 selection
.addRange(range
);
21 // user-select:none in editable element
22 $('sample1').style
.webkitUserSelect
= 'none';
23 setSelection($('sample1'));
24 shouldBeEqualToString('selection.type', 'Range');
26 // user-select:none in uneditable element
27 $('sample2').style
.webkitUserSelect
= 'none';
28 setSelection($('sample2'));
29 shouldBeEqualToString('selection.type', 'None');
31 if (window
.testRunner
)
32 $('container').outerHTML
= '';