Bug 231721

Summary: Don't run focusing steps on disconnected or inert <dialog>
Product: WebKit Reporter: Tim Nguyen (:ntim) <ntim>
Component: DOMAssignee: Tim Nguyen (:ntim) <ntim>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, changseok, esprehn+autocc, ews-watchlist, gyuyoung.kim, koivisto, simon.fraser, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 84635, 227537    
Attachments:
Description Flags
Patch
none
updateStyleIfNeeded patch
koivisto: review+
updateLayout patch none

Description Tim Nguyen (:ntim) 2021-10-13 22:22:30 PDT
For show, we need to update both style & layout.

For showModal, we need to update only layout (addToTopLayer called beforehand updates style).
Comment 1 Tim Nguyen (:ntim) 2021-10-14 06:50:02 PDT
Created attachment 441210 [details]
Patch
Comment 2 Simon Fraser (smfr) 2021-10-14 08:44:08 PDT
Comment on attachment 441210 [details]
Patch

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

> Source/WebCore/html/HTMLDialogElement.cpp:125
> +    if (auto* cs = computedStyle(); cs && cs->effectiveInert())

We don't use abbreviations like "cs".

Why go through computedStyle() and not the Renderer? Have we updated style here yet after opening the dialog?
Comment 3 Tim Nguyen (:ntim) 2021-10-14 09:33:18 PDT
Created attachment 441227 [details]
updateStyleIfNeeded patch
Comment 4 Tim Nguyen (:ntim) 2021-10-14 09:46:11 PDT
Created attachment 441228 [details]
updateLayout patch
Comment 5 Tim Nguyen (:ntim) 2021-10-14 10:38:31 PDT
Comment on attachment 441228 [details]
updateLayout patch

As Antti points out, Element::isFocusable is able to resolve without layout being up-to-date. So the updateLayout patch is not needed.
Comment 6 Tim Nguyen (:ntim) 2021-10-14 10:53:15 PDT
Committed r284174 (242991@main): <https://commits.webkit.org/242991@main>
Comment 7 Radar WebKit Bug Importer 2021-10-14 10:54:16 PDT
<rdar://problem/84263950>