W3C home > Mailing lists > Public > www-style@w3.org > September 2013

Re: [CSSOM View] Units for window.screen

From: Simon Pieters <simonp@opera.com>
Date: Wed, 11 Sep 2013 15:21:44 +0200
To: "Robert O'Callahan" <robert@ocallahan.org>
Cc: "Henri Sivonen" <hsivonen@iki.fi>, "WWW Style" <www-style@w3.org>, "Kang-Hao (Kenny) Lu" <kanghaol@oupeng.com>
Message-ID: <op.w280qi2pidj3kv@simons-macbook-pro.local>
On Sat, 07 Sep 2013 21:15:01 +0200, Simon Pieters <simonp@opera.com> wrote:

> On Sat, 07 Sep 2013 02:33:30 +0200, Robert O'Callahan  
> <robert@ocallahan.org> wrote:
>
>>> You mean parameters to window.open? Hmm.
>
> Yes (although that's not specced out at all in HTML), but also  
> window.resizeTo().
>
>
>>>> Things that are sized in CSS pixels have no use of the screen's width.
>>>>
>>>
>>> Maybe the problem is that I don't know what the legitimate uses are for
>>> getting the screen width. I know it's used as part of device sniffing,  
>>> but
>>> that's inherently bogus.
>
> Yeah.
>
>
>> To clarify, I don't see sizing popups to fill half your screen, or
>> something like that, as being legitimately useful.
>
> I don't disagree.
>
>> (If you want to fill the
>> screen, we have the fullscreen API for that.)
>
> Yes.

But going fullscreen and opening a maximized popup or making a popup  
maximized are a bit different.


>> Popup windows are mostly
>> blocked and when they are used they should be sizing based on their
>> content. In most cases they should probably inherit the parent window's
>> zoom as well.
>
> That's a good point.
>
> It seems that Firefox uses CSS pixel with the opener's zoom level for  
> window.open(), but the popup window doesn't inherit the zoom (at least  
> for a data: URL). open() sizes the viewport, but resizeTo() sizes the  
> whole window. For sizing based on the content, you would want to size  
> the viewport in CSS pixels using the popup's zoom level.
>
> I think I'll change the spec for resizeTo() to size the viewport and use  
> the popup's CSS pixel as unit.

Done.

https://dvcs.w3.org/hg/csswg/rev/9971f0d7fd24


> I might spec the third argument to window.open() as well since it is  
> related.

Not done yet.

> As for screen.width, it seems Firefox uses CSS pixel at current zoom but  
> Blink (and Safari on iOS) uses CSS pixel at 100% zoom.
>
> If it's not useful for sizing popups, there isn't much left. Detecting  
> devices based screen.width would be less reliable if it changed based on  
> zoom. Fingerprinting would either be stronger or be more confused,  
> depending on how often the user changes zoom level. Would it be a bad  
> idea to return static values for these, or maybe the viewport dimensions?

I've made them use CSS pixel again, matching Firefox. I've left them  
reflecting the screen's dimensions so that pages that use them for the  
purpose of maximizing popups still maximize rather than doing nothing or  
sizing to the same size of the opener's viewport (depending on which  
screen is being accessed).

-- 
Simon Pieters
Opera Software
Received on Wednesday, 11 September 2013 13:15:01 UTC

This archive was generated by hypermail 2.4.0 : Monday, 23 January 2023 02:14:32 UTC