Re: [widgets] Applying Stylesheets to Resources

On Thu, Feb 11, 2010 at 6:57 PM, Doug Schepers <schepers@w3.org> wrote:
> Hi, folks-
>
> I've meant to mention this for a while (a couple years), and it's probably
> too late, but I thought I'd drop it in for future consideration.
>
> One odd part of the separation of content and presentation is that a
> stylesheet is applied to a file by including a link to the stylesheet in the
> target file.  That is totally backward.
>
> It's understandable in the historical context, because the file that was
> being navigated to was the HTML page, and there was no other way to
> associate or allow discovery of other applicable stylesheets.  Widgets,
> because it defines a manifest, could correct this, if the author wants that
> option.
>
> I would like the manifest to add a linking element that points to a
> stylesheet and to its target resource (an HTML or SVG file, say), and says,
> apply this stylesheet to this file.
>
> This would allow the author to reuse and repurpose a target resource without
> touching that file itself.  Mix this with parameters (something we are
> working on in SVG and CSS), and it's a nice model.
>
> Is it possible to add something like this?

Widgets require application of a style-sheet per file, though a global
one would be useful too. Imagine a game widget where each screen
requires its own layout constraints (landscape/portrait/both):

1. index.html: plays a video, so the page must be *locked* to
landscape. When video finishes, the page navigates to menu.html)

2. menu.html (must be locked into portrait, where menu options are
presented. Menu navigates to "game.html")

3. game.html: the background is fixed, but rotation of the device can
affect the layout as you go from portrait to landscape.


-- 
Marcos Caceres
Opera Software ASA, http://www.opera.com/
http://datadriven.com.au

Received on Tuesday, 4 May 2010 12:34:43 UTC