Open Bug 1166581 Opened 8 years ago Updated 4 months ago

Implement the `scripting` media feature from Media Queries Level 5

Categories

(Core :: CSS Parsing and Computation, enhancement)

enhancement

Tracking

()

People

(Reporter: mozilla, Unassigned, Mentored)

References

(Blocks 1 open bug, )

Details

(Keywords: dev-doc-needed)

See Also: → 1171900
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: Implement the `scripting` media feature from Media Queries Level 4 → Implement the `scripting` media feature from Media Queries Level 5

I think this is already implemented, but no statement has been given about its status.

According to the WHATWG spec, the @media (scripting) at-rule controls if <noscript> tags can appear. This is now fully supported in Firefox.

How to check:

  1. Copy-paste the following to the <body> of an HTML document:
<style>
@media not (scripting) {
    .only-js {
        display: none !important;
    }
}
</style>
<div class="only-js">This text will disappear if JavaScript is disabled.</div>
  1. Disable JavaScript through the inspector.
  2. This media argument works if the div disappears.

Sorry, but I forgot to put my navigator.userAgent here: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:100.0) Gecko/20100101 Firefox/100.0.

Nope, the media query scripting actually does not work yet.

Type: defect → enhancement

This should be reasonably straight-forward to implement.

This is what controls noscript behavior: https://searchfox.org/mozilla-central/rev/32ca4fc265150e7d3d7aa6c6abea088768cf024b/dom/base/Document.cpp#3175-3177

We could reasonably enough just call that from the media query code or so. Media queries are implemented here.

Mentor: emilio
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.