an example of page redraw problem when images load

With automatic image loading turned off, if I go to http://genode.org/documentation/developer-resources/walk_through , page down to the [IMG] below "The launchpad application starter", and click on it, the space to the right of the image still contains remnants of the text that used to be there.

On Sat, Aug 09, 2008 at 03:26:48PM +0000, corvid wrote:
With automatic image loading turned off, if I go to http://genode.org/documentation/developer-resources/walk_through , page down to the [IMG] below "The launchpad application starter", and click on it, the space to the right of the image still contains remnants of the text that used to be there.
This is a bug in the redraw optimization. I could reproduce it once with the method you described, but now it no longer happens. Also it does not happen here with a local testcase like: <html> <body> foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar <img src="test.jpg"/> foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar </body> </html> I'll keep trying... Johannes

The genode one didn't want to break for me either anymore, so I went looking for an example from wikipedia. If I go to http://en.wikipedia.org/wiki/Cysteine#Sheep with images off, and click on the image of Cystine, the text directly below the image jumps down. The source for that bit goes: <div class="thumb tright"> <div class="thumbinner" style="width:152px;"><a href="/wiki/Image:Cystine-skeletal.png" class="image" title="Cystine, showing disulfide bond"><img alt="Cystine, showing disulfide bond" src="file:///tmp/150px-Cystine-skeletal.png" width="150" height="191" border="0" class="thumbimage" /></a> <div class="thumbcaption"> <div class="magnify"><a href="/wiki/Image:Cystine-skeletal.png" class="internal" title="Enlarge"><img src="/skins-1.5/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div> <a href="/wiki/Cystine" title="Cystine">Cystine</a>, showing <a href="/wiki/Disulfide_bond" title="Disulfide bond">disulfide bond</a></div> </div> </div> <p>Cysteine is required... It was like dillo had treated the </div></div><p> as a <br> until that click. I see that Textblock::addParbreak() has: /* Another break before? */ if ((word = words->getRef(words->size () - 1)) && word->content.type == core::Content::BREAK) { word->content.breakSpace = misc::max (word->content.breakSpace, space); return; } word = addWord (0, 0, 0, style); word->content.type = core::Content::BREAK; word->content.breakSpace = space; wordWrap (words->size () - 1); For the sake of experiment, I stuck a wordWrap (words->size () - 1); before the return, and now it seems to work. I imagine it must have to do with lastLine->breakSpace getting updated...

On Sat, Sep 06, 2008 at 03:53:34AM +0000, corvid wrote:
The genode one didn't want to break for me either anymore, so I went looking for an example from wikipedia. If I go to http://en.wikipedia.org/wiki/Cysteine#Sheep with images off, and click on the image of Cystine, the text directly below the image jumps down.
The source for that bit goes:
<div class="thumb tright"> <div class="thumbinner" style="width:152px;"><a href="/wiki/Image:Cystine-skeletal.png" class="image" title="Cystine, showing disulfide bond"><img alt="Cystine, showing disulfide bond" src="file:///tmp/150px-Cystine-skeletal.png" width="150" height="191" border="0" class="thumbimage" /></a> <div class="thumbcaption"> <div class="magnify"><a href="/wiki/Image:Cystine-skeletal.png" class="internal" title="Enlarge"><img src="/skins-1.5/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div> <a href="/wiki/Cystine" title="Cystine">Cystine</a>, showing <a href="/wiki/Disulfide_bond" title="Disulfide bond">disulfide bond</a></div> </div> </div> <p>Cysteine is required...
It was like dillo had treated the </div></div><p> as a <br> until that click. I see that Textblock::addParbreak() has:
/* Another break before? */ if ((word = words->getRef(words->size () - 1)) && word->content.type == core::Content::BREAK) { word->content.breakSpace = misc::max (word->content.breakSpace, space); return; }
word = addWord (0, 0, 0, style); word->content.type = core::Content::BREAK; word->content.breakSpace = space; wordWrap (words->size () - 1);
For the sake of experiment, I stuck a wordWrap (words->size () - 1); before the return, and now it seems to work. I imagine it must have to do with lastLine->breakSpace getting updated...
Yes, it seems so. Can you please test attached patch? It just updates lastLine->breakSpace instead of calling Textblock::wordWrap, because of the comment above Textblock::wordWrap... It also fixes some bugs in the redraw optimization. At least the <ol> issue (google.com) no longer happens here. Cheers, Johannes

