Re: [csswg-drafts] [cssom-view] Add "sticky" to the features argument to the window.open() method (#12361)

Hi @emilio, thanks for the explanations!

> Ok I think we were not understanding each other. This is what I meant. There are effectively three rects, even tho the website only sees two:
> 
> ```
> +-----------------------------------+
> |  Border / shadow and decorations  |
> |   +---------------------------+   |
> |   |  Titlebar                 |   |
> |   +---------------------------+   |
> |   |  Content area             |   |
> |   |                           |   |
> ```
> 
> The website only has "outer" coordinates (`screenX` / `screenY` / `outerWidth` / `outerHeight`, top left of the Shadow and decorations) and "inner" coordinates (which is the content area).
> 
> My point is that for this use case you kinda want the middle one, right?

I think ideally we need the outer coordinate without the shadow part in this use case.
The outer coordinate affects the overlapping check, which decides whether the sticky window to follow or not.
If the platform thinks that the shadow is part of the outer coordinate, then there will be a gap when the sticky window starts to follow. But it seems not to affect the user experience very much. Actually, a gap is very common in our use cases.

For instance, if currently the two windows are at the same Y position, and the X position is intersected by 5 px. The main window starts to `moveBy(15, 0)`. Because they are intersected, the sticky window won't follow the movement. So after the movement now there is a 10px gap between them. If the main window moves again afterward, the sticky would follow the movement.

If users do not want a gap, they could always adjust the sticky window manually; the change of sticky window position does not affect the position of the main window.

This API emphasizes the sticky window following the movement. It seems fine to let the overlapping check depending on the platforms. For sure, it's better if we have a clearer definition of the outer coordinate, so that the behavior is consistent across all platforms.

> 
> Actually, in browsers, whether the shadow is included in the outer coords depends on the platform. IIRC it is included on Windows, but not on macOS where the shadow extent is not exposed to the app. On Linux it depends on whether you're using client-side or server-side window decorations...

Is it possible to clarify if the shadow part should be included in the outer coordinate?

> So I guess my question is... Should we expose this "extra" set of coordinates somehow? In general, this feels like the same kind of complexity that [@smfr](https://github.com/smfr) was arguing for not exposing to websites on the other issue, and I kind of agree...

Yeah, I also agree that exposing an "extra" set is complex.


-- 
GitHub Notification of comment by cathiechen
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/12361#issuecomment-3004548710 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 25 June 2025 12:12:49 UTC