New issue
Advanced search Search tips

Issue 893557 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Oct 11
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 2
Type: Bug



Sign in to add a comment

Incorrect anchorNode when clicking on selected text

Reported by mjsta...@gmail.com, Oct 9

Issue description

UserAgent: 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.
 
Observed since at least Chrome 24, also in Canary.
Components: Blink>Editing>Selection
Labels: Needs-Triage-M69
Cc: swarnasree.mukkala@chromium.org
Labels: Triaged-ET Target-71 M-71 FoundIn-71 FoundIn-70 FoundIn-69 OS-Linux OS-Mac
Status: Untriaged (was: Unconfirmed)
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.!
Status: WontFix (was: Untriaged)
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