Skip to content

Styles aren't applied for root svg element #52

@juusee

Description

@juusee

Tested in Firefox 63.0.3.

Settings styles this way in function onloadFunc won't work:

if (svg) {
   svg.setAttribute("aria-hidden", "true");
   svg.style.position = "absolute";
   svg.style.width = 0;
   svg.style.height = 0;
   svg.style.overflow = "hidden";
   body.insertBefore(svg, body.firstChild);
}

Function insertBefore drops the styles from the element so to apply styles for this element they have to be set after inserting the element in dom:

if (svg) {
   svg.setAttribute("aria-hidden", "true");
   var insertedSvg = body.insertBefore(svg, body.firstChild);
   insertedSvg.style.position = "absolute";
   insertedSvg.style.width = 0;
   insertedSvg.style.height = 0;
   insertedSvg.style.overflow = "hidden";
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions