New issue
Advanced search Search tips

Issue 697443 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Nov 15
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Task



Sign in to add a comment

Selection.addRange console output can be confusing

Project Member Reported by rbyers@chromium.org, Mar 1 2017

Issue description

https://twitter.com/kdzwinel/status/836932012053303296

Selection.addRange reports a console ERROR: "The given range isn't in the document" and apparently this developer was disappointed they couldn't catch the exception to silence the warning.

Perhaps we should always use 'warning' level for such messages, not 'error'?
 

Comment 1 by kdzwinel@gmail.com, Mar 1 2017

Some more context. I've run into this issue in UI.TextPrompt.moveCaretToEndOfPrompt (https://cs.chromium.org/chromium/src/third_party/WebKit/Source/devtools/front_end/ui/TextPrompt.js?q=TextPrompt.js+package:%5Echromium$&l=618) working on https://codereview.chromium.org/2646283002 . This method tries moving the caret to the end of content, but it may happen that the whole TextPrompt is currently detached from the DOM, causing 'The given range isn't in the document' error. I've tried swallowing the error and that's when I learned that I can't. There are other ways to avoid the problem, so this is not a big deal, but it wasn't obvious to me that what I see in the console isn't an exception raised by Selection.addRange.

Comment 2 by tkent@chromium.org, Mar 2 2017

Status: Available (was: Untriaged)
No-exception is defined by the Selection API specification, and changing the specification for throwing would not be reasonable because no browsers throw at this moment.

What we should do:
 - Error -> Warning
 - Improve the message so that users can know it is shown by Selection.addRange.

Labels: Type-Task
Project Member

Comment 4 by sheriffbot@chromium.org, Nov 14

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Cc: -tkent@chromium.org
Owner: tkent@chromium.org
Status: Started (was: Untriaged)
Project Member

Comment 6 by bugdroid1@chromium.org, Nov 15

Status: Fixed (was: Started)

Sign in to add a comment