<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>197042</bug_id>
          
          <creation_ts>2019-04-17 16:54:50 -0700</creation_ts>
          <short_desc>Range.getBoundingClientRect returns invalid bounds when between two non-editable nodes</short_desc>
          <delta_ts>2026-01-28 17:41:53 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>DOM</component>
          <version>Safari Technology Preview</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>macOS 10.14</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=196380</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Shrey Banga">shrey</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>ap</cc>
    
    <cc>bfulgham</cc>
    
    <cc>karlcow</cc>
    
    <cc>megan_gardner</cc>
    
    <cc>rniwa</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>wenson_hsieh</cc>
    
    <cc>zalan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1528340</commentid>
    <comment_count>0</comment_count>
      <attachid>367698</attachid>
    <who name="Shrey Banga">shrey</who>
    <bug_when>2019-04-17 16:54:50 -0700</bug_when>
    <thetext>Created attachment 367698
You can open it in Safari and look at the console log to see the bug

I have attached a test case where you can see this in the console log, but also copying the description from the Chrome bug (#953977) I filed for this:

Steps to reproduce the problem:
1. Create a contenteditable=true node
2. Add two nodes inside it with contenteditable=false
3. Position a Range between these two programmatically or by clicking between them
4. Call getBoundingClientRect() on the current range

What is the expected behavior?
This should return the same bounds as it would if the two adjacent nodes were editable.

What went wrong?
This currently returns a DOMRect with everything zero-ed out:

bottom: 0
height: 0
left: 0
right: 0
top: 0
width: 0
x: 0
y: 0

Did this work before? No</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1528465</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2019-04-18 09:23:50 -0700</bug_when>
    <thetext>&lt;rdar://problem/50017853&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1890093</commentid>
    <comment_count>2</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-08-09 13:58:13 -0700</bug_when>
    <thetext>I am able to reproduce this bug in Safari 15.6 on macOS 12.5 and get following using attached test case and looking into Console:

&gt;&gt;&gt; DOMRect
bottom: 0
height: 0
left: 0
right: 0
top: 0
width: 0
x: 0
y: 0

In other browsers, I get following:

*** Chrome Canary 106 ***

Same as Safari 15.6

*** Firefox Nightly 105 ***

bottom: 8
height: 0
left: 8
right: 8
top: 8
width: 0
x: 8
y: 8

_______

I am not sure on web-spec but just wanted to update latest test results. Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2176028</commentid>
    <comment_count>3</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2026-01-28 17:41:53 -0800</bug_when>
    <thetext>This is a duplicate of Bug 54813 I believe</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>367698</attachid>
            <date>2019-04-17 16:54:50 -0700</date>
            <delta_ts>2019-04-17 16:54:50 -0700</delta_ts>
            <desc>You can open it in Safari and look at the console log to see the bug</desc>
            <filename>getBoundingClientRect-bug.html</filename>
            <type>text/html</type>
            <size>454</size>
            <attacher name="Shrey Banga">shrey</attacher>
            
              <data encoding="base64">PGh0bWw+Cjxib2R5PgogICAgPGRpdiBjb250ZW50ZWRpdGFibGU9InRydWUiPgogICAgICAgIDxz
cGFuIGNvbnRlbnRlZGl0YWJsZT0iZmFsc2UiPkE8L3NwYW4+CiAgICAgICAgPHNwYW4gY29udGVu
dGVkaXRhYmxlPSJmYWxzZSI+Qjwvc3Bhbj4KICAgIDwvZGl2Pgo8L2JvZHk+CjxzY3JpcHQgdHlw
ZT0idGV4dC9qYXZhc2NyaXB0Ij4KICAgIGNvbnN0IGNvbnRhaW5lciA9IGRvY3VtZW50LmJvZHku
Zmlyc3RDaGlsZDsKCiAgICAvLyBDcmVhdGUgYSByYW5nZSBiZXR3ZWVuIEEgYW5kIEIKICAgIGNv
bnN0IHJhbmdlID0gZG9jdW1lbnQuY3JlYXRlUmFuZ2UoKTsKICAgIHJhbmdlLnNldFN0YXJ0KGNv
bnRhaW5lciwgMSk7CiAgICByYW5nZS5zZXRFbmQoY29udGFpbmVyLCAxKTsKCiAgICBjb25zb2xl
LmxvZyhyYW5nZS5nZXRCb3VuZGluZ0NsaWVudFJlY3QoKSk7Cjwvc2NyaXB0Pgo8L2h0bWw+Cg==
</data>

          </attachment>
      

    </bug>

</bugzilla>