Johannes wrote:
On Sat, Sep 06, 2008 at 03:53:34AM +0000, corvid wrote:
It was like dillo had treated the </div></div><p> as a <br> until that click. I see that Textblock::addParbreak() has:
/* Another break before? */ if ((word = words->getRef(words->size () - 1)) && word->content.type == core::Content::BREAK) { word->content.breakSpace = misc::max (word->content.breakSpace, space); return; }
word = addWord (0, 0, 0, style); word->content.type = core::Content::BREAK; word->content.breakSpace = space; wordWrap (words->size () - 1);
For the sake of experiment, I stuck a wordWrap (words->size () - 1); before the return, and now it seems to work. I imagine it must have to do with lastLine->breakSpace getting updated...
Yes, it seems so. Can you please test attached patch? It just updates lastLine->breakSpace instead of calling Textblock::wordWrap, because of the comment above Textblock::wordWrap...
It also fixes some bugs in the redraw optimization. At least the <ol> issue (google.com) no longer happens here.
It appears to be working well. Thanks!

On Sat, Sep 06, 2008 at 06:38:23PM +0000, corvid wrote:
Johannes wrote:
On Sat, Sep 06, 2008 at 03:53:34AM +0000, corvid wrote:
It was like dillo had treated the </div></div><p> as a <br> until that click. I see that Textblock::addParbreak() has:
/* Another break before? */ if ((word = words->getRef(words->size () - 1)) && word->content.type == core::Content::BREAK) { word->content.breakSpace = misc::max (word->content.breakSpace, space); return; }
word = addWord (0, 0, 0, style); word->content.type = core::Content::BREAK; word->content.breakSpace = space; wordWrap (words->size () - 1);
For the sake of experiment, I stuck a wordWrap (words->size () - 1); before the return, and now it seems to work. I imagine it must have to do with lastLine->breakSpace getting updated...
Yes, it seems so. Can you please test attached patch? It just updates lastLine->breakSpace instead of calling Textblock::wordWrap, because of the comment above Textblock::wordWrap...
It also fixes some bugs in the redraw optimization. At least the <ol> issue (google.com) no longer happens here.
It appears to be working well. Thanks!
Johannes: Should I commit this patch? -- Cheers Jorge.-

On Sat, Sep 06, 2008 at 04:28:55PM -0400, Jorge Arellano Cid wrote:
On Sat, Sep 06, 2008 at 06:38:23PM +0000, corvid wrote:
Johannes wrote:
On Sat, Sep 06, 2008 at 03:53:34AM +0000, corvid wrote:
It was like dillo had treated the </div></div><p> as a <br> until that click. I see that Textblock::addParbreak() has:
/* Another break before? */ if ((word = words->getRef(words->size () - 1)) && word->content.type == core::Content::BREAK) { word->content.breakSpace = misc::max (word->content.breakSpace, space); return; }
word = addWord (0, 0, 0, style); word->content.type = core::Content::BREAK; word->content.breakSpace = space; wordWrap (words->size () - 1);
For the sake of experiment, I stuck a wordWrap (words->size () - 1); before the return, and now it seems to work. I imagine it must have to do with lastLine->breakSpace getting updated...
Yes, it seems so. Can you please test attached patch? It just updates lastLine->breakSpace instead of calling Textblock::wordWrap, because of the comment above Textblock::wordWrap...
It also fixes some bugs in the redraw optimization. At least the <ol> issue (google.com) no longer happens here.
It appears to be working well. Thanks!
Johannes: Should I commit this patch?
Yes please. Cheers, Johannes

On Sat, Sep 06, 2008 at 10:26:03PM +0200, Johannes Hofmann wrote:
On Sat, Sep 06, 2008 at 04:28:55PM -0400, Jorge Arellano Cid wrote:
On Sat, Sep 06, 2008 at 06:38:23PM +0000, corvid wrote:
Johannes wrote:
On Sat, Sep 06, 2008 at 03:53:34AM +0000, corvid wrote:
It was like dillo had treated the </div></div><p> as a <br> until that click. I see that Textblock::addParbreak() has:
/* Another break before? */ if ((word = words->getRef(words->size () - 1)) && word->content.type == core::Content::BREAK) { word->content.breakSpace = misc::max (word->content.breakSpace, space); return; }
word = addWord (0, 0, 0, style); word->content.type = core::Content::BREAK; word->content.breakSpace = space; wordWrap (words->size () - 1);
For the sake of experiment, I stuck a wordWrap (words->size () - 1); before the return, and now it seems to work. I imagine it must have to do with lastLine->breakSpace getting updated...
Yes, it seems so. Can you please test attached patch? It just updates lastLine->breakSpace instead of calling Textblock::wordWrap, because of the comment above Textblock::wordWrap...
It also fixes some bugs in the redraw optimization. At least the <ol> issue (google.com) no longer happens here.
It appears to be working well. Thanks!
Johannes: Should I commit this patch?
Yes please.
Committed. -- Cheers Jorge.-
participants (3)
-
corvid@lavabit.com
-
jcid@dillo.org
-
Johannes.Hofmann@gmx.de