Triple click selection breaks at inline-block boundaries
Categories
(Core :: DOM: Selection, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox74 | --- | verified |
People
(Reporter: sidvishnoi, Assigned: emilio)
References
(Regressed 1 open bug)
Details
Attachments
(2 files)
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:73.0) Gecko/20100101 Firefox/73.0
Steps to reproduce:
Input:
<p><code>oops</code> triple click me to select this sentence <code>hey!</code>.</p>
<style>code { display: inline-block; }</style>
- Triple click the "triple click me to select this sentence" part.
Actual results:
- Triple clicking selected/highlighted only "triple click me to select this sentence" part, and skipped "oops" and "hey!".
See for a minimal example: https://codepen.io/sidvishnoi/pen/zYxKRKK
Platform: Linux x64 (Ubuntu)
- Firefox 73 (Nightly), Firefox 71: doesn't select "oops", "hey".
- Chrome 79: selects.
Expected results:
Entire paragraph should have been selected, regardless of code
being inline
or inline-block
Assignee | ||
Comment 1•4 years ago
|
||
I think we should treat inline-blocks with a single line as inlines. Thoughts Mats?
Comment 2•4 years ago
|
||
That seems reasonable. The behavior in Chrome is a bit more subtle actually. Modifying the test to <code>oops<br>last</code>
it seems that Chrome extends the selection to include "last" but not "oops". Likewise, triple-clicking "last" works the same, but triple-clicking "oops" selects just that line inside the inline-block. (Adding vertical-align:top
make no difference, which is a bit more debatable whether it makes sense or not.)
But yeah, including single-line inline-blocks as you suggest seems like a good first step.
Comment 3•4 years ago
|
||
For the record, changing the last inline-block to <code>hey!<br>again</code>
shows that Chrome includes "hey!" but not "again". I.e. the opposite of how it works on the start side. I guess not supporting multi-range selection makes it impossible for them to select "again" without also selecting "hey!".
Comment 4•4 years ago
|
||
Is there any arguments for why we simply shouldn't include the whole inline-block even if it's multiple lines? It's clearly part of the line it's displayed on, so I can't think of a good reason for Chrome's behavior.
If you move the inline-block to the middle of the line, then Chrome stops the selection there. That behavior seems weird to me.
Assignee | ||
Comment 5•4 years ago
|
||
The only weird thing that comes to mind is what line to select when you triple-click in an inline-block with multiple lines... If you only account single-line inline-blocks then the answer seems straight-forward but... I don't feel very strongly either way.
Updated•4 years ago
|
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 7•4 years ago
|
||
Assignee | ||
Comment 8•4 years ago
|
||
Comment 9•4 years ago
|
||
Comment 10•4 years ago
|
||
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/476a32323adb Only treat block-level frames as line-breaks in paragraph selection code. r=mats
Comment 11•4 years ago
|
||
bugherder |
Updated•4 years ago
|
Comment 12•4 years ago
•
|
||
Description
•