Skip to content

[W3C] Remove text/javascript from cookie script tag declaration #39982

Open
@bhennesAdv

Description

@bhennesAdv

Preconditions and environment

  • Magento version : 2.4.7-p6
  • Anything else that would help a developer reproduce the bug : Standard instance/All frontend pages

Affected template : https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/Theme/view/frontend/templates/js/cookie_status.phtml

Steps to reproduce

If you load the homepage, or any other frontend page, you will have the following tag :

<script type="text/javascript">document.querySelector("#cookie-status").style.display = "none";</script>

According to W3C for some time now, adding text/javascript to script tag is unnecessary and will trigger a warning :
The type attribute is unnecessary for JavaScript resources.

Expected result

Same tag should be present without the text/javascript type attribute

<script>document.querySelector("#cookie-status").style.display = "none";</script>

Actual result

See steps to reproduce

Additional information

This is not really an issue, only an improvement of generated code quality.
If there is a reason why type is set on this tag and not elsewhere, please let me know

Release note

No response

Triage and priority

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue: ready for confirmationReported on 2.4.7Indicates original Magento version for the Issue report.Triage: Dev.ExperienceIssue related to Developer Experience and needs help with Triage to Confirm or Reject it

    Type

    No type

    Projects

    Status

    Ready for Confirmation

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions