Closed Bug 725580 Opened 13 years ago Closed 12 years ago

Partially transparent transformed div unexpectedly invalidates content when visible content disappears during animation

Categories

(Core :: Layout, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: cjones, Assigned: cjones)

References

(Depends on 1 open bug, Blocks 1 open bug)

Details

Attachments

(3 files, 2 obsolete files)

Attached file small test case (deleted) —
The description of this bug might be a bit hard to follow, but load the test below with paint-flashing on and you'll see what I mean. I'm testing with patches from bug 722923 and bug 724189 applied. This bug is important for b2g.
Summary: Partially transparent transparent div unexpectedly invalidates content when visible content disappears → Partially transparent transformed div unexpectedly invalidates content when visible content disappears during animation
As expected, InvalidateTransformLayer stops thinking the frame has a layer when the invalidation starts. Breakpoint 2, nsIFrame::InvalidateTransformLayer (this=0x7fffe023cd38) at /home/cjones/mozilla/mozilla-central/layout/generic/nsFrame.cpp:4376 $79 = true Breakpoint 2, nsIFrame::InvalidateTransformLayer (this=0x7fffe023cd38) at /home/cjones/mozilla/mozilla-central/layout/generic/nsFrame.cpp:4376 $80 = false This might be a little tricky to fix.
FrameLayerBuilder::GetDedicatedLayer (gdb) p layer->HasUserData(&gColorLayerUserData) $772 = false (gdb) p layer->HasUserData(&gImageLayerUserData) $773 = false (gdb) p layer->HasUserData(&gThebesDisplayItemLayerUserData) $774 = true
We stop building an nsDisplayTransform when the invalidations start.
Attached patch something like this? (obsolete) (deleted) — Splinter Review
We're *building* the displaytransform, it just gets "optimized away" after the visible part scrolls offscreen. This patch forces the entire frame of the display transform to be "visible", when we're using the prerender optimization. Makes the extra invalidation go away except for some artifacts that persist for a while after the animation finishes. Not sure what's up with that. I don't know if this is the right approach or not.
Attachment #595681 - Flags: feedback?
Attachment #595681 - Flags: feedback? → feedback?(roc)
Comment on attachment 595681 [details] [diff] [review] something like this? Actually yeah this is wrong. I don't know what I was thinking. Start on top of https://bugzilla.mozilla.org/attachment.cgi?id=595597&action=edit. And instead of using mFrame->GetRect(), use GetVisualOverflowRectRelativeToSelf() and add ToReferenceFrame() before you transform it.
Attachment #595681 - Flags: review+ → review-
Needs a test. Might have to wait until tomorrow (running out of gas).
Assignee: nobody → jones.chris.g
Attachment #595681 - Attachment is obsolete: true
Attachment #595688 - Flags: review?(roc)
Stealing most of the test from bug 722923. Will be polite and not conflict it out if I can avoid that.
Depends on: 722923
Attached patch Test for bug 725580 (obsolete) (deleted) — Splinter Review
When I extract the core of this test and run it in FF, it works perfectly: invalidates before patch, doesn't after. But it doesn't work when ported to mochitest-chrome as here :(. Not sure what's up.
The test might be failing to check the element corresponding to the thebeslayer that's being invalidated. id="bg", document.body, and document.documentElement don't seem to be it. Or something else is wrong.
Attached patch Test for bug 725580. (deleted) — Splinter Review
The previous test seemed to be interacting badly with the color-layer optimization. That probably confused checkAndClearPaintedState(). This one works fine, and when run standalone I see the invalidated region in the outer <div> (the one with the gradient) persist forever. But the test still isn't catching the invalidation :(. Not sure what to do here. Hate to patch and run, but at this point it's starting to look like the cost expended on the test is beginning to outweigh its benefit. roc, happy to defer the call to you.
Attachment #595700 - Attachment is obsolete: true
(This decision is most likely to affect Matt, so pulling him.)
(In reply to Chris Jones [:cjones] [:warhammer] from comment #10) > at this point it's starting to look like the cost > expended on the test is beginning to outweigh its benefit. Agreed.
You can land this along with the already-reviewed patch from bug 722603 that you depend on.
(In reply to Chris Jones [:cjones] [:warhammer] from comment #11) > (This decision is most likely to affect Matt, so pulling him.) Fine with me. Just need to make sure we manually recheck these things when landing display list based invalidation.
Reviewed try logs with roc and decided that patch is ready to land. http://hg.mozilla.org/integration/mozilla-inbound/rev/92d08776a039
https://hg.mozilla.org/mozilla-central/rev/92d08776a039 I assume this should stay open for the test... if not please resolve.
No longer blocks: b2g-demo-phone
This stayed fixed with dlbi.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: