Selecting text doesn't work when toggling popover or switching display
Categories
(Core :: DOM: Selection, defect)
Tracking
()
People
(Reporter: mbeier, Unassigned)
References
(Blocks 1 open bug, Regression)
Details
(Keywords: regression)
Attachments
(2 files)
See the attached html as an example. When selecting text while showPopover is called or display is changed, nothing is selected. The example works fine in Chrome and Safari.
Updated•1 month ago
|
| Reporter | ||
Updated•1 month ago
|
Comment 1•1 month ago
|
||
Set release status flags based on info from the regressing bug 1930931
:sefeng211, since you are the author of the regressor, bug 1930931, could you take a look?
For more information, please visit BugBot documentation.
Comment 2•1 month ago
|
||
Bug 2007147 was reviewed by Masayuki and Sean is not working at MoCo anymore, so ni?ing him as well. The good thing is that bug 1930931 wasn't terribly big so maybe it's not too bad to fix :)
Comment 3•1 month ago
|
||
Although I've not checked it with the debugger. Looks like that changing display of the parent of <input> causes reframing the <input> and the anonymous nodes are recreated. I guess that the problem of the testcase is caused by the recreation occurs during the drag which changes the selection range and the text control state fails to cache the expected selection range.
I wonder if this could be fixed by reuse the anonymous subtrees after the reframe. I think TextEditor can own that instead of the frame. However, I don't know whether it's okay for the native anonymous node management. Emilio, do you know about that?
(I guess we cannot fix this with a small patch.)
Updated•1 month ago
|
Updated•1 month ago
|
Comment 4•1 month ago
|
||
I think we should try to move the editor shadow tree into the DOM. Which is not the same as NAC but should be similar-ish. I recently did that for <select> in https://phabricator.services.mozilla.com/D280041. Would that work? We need that for field-sizing: content I think anyways.
Comment 6•1 month ago
|
||
So I dug into this, and bug 2016280 is worth it but unrelated.
The key issue here is that the editor has a scrollframe with <div>text,
and BeginTrackingDragGesture ends up using the text node rather than the
element.
But PresShell::HandleEvent ends up using the element via
ComputeElementFromFrame, so nsIFrame::HandleEvent keeps bailing out
because we're tracking the text node in the gesture.
This fixes it but not sure it's the right fix.
Comment 7•1 month ago
|
||
See above. I don't think it has anything to do with selection ranges. We are just checking against the wrong tracked content.
Masayuki can you check the commit message above and see if it's the right fix, or propose one?
Comment 8•1 month ago
|
||
Thank you for debugging! I believe that the direction of the patch must be right. However, it's a low level API so that some callers may be designed for the current behavior. So, before landing it, we need to check each user (not only the direct callers, sigh).
Comment 9•1 month ago
|
||
Could you take a look at that? You know the constraints better than me for sure...
Comment 11•26 days ago
|
||
Emilio, are you planning to work on this? Would you mind assigning it and set a severity?
Comment 12•26 days ago
|
||
I was hoping Masayuki could take a look as described in comment 8+...
FWIW, here's an ongoing try run: https://treeherder.mozilla.org/jobs?repo=try&revision=6fa05c6ff615625b9b231ca4a1204f42061caaa2
Severity is probably S3, but it'd be good to remove the hack bug 2007147 introduced.
Updated•2 days ago
|
Description
•