Skip to content

The offsetWidth of a span element is 0. #12939

@veer66

Description

@veer66

offsetWidth obtained by script is 0.

For example, this html page prints 0 to the console.

<!DOCTYPE html>
<html lang="en">
<body>
  <div id="main">
    <span id="span1">Test</span>
  </div>
  <script>
    console.log(document.getElementById("span1").offsetWidth);
  </script>
</body>
</html>

I used Servo commit 9415252 on Ubuntu 16.04.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-content/domInteracting with the DOM from web contentC-assignedThere is someone working on resolving the issueI-wrongAn incorrect behaviour is observed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions