[webkit-help] eBay iframe height

Bem Jones-Bey bjonesbe at adobe.com
Tue Mar 26 15:44:05 PDT 2013


Hi Paolo,

The best way to get a response from the WebKit community would be to create a minimal example that can reproduce the problem outside of eBay's specific implementation, and file a bug with that test case attached. If you can create such a standalone test case, that would make it much easier to answer the question as to if this is a bug in WebKit or if it's a bug in eBay.

If you don't have time to do that, perhaps you should talk to eBay about it? After all, it is a problem with their site, and you mention that it doesn't sound like it works correctly in Firefox either. So regardless of if it's a bug in WebKit and Firefox, the eBay folks may want to work around it. Also, the eBay folks may have an easier time putting together a small test case since there's a lot of their code involved here.

Hope this helps,
Bem

On Mar 25, 2013, at 05:04 , Paolo Portaluri <poweruser.webkit at work.to.it> wrote:

> I'm sorry to post this question again, but I had no answer in a month and I really don't know what else to do :(
> 
> I'm having a problem with my HTML listing on eBay.
> eBay loads the HTML code provided by the user for their item's description in an iframe in the item page.
> Immediately after loading the iframe, a JavaScript function is called to resize the frame so it fit the content.
> My problem is that the resize doesn't work properly in desktop WebKit browsers.
> Here's one of my listing having the problem: http://cgi.ebay.it/ws/eBayISAPI.dll?ViewItem&item=120928779644
> (The first time I load the page, eBay looks weird and don't shows the problem, but it appears in the next reload. It seems a cookie related problem).
> 
> I tried with:
> * Safari 6.0.2 (8536.26.17) on Mac OS X 10.8.2,
> * SRWare Iron (based on Chromium) 24.0.1350.0 (178923) on Mac OS X 10.8.2,
> * Up-to-date Chrome on Windows XP.
> In every cases, the iframe height is too small to accommodate its content.
> Related side-notes:
> * It works on Internet Explorer 8 on Windows XP and Mobile Safari on iPad iOS 6.0.1.
> * With Firefox (on Mac and Win) the iframe height is enormously big.
> 
> 
> This is what I found in my search for a solution to this problem:
> 
> The iframe code is structured this way:
> 1. eBay's html, head, body tags
> 2. eBay's JavaScript code 1
> 3. eBay's table and div tags
> 4. User's HTML code (with CSS e JS)
> 5. eBay's closing tags for 3.
> 6. eBay's JavaScript code 2
> 7. eBay's closing tags for 1.
> An example with bogus user code and beautified JS code is here http://cl.ly/2h3x2f1l1k3v
> 
> For WebKit browsers the resizing is performed by reloading the main page adding a fragment to the URL with the desired size.
> The height to be used is calculated by the function ifr.getSize() (cfr. https://gist.github.com/poweruser82/4955463#file-ebay_iframe_clean-L315 ).
> Debugging the code in SRWare Iron (mostly because current Safari inspector can't beautify the code :[), I found the problem is at line 330 https://gist.github.com/poweruser82/4955463#file-ebay_iframe_clean-L330 where it says:
>> h = document.body.offsetHeight;
> The value returned by WebKit is 500 on my Mac instead of a little less than 1500.
> document.body.scrollHeight returns the correct value.
> 
> If I force the h variable in the debug session, the frame is resized correctly.
> I tried to tweak the ifr object in my code, but eBay's code (at step 6) redefines it, so trying to freeze the object was useless.
> If I try to reload the parent page after a delay passing the fragment with the right size, nothing happens due to eBay code's checks.
> 
> To add more doubts to the situation, the problem didn't happen in other listing (i.e.: http://www.ebay.it/itm/CASE-AEROCOOL-VX-E-PRO-ADVANCE-BLACK-CABINET-PC-GAMING-CON-CONTROLLER-VENTOLE-/251084074821 ).
> I analysed its code but I haven't found any clue because document.body.offsetHeight return the right value there.
> 
> 
> Any idea on how to solve my problem?
> Is this a bug of WebKit?
> 
> 
> Ciao
> Paolo
> 
> 
> -- 
> Paolo Portaluri
> web: http://work.to.it/
> AIM: poweruser82
> tent: https://poweruser.tent.is
> 
> 
> _______________________________________________
> webkit-help mailing list
> webkit-help at lists.webkit.org
> https://lists.webkit.org/mailman/listinfo/webkit-help



More information about the webkit-help mailing list