<?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>38394</bug_id>
          
          <creation_ts>2010-04-30 11:11:52 -0700</creation_ts>
          <short_desc>Range.getClientRects should work with a collapsed range in an empty text node</short_desc>
          <delta_ts>2022-07-27 04:00:18 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>HTML Editing</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>OS X 10.5</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ojan Vafai">ojan</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>ap</cc>
    
    <cc>benjamin.sansouci</cc>
    
    <cc>bfulgham</cc>
    
    <cc>mihaip</cc>
    
    <cc>rniwa</cc>
    
    <cc>sam</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>tony</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>219539</commentid>
    <comment_count>0</comment_count>
      <attachid>54813</attachid>
    <who name="Ojan Vafai">ojan</who>
    <bug_when>2010-04-30 11:11:52 -0700</bug_when>
    <thetext>Created attachment 54813
test case

The test case works in Firefox nightlies and as best I can tell, matches the spec: http://www.w3.org/TR/cssom-view/#dom-range-getclientrects.

Personally, I think we should make this case work even without the text node. It matches IE and fits what developers actually want in practice. The pushback it&apos;s gotten has all be that it&apos;s complicated to spec. See: http://lists.w3.org/Archives/Public/www-style/2010Feb/0062.html

In either case, we should start with matching the spec.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1393617</commentid>
    <comment_count>1</comment_count>
    <who name="Benjamin San Souci">benjamin.sansouci</who>
    <bug_when>2018-01-26 12:43:38 -0800</bug_when>
    <thetext>I can repro this bug on safari 11.0.2. And actually I just filed another bug that might be related or be the same bug:
https://bugs.webkit.org/show_bug.cgi?id=182181</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1887030</commentid>
    <comment_count>2</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-07-27 04:00:07 -0700</bug_when>
    <thetext>I am not sure on web-spec but in attached test case, I get following results across all browsers:

*** Safari 15.6 on macOS 12.5 &amp; Chrome Canary 106 ***

No clientRects returned from range.getClientRects()

*** Firefox Nightly 105 ***

top: 21.600006103515625 bottom: 21.600006103515625 left: 8 right: 8 width: 0 height: 0</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>54813</attachid>
            <date>2010-04-30 11:11:52 -0700</date>
            <delta_ts>2010-04-30 11:11:52 -0700</delta_ts>
            <desc>test case</desc>
            <filename>scratch.html</filename>
            <type>text/html</type>
            <size>603</size>
            <attacher name="Ojan Vafai">ojan</attacher>
            
              <data encoding="base64">PGRpdiBjb250ZW50RWRpdGFibGU+PGRpdiBpZD0nYmFyJz48YnI+YTwvZGl2PjwvZGl2Pgo8c2Ny
aXB0Pgp2YXIgYmFyID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoJ2JhcicpOwp2YXIgdGV4dE5v
ZGUgPSBkb2N1bWVudC5jcmVhdGVUZXh0Tm9kZSgnJyk7CmJhci5pbnNlcnRCZWZvcmUodGV4dE5v
ZGUsIGJhci5maXJzdENoaWxkKTsKCnZhciByYW5nZSA9IGRvY3VtZW50LmNyZWF0ZVJhbmdlKCk7
CnJhbmdlLnNldFN0YXJ0KHRleHROb2RlLCAwKTsKcmFuZ2Uuc2V0RW5kKHRleHROb2RlLCAwKTsK
CnZhciByZWN0cyA9IHJhbmdlLmdldENsaWVudFJlY3RzKCk7CnZhciByZWN0ID0gcmVjdHMuaXRl
bSgwKTsKaWYgKHJlY3QpIHsKICAgIGFsZXJ0KCd0b3A6ICcgKyByZWN0LnRvcCArICcgYm90dG9t
OiAnICtyZWN0LmJvdHRvbSArICcgbGVmdDogJyArIHJlY3QubGVmdCArICcgcmlnaHQ6ICcgKyBy
ZWN0LnJpZ2h0ICsgJyB3aWR0aDogJyArcmVjdC53aWR0aCArICcgaGVpZ2h0OiAnICsgcmVjdC5o
ZWlnaHQpOwp9IGVsc2UKICAgIGFsZXJ0KCJObyBjbGllbnRSZWN0cyByZXR1cm5lZCBmcm9tIHJh
bmdlLmdldENsaWVudFJlY3RzKCkiKTsKPC9zY3JpcHQ+
</data>

          </attachment>
      

    </bug>

</bugzilla>