Skip to content

iAPI Router: Styles inside noscript tags are wrongly applied on client-side navigation #70876

@DAreRodz

Description

@DAreRodz

Description

The <style> or <link rel=stylesheet> elements inside <noscript> sections are handled as if they were placed outside and applied to the page after client-side navigation, which is not correct. These elements can be simply ignored, as the Interactivity API doesn't work without JavaScript.

Step-by-step reproduction instructions

  1. Add a block of HTML in a template with a Query Loop block, with a <noscript> element and a <style> tag that changes the body background within. E.g.:
    <noscript><style>body{ background: red !important; }</style></noscript>
  2. Ensure "force page reload" is disabled in the Query Loop block.
  3. Visit a page with the modified template.
  4. Navigate to the next page.
  5. The body background color wrongly changes.

Screenshots, screen recording, code snippet

Recording
Screen.Recording.2025-07-23.at.14.23.10.mov

Environment info

No response

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions