<?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>20454</bug_id>
          
          <creation_ts>2008-08-19 16:20:25 -0700</creation_ts>
          <short_desc>getPropertyValue() for clip returns wrong value</short_desc>
          <delta_ts>2022-07-27 17:57:38 -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>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>CONFIGURATION CHANGED</resolution>
          
          
          <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="Garrett Smith">xk1t</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>ap</cc>
    
    <cc>bdakin</cc>
    
    <cc>bfulgham</cc>
    
    <cc>jeffery.to</cc>
    
    <cc>michael.c.petrovich</cc>
    
    <cc>rniwa</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>syoichi</cc>
    
    <cc>tabatkins</cc>
    
    <cc>zalan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>88861</commentid>
    <comment_count>0</comment_count>
    <who name="Garrett Smith">xk1t</who>
    <bug_when>2008-08-19 16:20:25 -0700</bug_when>
    <thetext>When reading clip value using getComputedValue, the wrong value is returned. 

The clip value should be returned, but instead, if the element is not clipped, all 0&apos;s are returned.

See also: Bug 17433</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88862</commentid>
    <comment_count>1</comment_count>
      <attachid>22884</attachid>
    <who name="Garrett Smith">xk1t</who>
    <bug_when>2008-08-19 16:20:51 -0700</bug_when>
    <thetext>Created attachment 22884
Testcase showing problem</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88866</commentid>
    <comment_count>2</comment_count>
    <who name="Mark Rowe (bdash)">mrowe</who>
    <bug_when>2008-08-19 16:28:52 -0700</bug_when>
    <thetext>&lt;rdar://problem/6160816&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>441583</commentid>
    <comment_count>3</comment_count>
    <who name="Jeffery To">jeffery.to</who>
    <bug_when>2011-07-25 01:10:01 -0700</bug_when>
    <thetext>Can someone have a look at this bug? As it stands, it is impossible to tell (from JavaScript) whether an element is visible or completely clipped.

Currently, when an element has no &quot;clip&quot; CSS declaration, getComputedStyle correctly returns &quot;auto&quot;. (&quot;auto&quot; meaning the element is not clipped)

