Re: question about screen_size in Runtime and Security Model

Hi Marcos,




On Fri, Feb 22, 2013 at 4:47 PM, Marcos Caceres <w3c@marcosc.com> wrote:

>
>
> On Thursday, 21 February 2013 at 07:23, Jonas Sicking wrote:
>
> > On Wed, Feb 20, 2013 at 9:59 PM, Lars Knudsen <larsgk@gmail.com (mailto:
> larsgk@gmail.com)> wrote:
> > > On Thu, Feb 21, 2013 at 2:24 AM, Jonas Sicking <jonas@sicking.cc(mailto:
> jonas@sicking.cc)> wrote:
> > > >
> > > > On Wed, Feb 20, 2013 at 1:31 PM, Lars Knudsen <larsgk@gmail.com(mailto:
> larsgk@gmail.com)> wrote:
> > > > > Hi,
> > > > >
> > > > > ( related proposal:
> > > > >
> > > > >
> http://mounirlamouri.github.com/sysapps/proposals/RunTime-Security/Overview.html
> > > > > )
> > > > >
> > > > > I think it's good that you are working on a spec to encapsulate
> what is
> > > > > needed to make it somewhat easy to do generic app descriptors for
> web
> > > > > apps -
> > > > > as opposed to fiddling with all kinds of Apple (or other) specific
> tags
> > > > > and
> > > > > tricks to make webapps behave the same across platforms. However,
> I am
> > > > > not
> > > > > too fond of the spec proposal I found on github, where the
> screen_size
> > > > > options seem limited to minimum width/height.
> > > > >
> > > > > What I need as an app developer, is the viewport meta tag "done
> right",
> > > > > where I can say, e.g. "give me a screen of 1920 x 1080 (virtual)
> pixels"
> > > > > and
> > > > > the platform would figure out how to best match it within the
> device
> > > > > currently displaying it. Of course, the actual pixel count could be
> > > > > made
> > > > > available to the application, but to make it very simple for 99%
> cases,
> > > > > where you just need a virtual fixed size game/app area - and be
> sure
> > > > > it's
> > > > > fixed - why not just provide an easy way of doing so? Currently, it
> > > > > seems
> > > > > that - apart from preventing auto orientation change, iOS is the
> only
> > > > > platform providing this (through viewport tricks, event stealing,
> etc.)
> > > > > and
> > > > > IE is getting there.
> > > >
> > > >
> > > >
> > > > Wouldn't this result in black top/bottom or left/right edges on most
> > > > screens? Isn't this fairly undesirable in most cases?
> > >
> > >
> > >
> > >
> > > Please see my postscript that seemed to have been deleted from the
> reply:
> > > "PS Yes, I know there will be differences in aspect ratio - but this
> > > *could* be fixed either by just enforcing one of the sizes (width or
> height)
> > > or by simply having empty black space around."
> >
> >
> >
> > Sure, but I think my question still stands. Is there really a time
> > when the black frame behavior is desirable?
> >
> > I don't really understand how the "enforce one of the sizes" would
> > work. Can you explain?
> >
> > > > Also, I wonder if this wouldn't be better solved using CSS somehow.
> > > > I.e. to be able to say that you want a window to be scaled to a
> > > > certain aspect ratio. In particular, this seems like something that
> > > > web page authors would want access to, which means that sticking this
> > > > feature in an application manifest isn't a good solution.
> > >
> > >
> > >
> > > Well - that is true. However, none of the browser vendors seem to have
> made
> > > their browsers ready
> > > for simple apps and games with this little thing just yet.
> >
> >
> >
> > I don't think that browsers are more willing to implement a features
> > such as this just because it's proposed as part of the manifest as
> > opposed to as part of CSS. My experience is that browser developers
> > are more willing to implement well designed features, even if they are
> > a bit more work to implement.
> >
> > > Of course, there might be a larger push for it
> > > as the whole industry now seems to converge on HTML(5) for
> RealApps(TM).
> >
>
> Maybe the @viewport CSS rule could help…
> http://dev.w3.org/csswg/css-device-adapt/#the-atviewport-rule
>
> Random thought (and possibly a crappy hack…but): I'm wondering if one
> could use something like the full screen API to achieve what you are
> describing?
> https://developer.mozilla.org/en-US/docs/DOM/Using_fullscreen_mode
>
> You could fullscreen an HTML element based on a virtual viewport size,
> then adjust an element inside that to fit. Didn't try it, but you never
> know; might work.
>

I will try to do some more experimentation.  However, it seems odd to me
that this should (still) be so hard.

Including www-style to see if someone there can tell me if it's already
possible, a good idea for simplifying development ... or just me being
silly ;)

To quote the relevant part from the thread:

*****
Like it's possible via tricks on iPad now - by giving a list of
min/max/initial scales = 1 and width="my desired virtual pixel width"
in the viewport meta tag. Combining this with some touch/mouse event
stealing surface will *almost* get you what you need:

A plain and simple:  "give me a game surface to put objects on with this
width (and width/height ratio) - and don't try to think
you know what else I want"

For avg joe developers, it would be nice with a simple:
 viewport="width=640, height=480, fit-to-screen=true, keep-aspect=true,
user-scalable=no, panning=off"
(could be made even more simple)

******

br
Lars


>
> --
> Marcos Caceres
>
> http://datadriven.com.au
>
>
>

Received on Friday, 22 February 2013 15:53:47 UTC