Closed Bug 180931 Opened 22 years ago Closed 21 years ago

insufficient invalidation after dynamic reflow

Categories

(Core :: Web Painting, defect, P1)

x86
All
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: per.angstrom, Assigned: roc)

References

()

Details

(Keywords: testcase)

Attachments

(4 files, 1 obsolete file)

This page has some dynamic content that affects the entire page when displayed or hidden. When that happens, the display is not updated properly, leaving ugly traces of the old display to the right. How to reproduce: 1) Open the URL in a sufficiently wide window. 2) Click the link labeled "+ Avdelningar" in the left column, to make the dynamic content appear. Desired result: The page should have a normal appearance after reflowing to make room for the dynamic content. Actual result: To the right, you will see traces of how the page looked before reflowing. ---- A similar problem is exhibited by <http://www.autark.se/menytest0.html> (click on any of the links labeled "+ Innehåll"). It seems that Netscape 7 is not as badly affected as Mozilla. Internet Explorer and Opera 7b1 don't have this problem. I have an idea that my use of 'max-width' has something to do with this bug. Discovered in "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3a) Gecko/20021115 Phoenix/0.4". Seen in Mozilla on Linux, and in Phoenix and K-Meleon on Windows 98.
Priority: -- → P3
Target Milestone: --- → Future
In 1.3b-20030110, I can no longer reproduce the problem on the original URL, <http://www.autark.se/dynresize_example.html>. However, it it still reproducible on <http://www.autark.se/menytest0.html> (URL updated accordingly). Using an older build, I have seen similar symptoms on ordinary pages, when accessing <http://www.autark.se/> on a slow analog line.
Attached file testcase (obsolete) —
testcase demonstrates the bug with linux trunk 20030111 after clicking 'foo', the second line is moved down and the previously-hidden line is displayed, but the second line is not completely erased from the its previous position.
Attachment #111311 - Attachment description: testcae → testcase
if you have trouble reproducing this bug, try making your window wider (1000+)
Keywords: testcase
No improvement in Mozilla 1.4a-20030401. The partial improvement mentioned in comment #1 has vanished.
Summary: display not updated properly after dynamic reflow → page not redrawn properly after dynamic reflow
The testcase, and <http://www.autark.se/menytest0.html>, work OK in 1.4b-20030429 Mozilla Firebird/Linux. However, my original testcase, <http://www.autark.se/dynresize_example.html>, is now reflown badly.
the dynresize_example works fine for me. are you seeing the original bug when you click or a different one?
It's the original bug I see. As you have already noted, the window has to be quite broad, enough to let max-width kick in. I just downloaded Mozilla 1.4b-20030502 and tried it on Win98: same problem.
Looks like we're not invalidating enough of the line....
Assignee: other → roc+moz
Component: Layout → Layout: View Rendering
Priority: P3 → --
Target Milestone: Future → ---
No improvement in 1.4rc3.
The bug survived into Mozilla 1.4 and Netscape 7.1. Changed summary.
Summary: page not redrawn properly after dynamic reflow → insufficient invalidation after dynamic reflow
Reproduced on Firebird 20030714. I have similar problems just loading Yahoo! and I've seen it happen on different machines. Is this the same bug?
The bug is still there in 1.5 beta. Re seeing the bug on Yahoo: I can't reproduce it on <http://www.yahoo.com/>. Given that Yahoo's front page doesn't use much in the way of dynamic content, you are probably seeing a problem on some other page - please be more specific.
Attached patch fixSplinter Review
Here's a fix for this bug, with some cleanup added too (move nsFrame::Invalidate to nsIFrame and remove its aPresContext parameter, and add a usable + operator to nsRect). The basic problem is that the auto-margin block is positioned at X=0, then Reflow is called on it, then PlaceBlock repositions it to the correct X offset. During its Reflow the auto-margin block does a few Invalidates --- but they invalidate the wrong area because its X is temporarily 0! There are a few possible solutions. The solution I have implemented here is to have FinishReflowChild repaint the entire child frame if it moves. That fixes this bug. I suspect this may not be a complete solution; I'm worried about the case where the block shrinks so that the invalidates during Reflow go to the wrong place, and the new overflow area isn't big enough to cover the area that should have been invalidated. Fixing that might require invalidating the old block overflow area if we move the block when we do the mFrame->SetPosition in nsBlockReflowContext::ReflowBlock. But it's not clear we can easily get the old overflow area there. Or maybe there's a way to get around this temporary block repositioning behaviour, so that we just don't move the block until we know its final offset.
CCing dbaron for comments.
No, the Yahoo thing was a different bug, which was fixed several weeks ago.
No improvement in 1.6 beta.
The bug survived into Mozilla 1.6.
Comment on attachment 130668 [details] [diff] [review] fix sr as well, although double-check that the overflow area always includes the frame bounds by this point
Attachment #130668 - Flags: superreview+
Fix checked in.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Looks good in Mozilla 1.7a. Marking as VERIFIED.
Status: RESOLVED → VERIFIED
Component: Layout: View Rendering → Layout: Web Painting
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: