<?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>138033</bug_id>
          
          <creation_ts>2014-10-23 17:39:15 -0700</creation_ts>
          <short_desc>Safari 8: REGRESSION: getBoundingClientRect on elements inside an SVG with non-default viewBox returns incorrect values</short_desc>
          <delta_ts>2022-09-03 11:15:54 -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>CSS</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>Other</op_sys>
          <bug_status>REOPENED</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar, Regression, SVGHitList</keywords>
          <priority>P3</priority>
          <bug_severity>Major</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Reza">mmfrezabakhshi</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>ap</cc>
    
    <cc>bfulgham</cc>
    
    <cc>dino</cc>
    
    <cc>jonlee</cc>
    
    <cc>mmfrezabakhshi</cc>
    
    <cc>rniwa</cc>
    
    <cc>sabouhallawa</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>zalan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1043893</commentid>
    <comment_count>0</comment_count>
      <attachid>240380</attachid>
    <who name="Reza">mmfrezabakhshi</who>
    <bug_when>2014-10-23 17:39:15 -0700</bug_when>
    <thetext>Created attachment 240380
minimal html page

in the attached html page there are two similar SVG elements, one is zoomed (by setting its viewbox set to 4 times the size of actual svg) and the other one normal (its viewbox the same size as the SVG).
the RECT element inside &quot;zoomed&quot; SVG reports its &quot;getBoundingClientRect&quot; the same as the &quot;normal&quot; one despite the fact that the are in different locations on relative to the page.

they both report &quot;111&quot; as their &quot;left&quot; which is &quot;100 translate + 1pixel border of SVG + 9px padding of body + 1px border of body).

the expected value for the zoomed one is 61 which is:
   100/2 = 50 pixel position of RECT inside SVG
   1px border size of SVG
   9px padding of body
   1px border of body

which makes it 61px.

this also results in wrong behaviour of Safari websinpector! if you hover the mouse over RECT in zoomed SVG in &quot;elements&quot; panel of webinspector to highlight the actual element, it displays a wrong spot on the page.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1043911</commentid>
    <comment_count>1</comment_count>
    <who name="Reza">mmfrezabakhshi</who>
    <bug_when>2014-10-23 18:59:21 -0700</bug_when>
    <thetext>This was working fine in previous versions</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1183535</commentid>
    <comment_count>2</comment_count>
    <who name="Jon Lee">jonlee</who>
    <bug_when>2016-04-13 14:18:27 -0700</bug_when>
    <thetext>Using STP, looks like this is fixed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1183617</commentid>
    <comment_count>3</comment_count>
    <who name="Jon Lee">jonlee</who>
    <bug_when>2016-04-13 20:03:06 -0700</bug_when>
    <thetext>Reopening. Said mentioned that it was inconsistent with Firefox (which doesn&apos;t include the border), but consistent with Chrome (which does).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1183619</commentid>
    <comment_count>4</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2016-04-13 20:05:41 -0700</bug_when>
    <thetext>&lt;rdar://problem/25719216&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1896047</commentid>
    <comment_count>5</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-09-03 11:15:38 -0700</bug_when>
    <thetext>I am able to reproduce this bug in Safari 15.6.1 on macOS 12.5.1 using attached test case and it shows following compared to other browsers:

*** Safari 15.6.1 on macOS 12.5.1 ***

rectangle in zoomed SVG has left =  – 61 (Negative for some reasons - Either I am confusing UI or it is negative)
rectangle in normal SVG has left =  – 111 (Negative for some reasons - Either I am confusing UI or it is negative)

*** Chrome Canary 107 &amp; Firefox Nightly 106 ***

rectangle in zoomed SVG has left =  61
rectangle in normal SVG has left =  111

_______

Just wanted to share updated results. Thanks!</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>240380</attachid>
            <date>2014-10-23 17:39:15 -0700</date>
            <delta_ts>2014-10-23 17:39:15 -0700</delta_ts>
            <desc>minimal html page</desc>
            <filename>index.html</filename>
            <type>text/html</type>
            <size>1271</size>
            <attacher name="Reza">mmfrezabakhshi</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIEhUTUw+Cgo8aHRtbD4KCTxoZWFkPgoJCQk8bWV0YSBuYW1lPSJhcHBsZS1tb2Jp
bGUtd2ViLWFwcC1jYXBhYmxlIiBjb250ZW50PSJ5ZXMiLz4KCQk8bWV0YSBuYW1lPSJhcHBsZS1t
b2JpbGUtd2ViLXN0YXR1cy1iYXItc3R5bGUiIGNvbnRlbnQ9ImJsYWNrIi8+CgkJPG1ldGEgbmFt
ZT0idmlld3BvcnQiIGNvbnRlbnQ9IndpZHRoID0gZGV2aWNlLXdpZHRoLCBoZWlnaHQgPSBkZXZp
Y2UtaGVpZ2h0LCB1c2VyLXNjYWxhYmxlPW5vLCBpbml0aWFsLXNjYWxlPTEuMCIvPgoJPHRpdGxl
PnRlc3QgY2xpY2tzPC90aXRsZT4KCQk8c3R5bGU+CgkJCWh0bWwsYm9keXsKCQkJCW1hcmdpbjow
OwoJCQl9CgkJCWh0bWx7CgkJCQlwYWRkaW5nOjA7CgkJCX0KCQkJYm9keXsKCQkJCWJvcmRlcjpz
b2xpZCAxcHggYmx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