If a ::first-letter CSS selector is applied full text selection by drag is impossible
Reported by
r...@weka.io,
Dec 31
|
||||
Issue description
UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36
Steps to reproduce the problem:
1. create a single div <div class="a">this is a text</div>
2. add a CSS .a::first-letter {color: red}
3. try to select the the test by dragging from left to right
What is the expected behavior?
the test should be selected
What went wrong?
the last letter stays unselected
Did this work before? N/A
Chrome version: 71.0.3578.98 Channel: stable
OS Version: OS X 10.13.6
Flash Version:
I created a very simple snippet that demonstrate the issue
https://codepen.io/_zroy/pen/pqdavQ
,
Jan 1
Thanks for filing the issue! Able to reproduce the issue on reported chrome version 71.0.3578.98 using Mac 10.14.1. When checked the same on chrome version 60.0.3112.0 it showed a little different behaviour....i.e., We could select till last letter in M60, but we couldn't select the text from first letter "t". Note: Adding Needs-Bisect as M60's behaviour isn't same as reported M71. Will Triage further based upon reporter's Feedback i.e., Regression/Non-regression. @Reporter: Could you please let us know the behaviour of "t"(first letter) not getting selected is the expected one? & We tried checking other browsers like FF, where we can select the complete text, or is this the expected behaviour?. Any further inputs from inputs from your end helps us to triage this in a better way.
,
Jan 1
the expected behavior should be that the whole text should be selected as one piece.
from the first letter to the last.
let's say you want to capitalize the first letter with CSS you would use
.<class>::first-letter{ text-transform: capitalize; }
you would expect that the whole text would be selectable whereas you didn't add any css at all.
,
Jan 2
I'll take a look.
,
Jan 3
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/a189def6b96b4a827db0365813144ee79f6a4215 commit a189def6b96b4a827db0365813144ee79f6a4215 Author: Xiaocheng Hu <xiaochengh@chromium.org> Date: Thu Jan 03 18:30:36 2019 Handle first-letter at the end of bidi adjustment in legacy layout At the end of bidi adjustment, it maps (box, offset) pair back to a DOM position but doesn't shift the offset for first-letter, causing, e.g., a shifted selection when creating a range selection. This patch fixes that. Bug: 918349 Change-Id: I71dde2dfece3fd110e3e4c3e6580b3144a3195a8 Reviewed-on: https://chromium-review.googlesource.com/c/1394163 Commit-Queue: Emil A Eklund <eae@chromium.org> Reviewed-by: Emil A Eklund <eae@chromium.org> Cr-Commit-Position: refs/heads/master@{#619699} [modify] https://crrev.com/a189def6b96b4a827db0365813144ee79f6a4215/third_party/blink/renderer/core/editing/inline_box_traversal.cc [add] https://crrev.com/a189def6b96b4a827db0365813144ee79f6a4215/third_party/blink/web_tests/editing/selection/first-letter-mouse-select-full-text.html
,
Jan 3
Fixed in M73. This doesn't seem to be a severe issue, so no plan for merging to M72. |
||||
►
Sign in to add a comment |
||||
Comment 1 by swarnasree.mukkala@chromium.org
, Dec 31