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

Fixed Issue #106812

Details

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

Sign in to watch or report this issue.

Steps to reproduce

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

URL:

Repro Steps:

  1. Paste the following code in a webpage:
    <!doctype html>
    <html>
    <head>
    <script type="text/javascript">
    function onload() {
    var videoElement = document.createElement(‘video’);
    var rect = videoElement.getBoundingClientRect(); // Causes error!
    }
    </script>
    </head>
    <body onload="onload()">
    </body>
    </html>
  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:

Attachments

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” to “Fixed”

      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