Bug 171254 - REGRESSION (r214863): Web Inspector: Uncaught Exception when losing focus from a selector field
Summary: REGRESSION (r214863): Web Inspector: Uncaught Exception when losing focus fro...
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Nikita Vasilyev
Keywords: InRadar
Depends on:
Reported: 2017-04-24 16:26 PDT by Nikita Vasilyev
Modified: 2017-04-25 21:27 PDT (History)
5 users (show)

See Also:

Patch (1.60 KB, patch)
2017-04-25 16:53 PDT, Nikita Vasilyev
joepeck: review+
Details | Formatted Diff | Diff
Patch (1.69 KB, patch)
2017-04-25 20:45 PDT, Nikita Vasilyev
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nikita Vasilyev 2017-04-24 16:26:36 PDT
Uncaught Exceptions:
 - TypeError: null is not an object (evaluating 'event.relatedTarget.isDescendant') (at CSSStyleDeclarationSection.js:694:32)
    _handleBlur @ CSSStyleDeclarationSection.js:694:32
    _handleBlur @ [native code]

1. Open https://webkit.org;
2. Inspect <body>;
3. Focus on "body.home" selector (any selector would do);
4. Focus on an other app (Command-Tab on macOS).

An uncaught exception is thrown.
Comment 1 Radar WebKit Bug Importer 2017-04-25 09:56:10 PDT
Comment 2 Nikita Vasilyev 2017-04-25 16:46:51 PDT
This was introduced by https://trac.webkit.org/changeset/214863/webkit.
Comment 3 Nikita Vasilyev 2017-04-25 16:53:05 PDT
Created attachment 308167 [details]

> The FocusEvent.relatedTarget read-only property represents a secondary target for this event, which will depend on the event itself.
> In some cases (like when tabbing in or out of a page), this property may be set to null for security reasons.

Comment 4 Joseph Pecoraro 2017-04-25 19:05:30 PDT
Comment on attachment 308167 [details]

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


> Source/WebInspectorUI/ChangeLog:9
> +        event.relatedTarget of a blur event contains an element where focus moved to. When tabbing out

"When tabbing out" is unclear. This makes me think you just pressed tab and suddenly its null, however the steps to reproduce were Command-Tab. I'd rephrase:

    The event.relatedTarget of a blur event contains the element where focus moved to.
    In some cases this can be null, such as if the user leaves the application window.
    For example Command+Tab to switch to another application.
Comment 5 Nikita Vasilyev 2017-04-25 20:45:47 PDT
Created attachment 308201 [details]
Comment 6 WebKit Commit Bot 2017-04-25 21:27:41 PDT
Comment on attachment 308201 [details]

Clearing flags on attachment: 308201

Committed r215789: <http://trac.webkit.org/changeset/215789>
Comment 7 WebKit Commit Bot 2017-04-25 21:27:42 PDT
All reviewed patches have been landed.  Closing bug.