Bug 214886 - Web Inspector: Don't allow docking to a hidden web view
Summary: Web Inspector: Don't allow docking to a hidden web view
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Local Build
Hardware: All All
: P2 Normal
Assignee: Timothy Hatcher
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-07-28 11:15 PDT by Timothy Hatcher
Modified: 2020-07-28 12:22 PDT (History)
3 users (show)

See Also:


Attachments
Patch (2.73 KB, patch)
2020-07-28 11:17 PDT, Timothy Hatcher
no flags Details | Formatted Diff | Diff
Patch (2.72 KB, patch)
2020-07-28 11:53 PDT, Timothy Hatcher
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Timothy Hatcher 2020-07-28 11:15:50 PDT
When the Inspected Web View is hidden, don't try to attach.
Comment 1 Timothy Hatcher 2020-07-28 11:17:48 PDT
Created attachment 405380 [details]
Patch
Comment 2 Devin Rousso 2020-07-28 11:40:55 PDT
Comment on attachment 405380 [details]
Patch

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

r=me

> Source/WebKit/UIProcess/Inspector/WebInspectorProxy.cpp:282
> +    if (!m_inspectedPage || !m_inspectorPage || !platformCanAttach(m_canAttach))

NIT: can you use `platformCanAttach(canAttach())` instead?  This is what other callers do, and it covers the future case where `canAttach` becomes more complex :)

> Source/WebKit/UIProcess/Inspector/WebInspectorProxy.cpp:314
> +    if (!m_inspectedPage || !m_inspectorPage || (!m_isAttached && m_isVisible))

Is `m_isVisible` necessary?
Comment 3 Timothy Hatcher 2020-07-28 11:53:37 PDT
Created attachment 405386 [details]
Patch
Comment 4 Timothy Hatcher 2020-07-28 11:57:32 PDT
Comment on attachment 405380 [details]
Patch

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

>> Source/WebKit/UIProcess/Inspector/WebInspectorProxy.cpp:282
>> +    if (!m_inspectedPage || !m_inspectorPage || !platformCanAttach(m_canAttach))
> 
> NIT: can you use `platformCanAttach(canAttach())` instead?  This is what other callers do, and it covers the future case where `canAttach` becomes more complex :)

Okay.

>> Source/WebKit/UIProcess/Inspector/WebInspectorProxy.cpp:314
>> +    if (!m_inspectedPage || !m_inspectorPage || (!m_isAttached && m_isVisible))
> 
> Is `m_isVisible` necessary?

Yes, since m_isAttached could be stale after close.
Comment 5 EWS 2020-07-28 12:21:40 PDT
Committed r264999: <https://trac.webkit.org/changeset/264999>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 405386 [details].
Comment 6 Radar WebKit Bug Importer 2020-07-28 12:22:19 PDT
<rdar://problem/66231117>