I'm able to disable START of selection on page using user-select
CSS as is described in answers on this question. And enable it on particular elements as is described here.
But I don't know how is possible to force Webkit WebView to do not allow selection of "not selectable" element, when selection starts on one, which is set as selectable. Here is code example where WebKit makes possible to select text, which should not be selectable:
<html><head>
<style type="text/css">
body {
-webkit-user-select: none;
user-select: none;
} .selectable {
-webkit-user-select: text;
user-select: text;
}</style>
</head>
<body>
<p class="selectable">You should be able to select this text.</p>
<p>Hey, you can't select this text!</p>
<p class="selectable">You should be able to select this text.</p>
<textarea rows="5"></textarea>
</body></html>
Here is it live. Running in iOS 8 Safari this happens:
You can see it – not only whole text is selected, but it is also copied. This behavior is same on Android Chrome 58 and desktop Chrome 63 (difference is only selectable text is highlighted), where everything is copied too. It works differently in Firefox, where as I would expect, both highlighted and copied is only selectable text.
So is possible to make selection bounded by those selectable elements?
Thanks for replies.