Bug 139663

Summary: Web Inspector: Uncaught Exception when dismissing Go To Line dialog
Product: WebKit Reporter: Joseph Pecoraro <joepeck>
Component: Web InspectorAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, graouts, joepeck, jonowells, mattbaker, nvasilyev, timothy, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
[PATCH] Proposed Fix none

Description Joseph Pecoraro 2014-12-15 18:42:15 PST
* SUMMARY
Uncaught Exception when dismissing Go To Line dialog:

    [Error] NotFoundError: DOM Exception 8: An attempt was made to reference a Node in a context where it does not exist.
	removeChild (Main.js, line 6910)
	dismiss (Main.js, line 6910)
	_handleKeydownEvent (Main.js, line 6919)
	handleEvent (Main.js, line 6912)

* STEPS TO REPRODUCE
1. Inspect any page
2. Go to source code text editor
3. Open Go To Line Dialog (Cmd+L)
4. Input a number and push Return to dismiss the dialog
  => uncaught exception

* NOTES
- The exception is happening because dismiss is getting called twice. Once by the key event, once by the "blur" event that is happening as the result of removeChild. This double dismiss causes an exception.
Comment 1 Joseph Pecoraro 2014-12-15 18:44:44 PST
Created attachment 243335 [details]
[PATCH] Proposed Fix
Comment 2 Joseph Pecoraro 2014-12-15 18:45:31 PST
Example debugging:

    Resources/Views/GoToLineDialog.js:70:20: CONSOLE LOG dismissing
    Resources/Views/GoToLineDialog.js:71:22: CONSOLE TRACE
    0: dismiss(Resources/Views/GoToLineDialog.js:71:22)
    1: _handleKeydownEvent(Resources/Views/GoToLineDialog.js:138:29)
    2: handleEvent(Resources/Views/GoToLineDialog.js:98:37)

    Resources/Views/GoToLineDialog.js:70:20: CONSOLE LOG dismissing
    Resources/Views/GoToLineDialog.js:71:22: CONSOLE TRACE
    0: dismiss(Resources/Views/GoToLineDialog.js:71:22)
    1: _handleBlurEvent(Resources/Views/GoToLineDialog.js:149:21)
    2: handleEvent(Resources/Views/GoToLineDialog.js:101:34)
    3: removeChild([native code])
    4: dismiss(Resources/Views/GoToLineDialog.js:81:27)
    5: _handleKeydownEvent(Resources/Views/GoToLineDialog.js:138:29)
    6: handleEvent(Resources/Views/GoToLineDialog.js:98:37)

Shows the nested nature.
Comment 3 Radar WebKit Bug Importer 2014-12-17 11:23:39 PST
<rdar://problem/19281546>
Comment 4 WebKit Commit Bot 2015-01-06 18:56:55 PST
Comment on attachment 243335 [details]
[PATCH] Proposed Fix

Clearing flags on attachment: 243335

Committed r178018: <http://trac.webkit.org/changeset/178018>
Comment 5 WebKit Commit Bot 2015-01-06 18:56:59 PST
All reviewed patches have been landed.  Closing bug.