Re: [mediaqueries4] does script MQ react to changes?

On Mon, Nov 4, 2013 at 10:27 AM, David Newton <david@davidnewton.ca> wrote:
> The Editor’s Draft for MQ Level 4 says about `script`:
>
>> The ‘script’ media feature is used to query whether ECMAscript is supported on the current document. If the user agent supports ECMAscript, and that support is active for the current document the value must be 1. Otherwise, the value must be 0.
>
> Given the “support is active” requirement, will the value of `script` respond to changes in the browser, the same way a `min-width` query will respond to viewport changes? If so, what would trigger the change?

Media Queries, as used in CSS, are declarative. They do indeed change
value when the thing they're based on changes.

The only way for (script) to change dynamically is if the browser
offers the user a way to disable JS, as I believe FF does.  In that
case, the user toggling it while the page is active would change the
value.  (Assuming that the browser live-updates the liveness of
scripts on the page.  It might require a page refresh instead, so that
scripts which assume they were being run in a live environment, as
they were encountered, don't break.  In that case, the value of
(script) for the page would likewise

> Would it change from 1 to 0 if a script breaks/errors out? Presumably not, because there might be other scripts that are still functional.

Nope, script is still running in that case.

> Would it change if a user disables JavaScript while viewing a page? Current behaviour suggests that JavaScript would continue to be enabled until the user reloads the page, so again, presumably not.

Depends entirely on browser behavior, as I described above.

~TJ

Received on Monday, 4 November 2013 18:51:17 UTC