<?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>31899</bug_id>
          
          <creation_ts>2009-11-25 20:14:27 -0800</creation_ts>
          <short_desc>Can&apos;t combine CSS reflections with CSS perspective -- reflection isn&apos;t generated</short_desc>
          <delta_ts>2009-12-16 12:40:22 -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>CSS</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Mac (Intel)</rep_platform>
          <op_sys>OS X 10.6</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>31885</dup_id>
          
          <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>0</everconfirmed>
          <reporter name="Guillermo Esteves">gfesteves</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>simon.fraser</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>166615</commentid>
    <comment_count>0</comment_count>
      <attachid>43890</attachid>
    <who name="Guillermo Esteves">gfesteves</who>
    <bug_when>2009-11-25 20:14:27 -0800</bug_when>
    <thetext>Created attachment 43890
Test case, with the 3 examples I explained above.

Hello. Please bear with me while I try to explain this, because I&apos;m not sure I can do that clearly enough. 

OVERVIEW:
Basically, what I&apos;m trying to do is something like the interface of an iPod classic: an image, in perspective, with a reflection below it. Like this: http://dl.dropbox.com/u/18226/desired-result.png

STEPS TO REPRODUCE:
What I tried was very simple:

#image1 {
		-webkit-transform: perspective(300) rotateY(10deg);
		-webkit-box-reflect:below 0 -webkit-gradient(linear, left 70%, left bottom, from(rgba(0,0,0,0)), to(rgba(0,0,0,0.5)));
	}

EXPECTED RESULTS:
An image that is tilted in perspective, with a reflection. Like this one: http://dl.dropbox.com/u/18226/desired-result.png

ACTUAL RESULTS:
From my tests, on Mac OS X 10.6.2 with Safari 4.0.4, I can&apos;t get both properties to play nice. I can either use the perspective, or the reflection, but not both at the same time. When I use both properties, I get the perspective, but not the reflection.

ADDITIONAL INFORMATION:
What I tried next was to apply just the reflection, and then apply the perspective after page load, with JavaScript, like so:

#image2 {
		-webkit-box-reflect:below 0 -webkit-gradient(linear, left 70%, left bottom, from(rgba(0,0,0,0)), to(rgba(0,0,0,0.5)));
	}

And on page load, I tried to do document.getElementById(&apos;image2&apos;).style.webkitTransform = &apos;perspective(300) rotateY(10deg)&apos;;

This didn&apos;t work either. Finally, I used the -webkit-transition property so that the perspective is applied slowly:

#image3 {
		-webkit-transition:all 1s linear;
		-webkit-box-reflect:below 0 -webkit-gradient(linear, left 70%, left bottom, from(rgba(0,0,0,0)), to(rgba(0,0,0,0.5)));
	}

And on page load, document.getElementById(&apos;image3&apos;).style.webkitTransform = &apos;perspective(300) rotateY(10deg)&apos;;

This worked! It produced an image that was in perspective, and had a reflection. It seems that the only way to combine a reflection with a 3D transform is to apply the reflection first, and then the perspective, but only if you use -webkit-transition so the perspective is applied slowly. I tested this in Safari 4.0.4; this workaround doesn&apos;t work anymore in WebKit nightly r51397. In the nightly, there doesn&apos;t seem to be a way to use both properties at the same time. I&apos;m uploading an HTML file with the three examples so you can try it out.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>172473</commentid>
    <comment_count>1</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2009-12-16 12:40:22 -0800</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 31885 ***</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>43890</attachid>
            <date>2009-11-25 20:14:27 -0800</date>
            <delta_ts>2009-11-25 20:14:27 -0800</delta_ts>
            <desc>Test case, with the 3 examples I explained above.</desc>
            <filename>test.html</filename>
            <type>text/html</type>
            <size>1107</size>
            <attacher name="Guillermo Esteves">gfesteves</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxodG1sPgo8aGVhZD4KPHN0eWxlIHR5cGU9InRleHQvY3NzIj4KCglp
bWcgewoJCXdpZHRoOjE2MHB4OwoJCW1hcmdpbjoyNXB4OwoJfQoKCSNpbWFnZTEgewoJCS13ZWJr
aXQtdHJhbnNmb3JtOiBwZXJzcGVjdGl2ZSgzMDApIHJvdGF0ZVkoMTBkZWcpOwoJCS13ZWJraXQt
Ym94LXJlZmxlY3Q6YmVsb3cgMCAtd2Via2l0LWdyYWRpZW50KGxpbmVhciwgbGVmdCA3MCUsIGxl
ZnQgYm90dG9tLCBmcm9tKHJnYmEoMCwwLDAsMCkpLCB0byhyZ2JhKDAsMCwwLDAuNSkpKTsKCX0K
CQoJI2ltYWdlMiB7CgkJLXdlYmtpdC1ib3gtcmVmbGVjdDpiZWxvdyAwIC13ZWJraXQtZ3JhZGll
bnQobGluZWFyLCBsZWZ0IDcwJSwgbGVmdCBib3R0b20sIGZyb20ocmdiYSgwLDAsMCwwKSksIHRv
KHJnYmEoMCwwLDAsMC41KSkpOwoJfQoJCgkjaW1hZ2UzIHsKCQktd2Via2l0LXRyYW5zaXRpb246
YWxsIDFzIGxpbmVhcjsKCQktd2Via2l0LWJveC1yZWZsZWN0OmJlbG93IDAgLXdlYmtpdC1ncmFk
aWVudChsaW5lYXIsIGxlZnQgNzAlLCBsZWZ0IGJvdHRvbSwgZnJvbShyZ2JhKDAsMCwwLDApKSwg
dG8ocmdiYSgwLDAsMCwwLjUpKSk7Cgl9CgkKPC9zdHlsZT4KPC9oZWFkPgo8Ym9keSBvbmxvYWQ9
ImRvY3VtZW50LmdldEVsZW1l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