[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kfm-devel
Subject:    Re: [patch] css parser, floats
From:       Germain Garand <germain () ebooksfrance ! org>
Date:       2004-02-28 16:54:41
Message-ID: 200402281654.41552.germain () ebooksfrance ! org
[Download RAW message or body]

Le Samedi 28 Février 2004 14:44, Dirk Mueller a écrit :
> > 2) fix a problem with floating images: when they aren't loaded yet, the
> > page is first layouted with temporary 10x10 pixmaps, but once the final
> > image is loaded, blocks affected by the float aren't relayouted.
> > Results in ugly text overlaps on images on a lot of news sites
> > (see #71445)
>
> Do you have a testcase for this? I consider it dangerous to compare
> floatBottom() with m_height while we're trying hard to calculate m_height
> itself.

it's not easy to testcase because it happens when images aren't yet loaded, so
from a local file, it just works (as is stated in #71445).

However, attached is a testcase with one second delayed images from my server, 
so that it becomes obvious.

The test for floatBottom() > m_height was outside of the loop over 'child', so 
it checked the first and only the first child, apparently for no good reason.

That sounded strange to me, so I had a look at WC125, and saw that they moved 
the test inside the loop, just after some logic ensuring that m_height isn't 
< floatBottom() in a specific case, so it looked all fine...

Now, this "while" block is an <expletive deleted> monster, so its getting hard 
to be deterministic, but still, I think it boils down to m_height only 
growing by += child->height() at the end of the loop.
so indeed, if floatBottom() is > m_height, it means a fresh float has just 
been inserted from the previous child, hence that remaining childs need to 
relayout...



["floats.html" (text/html)]

<style>
  .a { height: 100px }
  .f { float: left }
</style>
<body>

<div class='a'>
  <div class='f'>
      <img src="http://www.phoenix-library.org/foo.php?img=developer.gif&delay=1">
  </div>
  <div>I'm fixing a hole where the rain gets in and stops my mind 
       from wondering where it will go...
  </div>
</div>

<div class='a'>
  <div class='f'>
      <img src="http://www.phoenix-library.org/foo.php?img=community.gif&delay=1">
  </div>
  <div>I'm fixing a hole where the rain gets in and stops my mind 
       from wondering where it will go...
  </div>
</div>

<div class='a'>
  <div class='f'>
      <img src="http://www.phoenix-library.org/foo.php?img=interviews.gif&delay=1">
  </div>
  <div>I'm fixing a hole where the rain gets in and stops my mind 
       from wondering where it will go...
  </div>
</div>


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic