user-select-001.html (1526B)
1 <!DOCTYPE html> 2 <html> 3 <meta charset="utf-8"> 4 <title>CSS Basic User Interface Test: Block children of a inline parent with "user-select:text" should be selectable even with a user-select: none ancestor</title> 5 <link rel="author" title="Ting-Yu Lin" href="mailto:tlin@mozilla.com"> 6 <link rel="author" title="Mozilla" href="https://www.mozilla.org/"> 7 <link rel="help" href="https://drafts.csswg.org/css-ui/#propdef-user-select"> 8 <link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1743074"> 9 10 <script src="/resources/testharness.js"></script> 11 <script src="/resources/testharnessreport.js"></script> 12 <script src="/resources/testdriver.js"></script> 13 <script src="/resources/testdriver-actions.js"></script> 14 <script src='/resources/testdriver-vendor.js'></script> 15 16 <style> 17 :root { 18 user-select: none; 19 } 20 </style> 21 22 <span style="user-select: text"> 23 <div>Let's select this <b id="target">word</b></div> 24 </span> 25 26 <script> 27 promise_test(async function() { 28 let target = document.getElementById("target"); 29 let actions = new test_driver.Actions(); 30 31 // Simulate a double click to select a word. 32 await actions.pointerMove(5, 5, {origin: target}) 33 .pointerDown() 34 .pointerUp() 35 .pointerDown() 36 .pointerUp() 37 .send(); 38 assert_equals(window.getSelection().toString(), "word", 39 "The text 'word' should be selectable.") 40 }, "Select the text 'word'"); 41 </script> 42 </html>