Calling getBoundingClientRect on an HTML Element that has not been Added to the DOM Causes "Unspecified error"

Issue #106812


Apr 27, 2014
This issue is public.
Found in build #
Reported by 0 people

Sign in to watch or report this issue.

Steps to reproduce

URL = http://srvr-clw/bugs/66755/Default.htm


Repro Steps:

  1. Paste the following code in a webpage:
    <!doctype html>
    <script type="text/javascript">
    function onload() {
    var videoElement = document.createElement(‘video’);
    var rect = videoElement.getBoundingClientRect(); // Causes error!
    <body onload="onload()">
  1. Load the page and open the F12 Developer Tools and look at the console.
  2. Notice that getBoundingClientRect throws an exception with a cryptic message.

Expected Results:

No exception but a text rectangle of zero size to be returned.

Actual Results:


0 attachments

    Comments and activity

    • Microsoft Edge Team

      Changed Assigned To to “IPBS P.”

      Changed Assigned To from “IPBS P.” to “Bruce M.”

      Changed Assigned To to “Kamen M.”

      Changed Assigned To from “Kamen M.” to “Christian F.”

      Changed Status to “Confirmed”

      Changed Assigned To from “Christian F.” to “Rahul A.”

      Changed Assigned To from “Rahul A.” to “IPBS P.”

      Changed Status from “Confirmed”

      Changed Assigned To from “IPBS P.” to “Christian F.”

      Changed Steps to Reproduce

    You need to sign in to your Microsoft account to add a comment.

    Sign in