But when an element has &quot;clip: auto&quot; or &quot;clip: rect(auto, auto, auto, auto)&quot;, getComputedStyle returns &quot;rect(0px 0px 0px 0px)&quot;. This is a valid clip value, but this value means the element is completely clipped.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>442068</commentid>
    <comment_count>4</comment_count>
    <who name="Jeffery To">jeffery.to</who>
    <bug_when>2011-07-25 19:12:50 -0700</bug_when>
    <thetext>In other words, when I get &quot;rect(0px 0px 0px 0px)&quot; from getComputedStyle, I can&apos;t tell if the clip value is actually &quot;auto&quot; and the element is visible, or if the clip value is &quot;rect(0px 0px 0px 0px)&quot; and the element is completely clipped.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>442098</commentid>
    <comment_count>5</comment_count>
    <who name="Garrett Smith">xk1t</who>
    <bug_when>2011-07-25 21:24:53 -0700</bug_when>
    <thetext>(In reply to comment #4)
&gt; In other words, when I get &quot;rect(0px 0px 0px 0px)&quot; from getComputedStyle, I can&apos;t tell if the clip value is actually &quot;auto&quot; and the element is visible, or if the clip value is &quot;rect(0px 0px 0px 0px)&quot; and the element is completely clipped.

That was what they called a &quot;fix&quot; for bug 17433. See bug 17433 comment 2. The problem is demonstrated in this bug, to attachment 22884.

What Gecko does is to return &quot;auto&quot; which is different than a rect value, but the CSS 2.1 spec specifies a rect value. This makes sense and fortunately now too does CSS 2.1, which standardizes this behavior.

| Computed value:  &apos;auto&apos; if specified as &apos;auto&apos;, 
| otherwise a rectangle with four values, each of 
| which is &apos;auto&apos; if specified as &apos;auto&apos; and the 
| computed length otherwise</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>442102</commentid>
    <comment_count>6</comment_count>
    <who name="Garrett Smith">xk1t</who>
    <bug_when>2011-07-25 21:28:00 -0700</bug_when>
    <thetext>(In reply to comment #5)
&gt; (In reply to comment #4)
&gt; &gt; In other words, when I get &quot;rect(0px 0px 0px 0px)&quot; from getComputedStyle, I can&apos;t tell if the clip value is actually &quot;auto&quot; and the element is visible, or if the clip value is &quot;rect(0px 0px 0px 0px)&quot; and the element is completely clipped.
&gt; 
&gt; That was what they called a &quot;fix&quot; for bug 17433. See bug 17433 comment 2. The problem is demonstrated in this bug, to attachment 22884 [details].
&gt; 
&gt; What Gecko does is to return &quot;auto&quot; which is different than a rect value, but the CSS 2.1 spec specifies a rect value. 

Correction: previous version of CSS 2.1 specified that clip computed style must be a rect. The current version of CSS 2.1 matches what Gecko does and returns &quot;auto&quot; when clip is &quot;auto&quot;. Again:
&gt; 
&gt; | Computed value:  &apos;auto&apos; if specified as &apos;auto&apos;, 
&gt; | otherwise a rectangle with four values, each of 
&gt; | which is &apos;auto&apos; if specified as &apos;auto&apos; and the 
&gt; | computed length otherwise</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>797299</commentid>
    <comment_count>7</comment_count>
    <who name="Mike Petrovich">michael.c.petrovich</who>
    <bug_when>2012-12-26 06:41:05 -0800</bug_when>
    <thetext>We&apos;re rewriting a lot of core effects in jQuery UI to use the CSS clip property, and being able to differentiate between &quot;clip: rect(auto, auto, auto, auto)&quot; and &quot;clip: rect(0px, 0px, 0px, 0px)&quot; is needed for a complete and correct implementation with Webkit browsers.

Has there been any progress towards a resolution or workaround for this issue?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1887092</commentid>
    <comment_count>8</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-07-27 10:08:44 -0700</bug_when>
    <thetext>I am unable to reproduce this bug using attached test case in Safari 15.6 on macOS 12.5 and it shows &quot;green background&quot; on text with blue border and I zoomed into find any clipping but I was not able to find. Also it matches with other browsers (Chrome Canary 106 and Firefox Nightly 105). I think this can be marked as &quot;RESOLVED CONFIGURATION CHANGED&quot;. Thanks!</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>22884</attachid>
            <date>2008-08-19 16:20:51 -0700</date>
            <delta_ts>2008-08-19 16:20:51 -0700</delta_ts>
            <desc>Testcase showing problem</desc>
            <filename>clip2.html</filename>
            <type>text/html</type>
            <size>901</size>
            <attacher name="Garrett Smith">xk1t</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIEhUTUwgUFVCTElDICItLy9XM0MvL0RURCBIVE1MIDQuMDEgVHJhbnNpdGlvbmFs
Ly9FTiIKICAgICAgICAiaHR0cDovL3d3dy53My5vcmcvVFIvaHRtbDQvbG9vc2UuZHRkIj4KPGh0
bWwgbGFuZz0iZW4iPgo8aGVhZD4KCTx0aXRsZT5jbGlwIHN0aWxsIGJyb2tlbjwvdGl0bGU+Cjwv
aGVhZD4KPGJvZHk+CjxkaXYgc3R5bGU9J3Bvc2l0aW9uOiBhYnNvbHV0ZTsgYmFja2dyb3VuZDog
IzNmMzsgYm9yZGVyOiAzcHggc29saWQgIzAwOTsgcGFkZGluZzogNHB4Jz4KCVRoaXMgZGl2IHNo
b3VsZCBoYXZlIGEgZ3JlZW4gYmFja2dyb3VuZCB3aXRoIGEgYmx1ZSBib3J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