Skip to content

[mediaqueries][mediaqueries-5] should 'initial-only' have an explicit minimum threshold? #503

Open

Description

@tantek

https://drafts.csswg.org/mediaqueries-5/#scripting

Formerly "Issue 4" inline in the spec, brought here to capture and discuss:

"
Should there be an explicit minimum threshold to meet before a UA is allowed to claim initial-only? Having one would mean authors would know what they can depend on, and could tailor their scripts accordingly. On the other hand, pinpointing that threshold is difficult: if it is set too low, the scripting facilities that authors can depend on may be to constrained to be practical, even though actual UAs may potentially all support significantly more. But trying to set it higher may cause us to exclude UAs that do support scripting at loading time, but restrict it in some cases based on complex heuristics. For instance, conservative definitions likely include at least running all inline scripts and firing the DOMContentLoaded event. But it does not seem useful for authors to constrain themselves to this if most (or maybe all) initial-only UAs also load external scripts (including async and defer) and fire the load event. On the other hand, requiring external scripts to be loaded and the load event to be fired could exclude UAs like Opera mini, which typically do run them, but may decide not to based on timeouts and other heuristics.
"

Feel free to adjust issue name/title and "[...]" labels according to where this feature ends up. Thanks!

Activity

  1. self-assigned this
    on May 5, 2017
  2. changed the title [-][mediaqueries][mediaqueries-4][mediaqueries-5] should 'initial-only' have an explicit minimum threshold?[/-] [+][mediaqueries][mediaqueries-5] should 'initial-only' have an explicit minimum threshold?[/+] on Jun 15, 2017
  3. takenspc commented on Jul 22, 2020

    @takenspc

    I believe (scripting: initial-only) overlaps update media feature and latter one is more generic as typical printed pages don't support both CSS and JavaScript updates (transitions, animations and so on). UAs like Opera Mini update pages in some conditions so that (update: slow) can be used.

    So, I propose that

    • drop initial-only from scripting media feature
    • suggest using (update: none) for printed pages
    • suggest using (update: slow) for UAs like Opera Mini

    Though I believe that update media feature covers (scripting: initial-only) uses cases, please let me know if I missed something.

  4. frivoal commented on Jul 24, 2020

    @frivoal
    Collaborator

    Hmmm. update and script seem somewhat correlated, but I don't think the relationship is strong enough to have one fully replace the other:

    • An opera-mini like product could definitely have initial-only scripts run on the server, then send the results to the device, with the device still having full capabilities for smooth scrolling and (declarative) animations / transitions.

    • A user many have completely turned JS off, but their browser would still have full support for declarative animations / transitions.

    • e-ink viewers would generally fit into update:slow, but they could fall anywhere in terms of scripting.

  5. takenspc commented on Jul 26, 2020

    @takenspc

    Thank you for your explanation and I feel like I'm not expressing myself correctly. I'm not against scripting media feature. Instead, I would like to use this for a few kinds of content. Replacing scripting with update is not my intention.

    An opera-mini like product could definitely have initial-only scripts run on the server, then send the results to the device, with the device still having full capabilities for smooth scrolling and (declarative) animations / transitions.

    I misunderstood behaviors of Opera Mini. I understand why we can't drop initial-only though specifying initial-only precisely seems hard.

    A user many have completely turned JS off, but their browser would still have full support for declarative animations / transitions.

    Yes, we can use (update: fast) and (scripting: none) for that.

    e-ink viewers would generally fit into update:slow, but they could fall anywhere in terms of scripting.

    Yes, we can use (update: slow) and (scripting: ...) for that.

  6. frivoal commented on Jul 28, 2020

    @frivoal
    Collaborator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions