[Screen Orientation] nit for the case when the screen width and height are equal
"Kang-Hao (Kenny) Lu（吕康豪）" <lvkanghao@...
2015-03-26 03:26:04 GMT
I have to admit that I am reading this spec thinking about rounded
display (aka. watch) and this probably requires brainstorms instead
of this nitpicking, but whatever.
The current spec seems to leave screen.orientation.lock("landscape")
undefined for the case when the screen width and height are equal
because the steps of "update the orientation information" make "current
orientation type" always "portrait-primary" or "portrait-secondary" for
# 2. Otherwise, if the screen width is less than or equal to the
# screen height, set the document's current orientation type to
# portrait-primary or portrait-secondary.
("update the orientation information" step 2)
I think we shoud drop "or equal to" here and, if necessary, say
something like "for the purpose of this specification, it is assumed
that the physical device has unequal width and height. User agent MUST
treat one physical side or another as if its greater.", but this is
awkward so I think just dropping "or equal to" is fine.
Some more editorial comments:
In step 1 of "update the orientation information"
# 1. If the screen width is greater than the screen height, set the
# document's current orientation type to landscape-primary or
I had trouble realizing that the "screen width" here is a variable and
depends on how viewport is rendered (I had assumed it means "device
width", I guess). This probably needs a xref to "screen" in 4. Concepts.
Or would it be fine if we just use 'screen.width' and 'screen.height' here?
In step 3 of "update the orientation information"
# 3. Set the document's current orientation angle to the clockwise
# angle in degrees between the orientation of the viewport as it is
# drawn and the natural orientation of the device (i.e., the top of
# the physical screen).
I am still having trouble visualizing what "clockwise angle in degrees
between the orientation of the viewport" means and I wonder if it would
be easier if this is rephrased using "angle from". A picture here would
be the best (perhaps adapted from a DeviceOrientation one?).
In step 6 of "lock the orientation"
# 6. Otherwise, depending on platform conventions, change how the
# viewport is drawn in order to make it match another screen
# orientation type. However, it has to be part of orientations.
I think we should consider revert this change. Having no MAY (or may)
here reads like a must to me, and so it sounds kinda confusing even if
there's "depending on platform conventions".
Software Engineer, Shenzhen, BGI