Open Bug 498462 Opened 15 years ago Updated 2 years ago

Invalidates are not coming properly for frames with absolute position after scroll change

Categories

(Core :: Layout, defect)

x86
Linux
defect

Tracking

()

People

(Reporter: romaxa, Unassigned)

Details

Attachments

(4 files, 2 obsolete files)

We have problem with footers and heaters frames with absolute position.
After changing scroll view position, floating frames suppose to move from absolute position in old scroll-view-port (before ScrollChange), to absolute position on new scroll-view-port.... and send notify invalidate for 2 regions (previous position and new position)...

Currently there are no any invalidates from those frames, only one big invalidate for new gfxScrollableFrame rectangle
http://mxr.mozilla.org/mozilla-central/source/layout/generic/nsGfxScrollFrame.cpp#1796

This problem not visible in normal firefox, but visible in implementations like fennec or microb-browser...
Attached file Footer example
I'm not sure what the problem is. Are you saying you want to be able to distinguish invalidation due to scrolling from other kinds of invalidation?
footers are changing their position after changing window scroll  (window->ScrollTo)...
And there are suppose to be invalidate with 2 rectangles (old and new position).
Main problem is that we don't receive invalidate notification for old footer position.
I still don't understand. The footer DIV in your example is not changing position when you scroll.
(In reply to comment #4)
> I still don't understand. The footer DIV in your example is not changing
> position when you scroll.

Relative to scroll-view-port - no, but relative to main document 0,0 point it is changing position.

Ex:
document with size [800x2000]. scroll port [0, 0, 800x400], div[0, 50, 800x50] in global coordinates, and [0, 50, 800x50] - absolute position relative to scroll-port.

After scrollTo(0, 250), situation is so:
scroll port [0, 250, 800x400], div[0, 300, 800x50] in global coordinates, and [0, 50, 800x50] - absolute position relative to scroll-port.

Invalidate notification is coming only for [0, 250, 800x400]

I want to get invalidate notification also for previous div position in global coordinates [0, 50, 800x50]... because without it my pre-rendered surface getting dirty area, and without invalidate [0, 50, 800x50] I don't know that it is dirty.
I see. Can you rewrite your patch to use UnionRect instead of what it currently does?
(In reply to comment #6)
> I see. Can you rewrite your patch to use UnionRect instead of what it currently
> does?

I think yes... but I think it is not very correct way to fix this  problem... 

Would it be possible to get right invalidate notification after scrollTo for each layout frame which is dependent from scroll port position? Maybe in this case we can avoid dummy ScrollPort invalidate after each scroll event, and invalidate only those things which is must be repainted?
That sounds too complicated, lots of overhead and for normal use it's not necessary.
Attached patch Updated with UnionRect (obsolete) — Splinter Review
Attachment #384423 - Flags: review?(roc)
Call "mWillChangePos" "mPositionBeforeScroll" and add a comment describing how it's used.

+  r.UnionRect(r, nsRect(nsPoint(mWillChangePos.x - aX, mWillChangePos.y - aY), mOuter->GetSize()));

Use nsRect(mWillChangePos - nsPoint(aX, aY), mOuter->GetSize()).

+  mWillChangePos.x = aX;
+  mWillChangePos.y = aY;

Don't do this. Instead, set them to nscoord_MIN and before you use them, assert that they've been st to something else.
Attached patch Should be ok.Splinter Review
Attachment #384423 - Attachment is obsolete: true
Attachment #385069 - Flags: review?(roc)
Attachment #384423 - Flags: review?(roc)
+  if (mPositionBeforeScroll.x != nscoord_MIN && mPositionBeforeScroll.y != nscoord_MIN) {

This should be an assertion. They can't be nscoord_MIN, if things are working correctly.

+    mPositionBeforeScroll.x = nscoord_MIN;
+    mPositionBeforeScroll.y = nscoord_MIN;

this can be #ifdef DEBUG
Attachment #393894 - Attachment is obsolete: true
Attachment #393998 - Flags: review?(roc)
Now you're not sending any NOTIFY_ONLY invalidate when we are mIsRoot and there are no fixed frames; the first InvalidateWithFlags should be unconditional.
Comment on attachment 393998 [details] [diff] [review]
Fixed style, added check for viewPort frame

see comment #15
Attachment #393998 - Flags: review?(roc) → review-
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: