Re: [mediaqueries] scripting

> On Feb 10, 2016, at 10:09, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
> 
> On Sun, Feb 7, 2016 at 7:03 PM, Florian Rivoal <florian@rivoal.net> wrote:
>>> On Feb 6, 2016, at 04:03, fantasai <fantasai.lists@inkedblade.net> wrote:
>>> # scripting:
>>> #   enabled
>>> #     Indicates that the user agent supports scripting of the page and
>>> #     that support is active for the current document.
>>> #   initial-only
>>> #     Indicates that scripting is enabled during the initial page load,
>>> #     but is not supported afterwards. Examples are printed pages, or
>>> #     pre-rendering network proxies that render a page on a server and
>>> #     send a nearly-static version of the page to the user.
>>> #   none
>>> #     Indicates that the user agent will not run scripts for this document;
>>> #     either it doesn’t support a scripting language, or the support isn’t
>>> #     active for the current document.
>>> 
>>> I'm wondering if what you actually mean here is more like
>>> 
>>> scripting: none | onload | interact
>>> 
>>> ?
>>> 
>>> Or does 'initial-only' not fire onload events, either?
>> 
>> I don't think 'initial-only' was attempting to be specific about exactly
>> at what point scripts stop running, but just generally capturing the idea
>> that at first they run, but eventually that stops. Maybe we can be explicit
>> that this means going at least as far as firing the onload events?
> 
> We're intentionally vague here, and I don't think there's much value
> in being more specific.  The intention seems relatively clear, and
> regardless of precisely when script stops being run, it still matches
> the intention of "initial-only".
> 
> (Theoretically something could, say, run scripts for the first 60s
> then stop, which would be semantically between the two.  But such a UA
> doesn't exist and would be pretty silly, so I'm happy to ignore the
> possibility.)

Right. I don't think we should pin down exactly how long the scripts run,
since there are too many possible variants. But maybe we can set a minimum
threshold, so that authors have something to depend on. Can they depend
on the onload even firing if @scripting: initial-only is true, or is there
a risk that a UA which runs synchronous scripts as they get parsed but
never fires any event would still match?

As for running scripts for up to 60 seconds, I don't know of any UA that
does that, but I think Opera mini has a complicated set of rules that boil
down to a bound around 5 seconds. But that's still past the onload event, so
it should still qualify as initial-only.

>> As for renaming enabled to interact, I am not sure. I am not overly fond
>> of "enabled". However, if you consider a device that doesn't have any input
>> mechanism (e.g. digital signage) but still runs scripts forever, it doesn't
>> sound interactive to me, but it is "script enabled". Any better idea? "full"?
> 
> Yes, "interaction" is only a subset of the things that a live script
> might be doing.  I don't think it captures the intent well.
> 
> "enabled" works reasonably, I think, because it answers "is scripting
> enabled?", which is a real question using reasonable wording.
> 
> ~TJ

Received on Wednesday, 10 February 2016 03:14:22 UTC