RESOLVED FIXED Bug 234446
ModalContainerObserver should search for text in subframes
https://bugs.webkit.org/show_bug.cgi?id=234446
Summary ModalContainerObserver should search for text in subframes
Wenson Hsieh
Reported 2021-12-17 15:19:24 PST
.
Attachments
Patch (16.61 KB, patch)
2021-12-26 12:14 PST, Wenson Hsieh
no flags
Rebase on trunk (16.55 KB, patch)
2022-01-02 15:18 PST, Wenson Hsieh
no flags
Radar WebKit Bug Importer
Comment 1 2021-12-24 15:20:46 PST
Wenson Hsieh
Comment 2 2021-12-26 12:14:14 PST
Wenson Hsieh
Comment 3 2022-01-02 15:18:59 PST
Created attachment 448188 [details] Rebase on trunk
Tim Horton
Comment 4 2022-01-04 13:08:32 PST
Comment on attachment 448188 [details] Rebase on trunk View in context: https://bugs.webkit.org/attachment.cgi?id=448188&action=review > Source/WebCore/page/ModalContainerObserver.cpp:67 > - if (!document.url().protocolIsInHTTPFamily()) > + if (!document.topDocument().url().protocolIsInHTTPFamily()) Should this check both documents? (I'm not sure what the HTTP-family check is *for*, so the answer could easily be yes OR no, I'm not sure)
Wenson Hsieh
Comment 5 2022-01-04 13:26:37 PST
Comment on attachment 448188 [details] Rebase on trunk View in context: https://bugs.webkit.org/attachment.cgi?id=448188&action=review Thanks for the review! >> Source/WebCore/page/ModalContainerObserver.cpp:67 >> + if (!document.topDocument().url().protocolIsInHTTPFamily()) > > Should this check both documents? (I'm not sure what the HTTP-family check is *for*, so the answer could easily be yes OR no, I'm not sure) Good question! So I *think* the top document URL check should suffice. As far as I understand, this check is here because the feature that this "modal container observation" mechanism drives is only intended to take effect when navigating to http URLs, as opposed to file:// or any custom schemes, so this basically just acts as a way to short circuit the detection logic early on in the case where the document isn't HTTP/HTTPS. In the subframe case in particular, the..."semantically interesting" content of the modal container can come in the form of a data: URL on the iframe or the `srcdoc` attribute, in which case the URL will not be in the HTTP family (but we'll still need to descend into these frames for the purposes of modal container detection) — so in the case where the sub-document is non-HTTP-family, we don't want to bail early here.
EWS
Comment 6 2022-01-04 14:00:00 PST
Committed r287588 (245717@main): <https://commits.webkit.org/245717@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 448188 [details].
Note You need to log in before you can comment on or make changes to this bug.