Bug 240769

Summary: WebInspector: Regression(r292754) Uncaught Exception: TypeError: undefined is not an object (evaluating 'this.ownerDocument.documentURL')
Product: WebKit Reporter: Patrick Angle <pangle>
Component: Web InspectorAssignee: Patrick Angle <pangle>
Status: RESOLVED FIXED    
Severity: Normal CC: inspector-bugzilla-changes, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
URL: https://patrickangle-static.s3.amazonaws.com/demos/grids/index.html
Bug Depends on: 189687    
Bug Blocks:    

Description Patrick Angle 2022-05-21 21:03:45 PDT
Uncaught Exception in Web Inspector. Seems like I missed updating the ownerDocument somewhere :/

Steps to Reproduce:
1. Inspect https://patrickangle-static.s3.amazonaws.com/demos/grids/index.html
2. Reload (from origin seems more reliable repro?)

Uncaught Exceptions:
-----------------------
 - TypeError: undefined is not an object (evaluating 'this.ownerDocument.documentURL') (at DOMNode.js:1257:37)
    _createLayoutOverlayColorSettingIfNeeded @ DOMNode.js:1257:37
    layoutOverlayColor @ DOMNode.js:706:54
    layout @ NodeOverlayListSection.js:124:81
    _layoutSubtree @ View.js:308:20
    _layoutSubtree @ View.js:319:32
    _visitViewTreeForLayout @ View.js:378:36
-----------------------

Notes:
Inspected URL:        https://patrickangle-static.s3.amazonaws.com/demos/grids/index.html
Loading completed:    true
Frontend User Agent:  Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko)
Comment 1 Radar WebKit Bug Importer 2022-05-21 21:04:06 PDT
<rdar://problem/93715304>
Comment 2 Patrick Angle 2022-05-21 23:11:53 PDT
The frontend representation of the DOM tree does not match the backend representation. I suspect this is not the only bad thing happening as a result.

Preparing a revert for the caused-by and its followup since the changes were relatively self-contained and the bug they were fixing is less awful than the new results (console inspection of nodes that are detached and reattached without getting the node from the page again).
Comment 3 Patrick Angle 2022-05-21 23:56:15 PDT
Pull request: https://github.com/WebKit/WebKit/pull/890
Comment 4 EWS 2022-05-22 11:01:45 PDT
Committed r294621 (250847@main): <https://commits.webkit.org/250847@main>

Reviewed commits have been landed. Closing PR #890 and removing active labels.