Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #29033

Re: The Screen interface

From Joao Rodrigues <groups_jr-1@yahoo.com.br>
Newsgroups comp.lang.javascript
Subject Re: The Screen interface
Date 2015-12-23 18:26 -0200
Organization Aioe.org NNTP Server
Message-ID <n5f021$hif$1@speranza.aioe.org> (permalink)
References <Screen-20151223190916@ram.dialup.fu-berlin.de>

Show all headers | View raw


On 23-12-2015 16:17, Stefan Ram wrote:
>    The page
>
> developer.mozilla.org/en-US/docs/Web/API/Screen
>
>    contains »
>
> Screen.height
> Returns the height of the screen in pixels.
>
> Screen.width
> Returns the width of the screen.

The Screen interface has been roaming the praries since when Netscape 
Navigator ruled the World Wide Web (geez!). Although Screen is specified 
in the CSSOM View Module [1], I think it is useless nowadays because our 
working canvas is the browser's viewport, and we can rely on CSS media 
queries (no JavaScript involved) if we need to adjust the design to the 
device's screen resolution,  [2]

[1] <http://www.w3.org/TR/cssom-view/#the-screen-interface>
[2] <http://www.w3.org/TR/css3-mediaqueries>

>
>    «. So /that's/ the difference between »height« and »width«:
>    »height« is measured in pixels, while »width« is measured
>    in an unspecified unit! ;-)

According to the CSSOM View Module, the width / height attribute must 
return the width / height of the output device in CSS pixels.

>
>    I often find the MDN to be quite mediocre. For example, in
>    the case above, I also do not deem properties to »return«
>    values. /Functions/ return values, properties /have/ them.

Due to the lack of other good / reliable resources, MDN is a bless. But 
as MDN is a Wiki, everyone can contribute to it or spoil the party.

>
>    Also, it is not necessary to always repeat the name of the
>    interface and to use a verb when a value is being described.
>
>    So, I'd write this as (assuming that »width« /is/ in pixels): »
>
> The interface Screen
>
> height
> the height of the screen in pixels
>
> width
> the width of the screen in pixels

See above.


-- 
Joao Rodrigues

Back to comp.lang.javascript | Previous | Next | Find similar | Unroll thread


Thread

Re: The Screen interface Joao Rodrigues <groups_jr-1@yahoo.com.br> - 2015-12-23 18:26 -0200

csiph-web