New issue
Advanced search Search tips

Issue 896445 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Nov 13
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

DevTools: error thrown when expanding a deleted element in Console

Project Member Reported by l...@chromium.org, Oct 17

Issue description

What steps will reproduce the problem?
(1) Open a page whose DOM has a parent element w/ child
(2) Log the `document` element in Console
(3) Delete the parent element using the Elements Panel
(4) Try to expand the parent element in Console's ElementsTreeOutline

What happens instead?
Error in DevTools on DevTools

Uncaught (in promise) TypeError: Cannot read property 'nodeType' of null
    at Elements.ElementsTreeOutline.findTreeElement (ElementsTreeOutline.js:410)
    at Elements.ElementsTreeOutline._innerUpdateChildren (ElementsTreeOutline.js:1389)
    at Elements.ElementsTreeOutline._updateChildren (ElementsTreeOutline.js:1321)
    at Elements.ElementsTreeOutline._updateModifiedParentNode (ElementsTreeOutline.js:1159)
    at treeElement.node.getChildNodes (ElementsTreeOutline.js:1171)
    at _agent.invoke_requestChildNodes.then.response (DOMModel.js:497)

 
Project Member

Comment 1 by bugdroid1@chromium.org, Nov 13

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/3cef24e0462f8521e4e5341196b0beba9d505cf7

commit 3cef24e0462f8521e4e5341196b0beba9d505cf7
Author: Erik Luo <luoe@chromium.org>
Date: Tue Nov 13 01:42:56 2018

DevTools: fix internal error on updating unwired element tree

The main ElementsTreeOutline in ElementsPanel is wired to DOMModel
updates, but ETOutlines in Console / elsewhere are not.

In the unwired case, nodes in the tree may have null `children()`.
This can result in internal errors.

Bug:  896445 
Change-Id: Ie903fdddb76b31a5460ce2dd4b753be7ba7eeb56
Reviewed-on: https://chromium-review.googlesource.com/c/1286860
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Erik Luo <luoe@chromium.org>
Cr-Commit-Position: refs/heads/master@{#607419}
[add] https://crrev.com/3cef24e0462f8521e4e5341196b0beba9d505cf7/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-expand-removed-node-expected.txt
[add] https://crrev.com/3cef24e0462f8521e4e5341196b0beba9d505cf7/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-expand-removed-node.js
[modify] https://crrev.com/3cef24e0462f8521e4e5341196b0beba9d505cf7/third_party/blink/renderer/devtools/front_end/elements/ElementsTreeOutline.js

Status: Fixed (was: Assigned)

Sign in to add a comment