Web-Facing Change PSA: Throw exception for popovers/dialogs in non-active documents

214 views
Skip to first unread message

Mason Freed

unread,
Oct 29, 2024, 11:50:54 AMOct 29
to blink-dev

Contact emails

mas...@chromium.org

Specification

https://github.com/whatwg/html/pull/10705

Summary

This is a corner case change that hopefully does not impact developers. Previously calling `showPopover()` or `showModal()` on a popover or dialog that resides within an inactive document would silently fail. I.e. no exception would be thrown, but since the document is inactive, no popover or dialog would be shown. As of the https://github.com/whatwg/html/pull/10705 spec PR, these situations now throw InvalidStateError.



Blink component

Blink>DOM

TAG review

None

TAG review status

Not applicable

Risks



Interoperability and Compatibility

There is a *very* slight compat risk, if developers are counting on these operations (showPopover/showModal in inactive document) not throwing exceptions. But there are no known use cases for that, so the risk should be minimal.



Gecko: No signal

WebKit: No signal

Web developers: No signals

Other signals:

WebView application risks

Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?

None



Debuggability

None



Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, ChromeOS, Android, and Android WebView)?

Yes

Is this feature fully tested by web-platform-tests?

Yes

https://chromium-review.googlesource.com/c/chromium/src/+/5943740



Flag name on chrome://flags

TopLayerInactiveDocumentExceptions

Finch feature name

TopLayerInactiveDocumentExceptions

Requires code in //chrome?

False

Tracking bug

https://crbug.com/373684393

Estimated milestones

Shipping on desktop132
DevTrial on desktop132
Shipping on Android132
DevTrial on Android132
Shipping on WebView132


Anticipated spec changes

Open questions about a feature may be a source of future web compat or interop issues. Please list open issues (e.g. links to known github issues in the project for the feature specification) whose resolution may introduce web compat/interop risk (e.g., changing to naming or structure of the API in a non-backward-compatible way).

None

Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/6352111728852992?gate=5229499854356480

This intent message was generated by Chrome Platform Status.

Yoav Weiss (@Shopify)

unread,
Oct 30, 2024, 6:47:57 AMOct 30
to Mason Freed, blink-dev
What are the current usecounters for `showPopover()` and `showModal()`? Have we looked at current usage to have enough confidence that it's currently being try/catched?

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAM%3DNeDgP3vEKfHhwf7WTaKn1LWK0GF3JzCq7yXrn_Axwx9d0aQ%40mail.gmail.com.

Mason Freed

unread,
Oct 30, 2024, 3:07:07 PMOct 30
to Yoav Weiss (@Shopify), blink-dev
On Wed, Oct 30, 2024 at 3:47 AM Yoav Weiss (@Shopify) <yoav...@chromium.org> wrote:
What are the current usecounters for `showPopover()` and `showModal()`? Have we looked at current usage to have enough confidence that it's currently being try/catched?

Yeah, good questions. So there aren't use counters for `showPopover()`, but the overall use counter for popovers is 0.4% currently. And the `showModal()` use counter is at 0.08%. The important bit is that I would expect that a vanishingly-small percentage of these uses falls into the bucket affected by this change: calling those methods while the document is inactive. I don't think I could find that type of usage via HTTP Archive, so it'd have to be via a specific use counter for that case. Instead, my plan has been to monitor carefully, and Finch this change back off in the case that there is real usage of this case. LMK what you think.

Thanks,
Mason

Yoav Weiss (@Shopify)

unread,
Oct 30, 2024, 4:38:59 PMOct 30
to Mason Freed, blink-dev
I agree that the "non-active documents" part would be a fraction of the usage you stated, and hence likely very small.

Having a Finch kill-switch handy and carefully monitoring the rollout sound like a reasonable approach to me.

Mason Freed

unread,
Oct 30, 2024, 7:16:33 PMOct 30
to Yoav Weiss (@Shopify), blink-dev
On Wed, Oct 30, 2024 at 1:38 PM Yoav Weiss (@Shopify) <yoav...@chromium.org> wrote:
I agree that the "non-active documents" part would be a fraction of the usage you stated, and hence likely very small.

Having a Finch kill-switch handy and carefully monitoring the rollout sound like a reasonable approach to me.

Great! Thanks for the feedback. Fingers crossed there aren't any problems.

Thanks,
Mason
Reply all
Reply to author
Forward
0 new messages