Incorrect anchorNode when clicking on selected text
Reported by
mjsta...@gmail.com,
Oct 9
|
|||||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36 Steps to reproduce the problem: 1. Create div or similar with text 2. Add a "selectionchange" listener on the document that logs the current selection's anchorNode 3. Select a word inside the div with the mouse 4. Click on the selected word What is the expected behavior? The selectionchange listener should log the anchorNode What went wrong? It logs `null` instead. Did this work before? N/A Does this work in other browsers? N/A Chrome version: 69.0.3497.100 Channel: stable OS Version: 10.0 Flash Version: See https://accidental-unicorn.glitch.me/ Select a word, and then click on it and observe the console output. This works as expected in Firefox and Edge. It also works if you click on the non-selected part of the text.
,
Oct 9
,
Oct 9
,
Oct 10
Able to reproduce the issue on chrome version #60.0.3072.0, reported chrome version #69.0.3497.100 and latest canary 71.0.3575.0 on windows 10, Mac10.13.6 and Ubuntu 17.10 by following steps as per comment#0. This is non-regression issue and the behavior is seen from old M-60 builds, hence marking is as untriaged and requesting someone from the dev team to kindly look into the issue. Thanks.!
,
Oct 11
Mark WontFix since this is intentional behavior.
bool SelectionController::HandleMouseReleaseEvent(
const MouseEventWithHitTestResults& event,
const LayoutPoint& drag_start_pos) {
TRACE_EVENT0("blink", "SelectionController::handleMouseReleaseEvent");
if (!Selection().IsAvailable())
return false;
bool handled = false;
mouse_down_may_start_select_ = false;
// Clear the selection if the mouse didn't move after the last mouse
// press and it's not a context menu click. We do this so when clicking
// on the selection, the selection goes away. However, if we are
// editing, place the caret.
|
|||||
►
Sign in to add a comment |
|||||
Comment 1 by woxxom@gmail.com
, Oct 9