| Index: third_party/WebKit/LayoutTests/editing/selection/script-tests/user-select-js-property.html
|
| diff --git a/third_party/WebKit/LayoutTests/editing/selection/script-tests/user-select-js-property.html b/third_party/WebKit/LayoutTests/editing/selection/script-tests/user-select-js-property.html
|
| index 1fb71995847a318384d60c63b581cc56fd7c2bd4..8ddcf68b2a15f065e40b4e5e77fe05ad46b1357d 100644
|
| --- a/third_party/WebKit/LayoutTests/editing/selection/script-tests/user-select-js-property.html
|
| +++ b/third_party/WebKit/LayoutTests/editing/selection/script-tests/user-select-js-property.html
|
| @@ -1,10 +1,20 @@
|
| <!DOCTYPE html>
|
| <script src="../../../resources/testharness.js"></script>
|
| <script src="../../../resources/testharnessreport.js"></script>
|
| +<style>
|
| + #foo {
|
| + user-select: none;
|
| + }
|
| + #bar {
|
| + -webkit-user-select: none;
|
| + }
|
| +</style>
|
| <div id="container">
|
| -<p id="description">Test setting CSSStyleDeclaration.webkitUserStyle</p>
|
| +<p id="description">Test setting CSSStyleDeclaration.webkitUserStyle and userStyle</p>
|
| <div id="sample1" contenteditable="true">editable</div>
|
| <div id="sample2" contenteditable="false">uneditable</div>
|
| +<div class="none" style="user-select:none"></div>
|
| +<div class="none" style="-webkit-user-select:none"></div>
|
| </div>
|
| <div id="log"></div>
|
| <script>
|
| @@ -19,13 +29,38 @@ function setSelection(node)
|
|
|
| test(function(){
|
| // user-select:none in editable element
|
| - sample1.style.webkitUserSelect = 'none';
|
| + sample1.style.webkitUserSelect = "none";
|
| setSelection(sample1);
|
| - assert_equals(selection.type, 'Range');
|
| + assert_equals(selection.type, "Range");
|
|
|
| // user-select:none in uneditable element
|
| - sample2.style.webkitUserSelect = 'none';
|
| + sample2.style.webkitUserSelect = "none";
|
| setSelection(sample2);
|
| - assert_equals(selection.type, 'None');
|
| + assert_equals(selection.type, "None");
|
| });
|
| +
|
| +var style = document.createElement("baz").style;
|
| +test(function () {
|
| + assert_true("userSelect" in style);
|
| +}, "'userSelect' in style");
|
| +test(function () {
|
| + assert_true("webkitUserSelect" in style);
|
| +}, "'webkitUserSelect' in style");
|
| +
|
| +Array.prototype.forEach.call(document.styleSheets[0].cssRules, function (cssRule) {
|
| + testUserSelect(cssRule.style, cssRule.cssText);
|
| +});
|
| +
|
| +Array.prototype.forEach.call(document.querySelectorAll(".none"), function (element) {
|
| + testUserSelect(getComputedStyle(element), element.getAttribute("style"));
|
| +});
|
| +
|
| +function testUserSelect(style, title) {
|
| + test(function () {
|
| + assert_equals(style.userSelect, "none");
|
| + }, "userSelect of '" + title + "' should be 'none'");
|
| + test(function () {
|
| + assert_equals(style.webkitUserSelect, "none");
|
| + }, "webkitUserSelect of '" + title + "' should be 'none'");
|
| +}
|
| </script>
|
|
|