Closed
Bug 1217803
Opened 8 years ago
Closed 7 years ago
Animating elements don't always respect border-radius mask
Categories
(Core :: Graphics: Layers, defect)
Tracking
()
RESOLVED
FIXED
mozilla50
Tracking | Status | |
---|---|---|
firefox50 | --- | fixed |
People
(Reporter: wilsonpage, Assigned: mattwoodrow)
References
(Depends on 1 open bug, Blocks 1 open bug)
Details
(Whiteboard: gfx-noted)
Attachments
(2 files, 2 obsolete files)
5.65 KB,
patch
|
mstange
:
review+
|
Details | Diff | Splinter Review |
5.08 KB,
patch
|
Details | Diff | Splinter Review |
A combination of `border-radius` and `overflow: hidden` doesn't *always* mask animating child at corners. EXAMPLE: http://jsbin.com/qofima/edit?html,css,output
Comment 1•8 years ago
|
||
This reproduces 100% for me on Linux with apz and async-animations enabled. Milan, is there anyone on gfx that can look at this?
Flags: needinfo?(milan)
With async animations, I imagine Brian could help. For me, the "not masking" is frequent, but temporary - at least in the above example, in that I see it unmasked, but then it gets masked on the next refresh. I'm not convinced this is a big deal, especially since it doesn't work at all in Safari, and has exactly the same behaviour in Chrome (to be fair, IE works.)
Flags: needinfo?(milan) → needinfo?(bbirtles)
OS: Unspecified → All
Comment 3•8 years ago
|
||
By 100%, I meant while animating - it indeed settles into the right rendering once the animation finishes. Also interesting that this happens in Chrome, rather unexpected! (and kudos IE :))
Comment 4•8 years ago
|
||
Total guess: I'd suggest first looking into the code that should be building the mask layer. I'd imagine we avoid building the mask layer during OMTA if the initial position doesn't require it without considering if any off the possible OMTA value require it. If you set: span { transform: scaleX(0.9); } making both the initial and final position require the mask then it works properly.
Comment 5•8 years ago
|
||
(In reply to Benoit Girard (:BenWa) from comment #4) > Total guess: I'd suggest first looking into the code that should be building > the mask layer. I'd imagine we avoid building the mask layer during OMTA if > the initial position doesn't require it without considering if any off the > possible OMTA value require it. Looks like it: https://dxr.mozilla.org/mozilla-central/rev/28068d907290d1f5138a0b9e59ae2233a1c1b7a3/layout/base/FrameLayerBuilder.cpp#4133 I guess we need to do something like nsLayoutUtils::ComputeSuitableScaleForAnimation where we work out the maximum animated scale and then use that to work out the maximum content bounds before deciding if we need the mask layer or not.
Flags: needinfo?(bbirtles)
Updated•8 years ago
|
Whiteboard: gfx-noted
Updated•8 years ago
|
Assignee: nobody → motoryo1
Comment 6•7 years ago
|
||
Motozawa-san, will you have time to work on this, or is it ok to re-assign to someone else?
Flags: needinfo?(motoryo1)
Updated•7 years ago
|
Assignee: motoryo1 → mantaroh
Updated•7 years ago
|
Flags: needinfo?(motoryo1)
Comment 7•7 years ago
|
||
Comment 8•7 years ago
|
||
Removed unnecessary space.
Updated•7 years ago
|
Attachment #8770763 -
Attachment is obsolete: true
Assignee | ||
Comment 9•7 years ago
|
||
Couldn't we also have a similar problem with transforms other than scales? Like if we translated the content so that it intersected with the corner when it didn't previously? What about other async changes, like scrolling with apz? We might need to detect if the content can at all be affected by APZ, and treat the region as infinite in that case.
Comment 10•7 years ago
|
||
Or we could always treat the region as infinite. (And actually just replace the condition with layerClip.GetRoundedRectCount() > 0). We enter this code for active layers, and usually they're active because their contents are in some way animated.
Assignee | ||
Comment 11•7 years ago
|
||
That seems like a pretty reasonable simplification to me.
Assignee | ||
Comment 13•7 years ago
|
||
Assignee: mantaroh → matt.woodrow
Attachment #8770765 -
Attachment is obsolete: true
Attachment #8770791 -
Flags: review?(mstange)
Comment 14•7 years ago
|
||
Comment on attachment 8770791 [details] [diff] [review] always-build-mask-layer Review of attachment 8770791 [details] [diff] [review]: ----------------------------------------------------------------- This will also fix bug 1286622 which I coincidentally filed today. Please add a test.
Attachment #8770791 -
Flags: review?(mstange) → review+
Assignee | ||
Comment 15•7 years ago
|
||
I'm not aware of an easy way to write tests for async animations compositing behaviour.
Comment 16•7 years ago
|
||
Ok, I'm not sure how to do those offhand either, but you could turn the testcase in bug 1286622 into an async scrolling test.
Assignee | ||
Comment 17•7 years ago
|
||
Struggling with this a bit, this test still passes.
Comment 18•7 years ago
|
||
Pushed by mwoodrow@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/2e6d8283458c Always build a mask layer if we have rounded corners, regardless of the visible region since this might change on the compositor. r=mstange
Comment 19•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/2e6d8283458c
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox50:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla50
You need to log in
before you can comment on or make changes to this bug.
Description
•