<?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>14054</bug_id>
          
          <creation_ts>2007-06-09 19:00:25 -0700</creation_ts>
          <short_desc>REGRESSION: cupid.com uses iframe.document to make content visible</short_desc>
          <delta_ts>2007-08-30 15:44:02 -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>Evangelism</component>
          <version>523.x (Safari 3)</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.4</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://www.cupid.com/membership.aspx?pagename=A1&amp;pagemode=output</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>Regression</keywords>
          <priority>P1</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="David Kilzer (:ddkilzer)">ddkilzer</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>dstorey</cc>
    
    <cc>jennifer</cc>
    
    <cc>markmalone</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>8031</commentid>
    <comment_count>0</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2007-06-09 19:00:25 -0700</bug_when>
    <thetext>* SUMMARY
Some pages on cupid.com (which was recently redesigned) uses the iframe.document property to resize iframe elements to make content visible.

* STEPS TO REPRODUCE
1. Open Safari/WebKit.
2. Go to URL:  http://www.cupid.com/membership.aspx?pagename=A1&amp;pagemode=output

* EXPECTED RESULTS
The full content of the page should be visible.

* ACTUAL RESULTS
The content in the center of the page is cut off.

* REGRESSION
This is a regression from shipping Safari 2.0.4 (419.3) on Mac OS X 10.4.9 (8P135) which works when loading the page.  A local debug build of WebKit r22080 reproduces the bug.

* NOTES
I&apos;m assuming this will be an evangelism bug since the iframe.document property is unsupported.

The calcHeight() function on that page clearly needs to be updated to work with a nightly WebKit.

The iframe.document property was removed in r21651 for &lt;rdar://problem/5215830&gt;.

http://trac.webkit.org/projects/webkit/changeset/21651</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>8030</commentid>
    <comment_count>1</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2007-06-09 19:01:26 -0700</bug_when>
    <thetext>Note that this doesn&apos;t work on Opera 9.10, either.

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>8028</commentid>
    <comment_count>2</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2007-06-09 19:03:32 -0700</bug_when>
    <thetext>JavaScript console error:

Undefined value
http://www.cupid.com/membership.aspx?pagename=A1&amp;pagemode=output
Line: 21

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>8029</commentid>
    <comment_count>3</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2007-06-09 19:19:01 -0700</bug_when>
    <thetext>I just sent a note to cupid.com customer support regarding this issue.

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>4872</commentid>
    <comment_count>4</comment_count>
    <who name="Jen">jennifer</who>
    <bug_when>2007-07-13 12:14:23 -0700</bug_when>
    <thetext>Hi,
I&apos;m a developer for Cupid.com, and I have started to work on this issue. I tried using the &quot;ownerDocument&quot; property, but the page heights still aren&apos;t calculating correctly. They keep getting longer and longer as I click on different pages, no matter what height they&apos;re supposed to be. The same code in Opera 9.10 works better; but sometimes it cuts off the very bottom of long pages. Would it be possible for you to look at my code and see if I&apos;m doing anything wrong here; I&apos;m not very familiar with Macs and doing a Google search on this topic didn&apos;t help me much. Here is the block of code that I added for the WebKit and Opera browsers:
if (userAgent.indexOf(&apos;applewebkit/522+&apos;) != -1 || userAgent.indexOf(&apos;opera/9.10&apos;) != -1) 
{
   var the_height= document.getElementById     (&quot;iframe&quot;).ownerDocument.body.offsetHeight;
   //change the height of the iframe
   document.getElementById(&quot;iframe&quot;).height = (the_height);
   document.getElementById(&quot;mainBody&quot;).height = (the_height + 50);
}	

Thanks,
-Jen</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>4859</commentid>
    <comment_count>5</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2007-07-13 14:45:45 -0700</bug_when>
    <thetext>(In reply to comment #4)
&gt; if (userAgent.indexOf(&apos;applewebkit/522+&apos;) != -1 ||
&gt; userAgent.indexOf(&apos;opera/9.10&apos;) != -1) 

Please consider using &quot;object detection&quot; instead of user agent sniffing here:

if (document.getElementById(&quot;iframe&quot;).ownerDocument)

For more info about this technique see:

http://developer.apple.com/internet/webcontent/objectdetection.html

&gt; {
&gt;    var the_height= document.getElementById(&quot;iframe&quot;).ownerDocument.body.offsetHeight;
&gt;    //change the height of the iframe
&gt;    document.getElementById(&quot;iframe&quot;).height = (the_height);
&gt;    document.getElementById(&quot;mainBody&quot;).height = (the_height + 50);
&gt; }       

I think you may want to use &quot;.style.height&quot; instead of simply &quot;.height&quot; here.  Does that make any difference in rendering?

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>4567</commentid>
    <comment_count>6</comment_count>
    <who name="Jen">jennifer</who>
    <bug_when>2007-07-16 12:35:31 -0700</bug_when>
    <thetext>I changed the code to use &quot;object detection&quot; and &quot;.style.height&quot;, and our development site now works with Safari/WebKit. We will launch the changes to production within the next few weeks.

I still couldn&apos;t get our site to work with Opera, however. I&apos;ll continue looking into that.

Thanks for your help,
-Jen</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>4572</commentid>
    <comment_count>7</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2007-07-16 13:10:54 -0700</bug_when>
    <thetext>(In reply to comment #6)
&gt; I still couldn&apos;t get our site to work with Opera, however. I&apos;ll continue
&gt; looking into that.

Please contact David Storey &lt;david.storey@opera.com&gt; for further assistance with Opera.

Glad we could help!

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1129</commentid>
    <comment_count>8</comment_count>
    <who name="Sam Weinig">sam</who>
    <bug_when>2007-08-30 15:44:02 -0700</bug_when>
    <thetext>The site has been fixed.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>