Skip to content

Ensure that Javascript doesn't change the DOM after page render without user interaction #282

@alaroia-cfa

Description

@alaroia-cfa

Honeycrisp components, such as reveals, accordions, and file upload buttons, are modified by Javascript after a page is rendered. This causes layout jank, in which the page is rendered and then after a brief moment changes it's visible contents, modifying the layout. It also causes flakiness in javascript-enabled feature specs that access these pages.

Current setup

Javascript, on page load, adds classes to DOM elements, causing existing CSS to hide those elements.

Proposed setup

A minimal amount of javascript is executed before the page finishes loading, which adds a special "js-enabled" class to the body or html element (because they will exist before the page finishes loading), and the CSS to hide elements will be scoped within ".js-enabled".

Sample HTML & JS: https://jsbin.com/nequnegaci/1/edit?html,output

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions