Bug 148190

Summary: Web Inspector: Uncaught Exceptions regarding PseudoElements / TemplateContent
Product: WebKit Reporter: Joseph Pecoraro <joepeck>
Component: Web InspectorAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: bburg, commit-queue, graouts, joepeck, mattbaker, nvasilyev, timothy, webkit-bug-importer
Priority: P2 Keywords: DoNotImportToRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
[PATCH] Proposed Fix
bburg: review+
[PATCH] For Landing none

Description Joseph Pecoraro 2015-08-19 14:00:03 PDT
* SUMMARY
Uncaught Exceptions regarding PseudoElements / TemplateContent.

* STEPS TO REPRODUCE
1. Inspect twitter.com
2. Navigate around twitter.com
3. Reload
  => uncaught exceptions in inspector

* ERRORS
Resources/Protocol/InspectorBackend.js:281:26: CONSOLE ERROR Uncaught exception in inspector page while handling event DOM.pseudoElementRemoved:  TypeError: null is not an object (evaluating 'this._children.length') _renumber@WebInspectorUI.framework/Resources/Models/DOMNode.js:559:44
Resources/Protocol/InspectorBackend.js:281:26: CONSOLE ERROR Uncaught exception in inspector page while handling event DOM.childNodeRemoved:  TypeError: node.templateContent is not a function. (In 'node.templateContent()', 'node.templateContent' is undefined) _unbind@WebInspectorUI.framework/Resources/Controllers/DOMTreeManager.js:292:33
Comment 1 Joseph Pecoraro 2015-08-19 14:01:29 PDT
Created attachment 259402 [details]
[PATCH] Proposed Fix
Comment 2 BJ Burg 2015-08-19 14:06:41 PDT
Comment on attachment 259402 [details]
[PATCH] Proposed Fix

View in context: https://bugs.webkit.org/attachment.cgi?id=259402&action=review

r=me

> Source/WebInspectorUI/ChangeLog:14
> +        exists, it may be null. So separate the two pathes.

paths*

> Source/WebInspectorUI/UserInterface/Controllers/DOMTreeManager.js:289
> +        for (let i = 0; node.children && i < node.children.length; ++i)

This could be for (let .. of ..), since it doesn't mutate node.children.

> Source/WebInspectorUI/UserInterface/Controllers/DOMTreeManager.js:296
> +        let pseudoElements = node.pseudoElements();

No need for a local.
Comment 3 Joseph Pecoraro 2015-08-19 17:02:11 PDT
Created attachment 259430 [details]
[PATCH] For Landing
Comment 4 WebKit Commit Bot 2015-08-19 17:37:30 PDT
Comment on attachment 259430 [details]
[PATCH] For Landing

Clearing flags on attachment: 259430

Committed r188670: <http://trac.webkit.org/changeset/188670>
Comment 5 Joseph Pecoraro 2015-09-01 11:14:34 PDT
This landed, see above comment.