[#12978] IFRAME sizing regression
Summary IFRAME sizing regression
Queue IMP
Queue Version Git master
Type Bug
State Resolved
Priority 1. Low
Owners Horde Developers, slusarz@horde.org
Requester jan@horde.org
Created 2014-02-18 (1945 days ago)
Due
Updated 2014-03-18 (1917 days ago)
Assigned 2014-02-18 (1945 days ago)
Resolved 2014-03-18 (1917 days ago)
Milestone
Patch No

Comments
Jan Schneider <jan@horde.org> 2014-02-18 10:05:52
Commits 1d4a172ec270987c8785651dcc7a563b3001095f and 
3c713dd3a2e31c8a15517d1d50c2b8d6aad853ea break IFRAME sizing of 
several HTML newsletters while I didn't experience any issues before 
those patches. FF 27 Linux.

Jan Schneider <jan@horde.org> 2014-02-18 10:07:52
Example 1, works with the 2nd commit reverted.

Jan Schneider <jan@horde.org> 2014-02-18 10:08:46
Example 2, works with both commits reverted.

Michael Slusarz <slusarz@horde.org> 2014-02-18 17:42:43
> Commits 1d4a172ec270987c8785651dcc7a563b3001095f and 
> 3c713dd3a2e31c8a15517d1d50c2b8d6aad853ea break IFRAME sizing of 
> several HTML newsletters while I didn't experience any issues before 
> those patches. FF 27 Linux.

Not sure what to do.  "Height: auto" absolutely cannot be used, since 
it breaks both dynamic and smartmobile views (it causes automatic 
scrolling of the containing div, which breaks things like automatic 
hiding of the addressbar in smartmobile, which is 100% unacceptable).   
So these are not revertable

Not to mention that I have a 150 message mailbox of test messages that 
at one point did not display correctly.  The current code does as good 
of a job as before, without breaking anything (no solution I've ever 
come up with has displayed 100% of messages correctly).

If someone else wants to try and come up with a better solution, that 
would be great.  I've spent hours on this with minimal luck, and there 
really is very little documentation I've found on the web that can 
help.  Two things need to be avoided:

1. Resizing based on defer/delay code
2. Height: auto

Git Commit <commits@lists.horde.org> 2014-03-07 08:59:46
Changes have been made in Git (master):

commit 718dc9394dc9639bf7093461ee2c0bb8f8e1c23c
Author: Michael M Slusarz <slusarz@horde.org>
Date:   Fri Mar 7 01:26:16 2014 -0700

     Bug #12978: This seems to work at least slightly better

     The simple fact is that computed body height  may not be the same 
as computed
     html tag height.  Even stranger, the latter is oftentimes greater than
     the former, even though it is embedded within the former.

  imp/js/imp.js |    9 ++++++---
  1 files changed, 6 insertions(+), 3 deletions(-)

http://git.horde.org/horde-git/-/commit/718dc9394dc9639bf7093461ee2c0bb8f8e1c23c

Git Commit <commits@lists.horde.org> 2014-03-18 06:11:16
Changes have been made in Git (master):

commit d50926e82b7e48557373963f0668a91f31e1c833
Author: Michael M Slusarz <slusarz@horde.org>
Date:   Tue Mar 18 00:11:02 2014 -0600

     Bug #12978: More tweaking of IFRAME sizing algorithm

  imp/js/imp.js |   19 +++++++++++++------
  1 files changed, 13 insertions(+), 6 deletions(-)

http://git.horde.org/horde-git/-/commit/d50926e82b7e48557373963f0668a91f31e1c833

Michael Slusarz <slusarz@horde.org> 2014-03-18 06:12:08
Marking as resolved.  This is always going to be a WIP with constant tweaking.

Jan Schneider <jan@horde.org> 2014-03-18 09:19:48
This has much improved now. The only case where it still doesn't work 
correctly are HTML messages with images that don't specify sizes, so 
that the body resizes while the images load. Going back to that 
message later when all images are cached works perfectly. Any chance 
to trigger another resize just in case the body size changed when the 
document has completely loaded? This would reduce the flickering to 
messages that don't specify image sizes.

Michael Slusarz <slusarz@horde.org> 2014-03-18 18:23:45
> Any chance to trigger another resize just in case the body size 
> changed when the document has completely loaded? This would reduce 
> the flickering to messages that don't specify image sizes.

We already do this.  In fact, the iframe resize code is triggered 
after each individual image is loaded.

The issue might be we need to add a delay to the callback to the 
resize method after the image onload event is triggered, because it is 
possible the onload is triggered before the image is inserted/sized in 
the IFRAME DOM element.

Git Commit <commits@lists.horde.org> 2014-03-18 19:15:19
Changes have been made in Git (master):

commit c5743be34d4d9ef90b558c645cf09dd594850e51
Author: Michael M Slusarz <slusarz@horde.org>
Date:   Tue Mar 18 13:12:14 2014 -0600

     Bug #12978: Fix resize behavior when images are not blocked

  imp/js/imp.js |   28 +++++++++++++++++-----------
  1 files changed, 17 insertions(+), 11 deletions(-)

http://git.horde.org/horde-git/-/commit/c5743be34d4d9ef90b558c645cf09dd594850e51