Bug 234299

Summary: Add a basic heuristic for collecting and extracting text from controls in ModalContainerObserver
Product: WebKit Reporter: Wenson Hsieh <wenson_hsieh>
Component: PlatformAssignee: Wenson Hsieh <wenson_hsieh>
Status: RESOLVED FIXED    
Severity: Normal CC: akeerthi, bdakin, dino, megan_gardner, thorton, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Rebase on trunk
none
For EWS none

Description Wenson Hsieh 2021-12-14 08:34:31 PST
.
Comment 1 Wenson Hsieh 2021-12-17 10:58:05 PST Comment hidden (obsolete)
Comment 2 Wenson Hsieh 2021-12-18 11:32:11 PST
Created attachment 447524 [details]
Rebase on trunk
Comment 3 Dean Jackson 2021-12-19 08:46:57 PST
Comment on attachment 447524 [details]
Rebase on trunk

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

> Source/WebCore/page/ModalContainerObserver.cpp:182
> +    if (element.hasEventListeners(eventNames().clickEvent) || element.hasEventListeners(eventNames().mousedownEvent) || element.hasEventListeners(eventNames().mouseupEvent))

What about touch and pointer events?

> Source/WebCore/page/ModalContainerObserver.cpp:209
> +            if (outer->hasTagName(HTMLNames::divTag) || outer->hasTagName(HTMLNames::spanTag) || outer->hasTagName(HTMLNames::pTag))

What about <section>?
Comment 4 Wenson Hsieh 2021-12-19 11:19:39 PST
Comment on attachment 447524 [details]
Rebase on trunk

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

Thanks for taking a look!

>> Source/WebCore/page/ModalContainerObserver.cpp:182
>> +    if (element.hasEventListeners(eventNames().clickEvent) || element.hasEventListeners(eventNames().mousedownEvent) || element.hasEventListeners(eventNames().mouseupEvent))
> 
> What about touch and pointer events?

Makes sense — will add touchstart/end and pointerup/down here as well.

>> Source/WebCore/page/ModalContainerObserver.cpp:209
>> +            if (outer->hasTagName(HTMLNames::divTag) || outer->hasTagName(HTMLNames::spanTag) || outer->hasTagName(HTMLNames::pTag))
> 
> What about <section>?

That's a good point! Section elements probably fall under this same umbrella of "more likely to contain a semantically meaningful controls, rather than being one itself". Will add section to the list here.
Comment 5 Wenson Hsieh 2021-12-19 11:30:17 PST
Created attachment 447551 [details]
For EWS
Comment 6 EWS 2021-12-19 12:25:38 PST
Committed r287245 (245403@main): <https://commits.webkit.org/245403@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 447551 [details].
Comment 7 Radar WebKit Bug Importer 2021-12-19 12:26:16 PST
<rdar://problem/86697551>