WICG / window-controls-overlay

https://wicg.github.io/window-controls-overlay/
Other
98 stars 20 forks source link

When does the `geometrychange` event fire? #32

Closed yoavweiss closed 2 years ago

yoavweiss commented 2 years ago

You need a processing model that fires that event at the appropriate time and provides details on that (It is a sync/async event, can it be cancelled, does it bubble, etc)

diekus commented 2 years ago

@yoavweiss Thanks for the feedback. I am working on addressing these comments. I am "taking inspiration" from the Virtual Keyboard API since that API features a geometry change event that certainly provides information on when the event fires, but I would like to ask you how does one define the other details you mention (It is a sync/async event, can it be cancelled, does it bubble, etc) Is it in prose?

yoavweiss commented 2 years ago

https://dom.spec.whatwg.org/#firing-events-example should demonstrate how to initialize the cacncellable and bubble attributes. sync/async is essentially a question of whether you're calling fire the event directly, or queueing a task to fire it at a later point (see e.g. prepare a script for examples)

diekus commented 2 years ago

I have added a reference to clarify that this event fires with a window resize.

yoavweiss commented 2 years ago

Can you point me to the reference? Generally, it's best to trigger the event from the processing model where you want it to be triggered. In case of WICG specs (that don't necessarily have the necessary consensus) we often temporarily monkey-patch the relevant processing models and indicate where in those models the event will be fired.

diekus commented 2 years ago

I will send it to be merged soon, I have added references that point appropriately to the window resize event and the title bar region resize.

"The ongeometrychange attribute is an event handler whose corresponding event handler event type is "change". The event is dispatched when there the title bar region resizes, e.g., in response to the UA displaying the scope's origin during the launch of the app, an extension or feature like file access or download displaying an icon as part of the window controls overlay, or a window resize." (will be live as soon as I get it merged, I will let you know! (thanks again for the hepl!)

diekus commented 2 years ago

Hola Yoav, please advice: https://wicg.github.io/window-controls-overlay/#the-ongeometrychange-attribute

Regards,

Diego


From: Yoav Weiss @.> Sent: Tuesday, November 16, 2021 6:15:50 AM To: WICG/window-controls-overlay @.> Cc: Diego Gonzalez @.>; Comment @.> Subject: Re: [WICG/window-controls-overlay] When does the geometrychange event fire? (Issue #32)

Can you point me to the reference? Generally, it's best to trigger the event from the processing model where you want it to be triggered. In case of WICG specs (that don't necessarily have the necessary consensus) we often temporarily monkey-patch the relevant processing models and indicate where in those models the event will be fired.

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/WICG/window-controls-overlay/issues/32#issuecomment-969900746, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ARUDUUTFHBHUFU5XRXOCCVTUMHZJNANCNFSM5GO7OF3A.

inexorabletash commented 2 years ago

To be even more specific, I think we need a clear path from https://html.spec.whatwg.org/multipage/webappapis.html#event-loop-processing-model (specifically steps 11.7) through https://drafts.csswg.org/cssom-view/#run-the-resize-steps to your steps. You could do this by "monkey patching" the CSSOM-View steps, e.g. add something like this somewhere: "When asked to run the resize steps for a Document doc, also run these steps. 1. Run the steps to resize the title bar area for doc's window"

yoavweiss commented 2 years ago

https://wicg.github.io/window-controls-overlay/#integration-with-cssom covers this. Closing.