[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.javascript

The Screen interface

ram

12/23/2015 6:17:00 PM

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.

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

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.

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

«.

4 Answers

Aleksandro

12/23/2015 6:42:00 PM

0

On 23/12/15 15: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.
>
> «. So /that's/ the difference between »height« and »width«:
> »height« is measured in pixels, while »width« is measured
> in an unspecified unit! ;-)
>
> 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.
>
> 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
>
> «.

¿How about contributing such correction to the documentation?

ram

12/23/2015 6:49:00 PM

0

Aleksandro <aleksandro@gmx.com> writes:
>¿How about contributing such correction to the documentation?

Siéntete libre de hacerlo.

JR

12/23/2015 8:27:00 PM

0

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-int...
[2] <http://www.w3.org/TR/css3-mediaq...

>
> «. 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

Thomas 'PointedEars' Lahn

12/25/2015 4:53:00 PM

0

Stefan Ram wrote:

> Aleksandro <aleksandro@gmx.com> writes:
>>¿How about contributing such correction to the documentation?
>
> Siéntete libre de hacerlo.

Figures. You would rather whine about how terrible something is instead of
trying to improve it.

--
PointedEars
FAQ: <http://PointedEars.... | SVN: <http://PointedEars.de...
Twitter: @PointedEars2 | ES Matrix: <http://PointedEars.de/es-...
Please do not cc me. / Bitte keine Kopien per E-Mail.