Skip to content

Commit

Permalink
prevent "The given range isn't in document." errors
Browse files Browse the repository at this point in the history
  • Loading branch information
darwin committed Jan 23, 2016
1 parent e83855f commit fd8fb97
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions resources/unpacked/devtools/front_end/ui/UIUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -768,6 +768,11 @@ WebInspector._isTextEditingElement = function(element)
*/
WebInspector.setCurrentFocusElement = function(x)
{
// this is an edge case of restoring focus to already removed element from document
if (!document.body.contains(x)) {
x = null;
}

if (WebInspector._glassPane && x && !WebInspector._glassPane.element.isAncestor(x))
return;
if (WebInspector._currentFocusElement !== x)
Expand Down

0 comments on commit fd8fb97

Please sign in to comment.