RESOLVED FIXED 14054
REGRESSION: cupid.com uses iframe.document to make content visible
https://bugs.webkit.org/show_bug.cgi?id=14054
Summary REGRESSION: cupid.com uses iframe.document to make content visible
David Kilzer (:ddkilzer)
Reported 2007-06-09 19:00:25 PDT
* 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&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'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 <rdar://problem/5215830>. http://trac.webkit.org/projects/webkit/changeset/21651
Attachments
David Kilzer (:ddkilzer)
Comment 1 2007-06-09 19:01:26 PDT
Note that this doesn't work on Opera 9.10, either.
David Kilzer (:ddkilzer)
Comment 2 2007-06-09 19:03:32 PDT
JavaScript console error: Undefined value http://www.cupid.com/membership.aspx?pagename=A1&pagemode=output Line: 21
David Kilzer (:ddkilzer)
Comment 3 2007-06-09 19:19:01 PDT
I just sent a note to cupid.com customer support regarding this issue.
Jen
Comment 4 2007-07-13 12:14:23 PDT
Hi, I'm a developer for Cupid.com, and I have started to work on this issue. I tried using the "ownerDocument" property, but the page heights still aren't calculating correctly. They keep getting longer and longer as I click on different pages, no matter what height they'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'm doing anything wrong here; I'm not very familiar with Macs and doing a Google search on this topic didn't help me much. Here is the block of code that I added for the WebKit and Opera browsers: if (userAgent.indexOf('applewebkit/522+') != -1 || userAgent.indexOf('opera/9.10') != -1) { var the_height= document.getElementById ("iframe").ownerDocument.body.offsetHeight; //change the height of the iframe document.getElementById("iframe").height = (the_height); document.getElementById("mainBody").height = (the_height + 50); } Thanks, -Jen
David Kilzer (:ddkilzer)
Comment 5 2007-07-13 14:45:45 PDT
(In reply to comment #4) > if (userAgent.indexOf('applewebkit/522+') != -1 || > userAgent.indexOf('opera/9.10') != -1) Please consider using "object detection" instead of user agent sniffing here: if (document.getElementById("iframe").ownerDocument) For more info about this technique see: http://developer.apple.com/internet/webcontent/objectdetection.html > { > var the_height= document.getElementById("iframe").ownerDocument.body.offsetHeight; > //change the height of the iframe > document.getElementById("iframe").height = (the_height); > document.getElementById("mainBody").height = (the_height + 50); > } I think you may want to use ".style.height" instead of simply ".height" here. Does that make any difference in rendering?
Jen
Comment 6 2007-07-16 12:35:31 PDT
I changed the code to use "object detection" and ".style.height", and our development site now works with Safari/WebKit. We will launch the changes to production within the next few weeks. I still couldn't get our site to work with Opera, however. I'll continue looking into that. Thanks for your help, -Jen
David Kilzer (:ddkilzer)
Comment 7 2007-07-16 13:10:54 PDT
(In reply to comment #6) > I still couldn't get our site to work with Opera, however. I'll continue > looking into that. Please contact David Storey <david.storey@opera.com> for further assistance with Opera. Glad we could help!
Sam Weinig
Comment 8 2007-08-30 15:44:02 PDT
The site has been fixed.
Note You need to log in before you can comment on or make changes to this bug.