Closed
Bug 1723903
Opened 5 years ago
Closed 5 years ago
Shadow dom breaks text selection of content inside it
Categories
(Core :: DOM: Selection, defect)
Tracking
()
RESOLVED
DUPLICATE
of bug 1545367
People
(Reporter: mmis1000, Unassigned)
Details
Attachments
(2 files)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:92.0) Gecko/20100101 Firefox/92.0
Steps to reproduce:
- make a shadowroot to contain elements
- move a span that has line-height shorter that containing container into it
- try to select text and don't end you selection on the top of text (the cursor changed to arrow)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<span id="a">
<span>sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds</span>
</span>
<br><br>
<span id="a">
<span>sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds sds</span>
</span>
<style>body {
line-height: 200%;
}
span {
line-height: 16px;
}
</style>
<script>
const root = document.getElementById('a').attachShadow({mode: 'open'});
[...document.getElementById('a').children].forEach(it => {
root.appendChild(it)
})
</script>
</body>
</html>
Actual results:
The select end up end at top of the text block instead of under cursor if you did not hover text at end
Expected results:
The text should be selected normally
See also: https://news.ycombinator.com/item?id=28055551
The broken site: comment section of https://bugs.chromium.org/p/chromium/issues/detail?id=1065085
Comment 3•5 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::DOM: Selection' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.
Component: Untriaged → DOM: Selection
Product: Firefox → Core
Updated•5 years ago
|
Status: UNCONFIRMED → RESOLVED
Closed: 5 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•