Closed Bug 1746094 Opened 4 years ago Closed 3 years ago

Need to check if the scroller is a scroll container for scroll timeline

Categories

(Core :: CSS Transitions and Animations, defect, P3)

defect

Tracking

()

RESOLVED DUPLICATE of bug 1754897

People

(Reporter: boris, Assigned: boris)

References

(Blocks 1 open bug)

Details

Attachments

(1 obsolete file)

Per the matrix discussion (1, 2), we didn't handle well in some cases in GetCurrentTimeAsDuration(). For example where overflow-x: clip; overflow-y: scroll and scroll timeline orientation is inline. We probably don't handle well this case. We have to refine this part and add some more tests.

Explanation from hiro: in my understanding generating nsIScrollableFrame matches scroll container in the spec, so for overflow-x:clip;overflow-y:scroll will generate it, but yeah, in such cases we don't return null for x-axis timeline, that's what I meant.

Summary: Need to check if the scroller is a scroller container for scroll timeline → Need to check if the scroller is an active scroll container for scroll timeline
Summary: Need to check if the scroller is an active scroll container for scroll timeline → Need to check if the scroller is a scroll container for scroll timeline
See Also: → 1746146
Assignee: nobody → boris.chiou
Status: NEW → ASSIGNED

(In reply to Boris Chiou [:boris] from comment #1)

Explanation from hiro: in my understanding generating nsIScrollableFrame matches scroll container in the spec, so for overflow-x:clip;overflow-y:scroll will generate it, but yeah, in such cases we don't return null for x-axis timeline, that's what I meant.

Note: it's impossible to have a scroller with overflow-x:clip;overflow-y:scroll. In this case, overflow-y:clip will be converted into overflow-y:hidden, based on the spec [1] (gecko code):

as specified, except with visible/clip computing to auto/hidden (respectively) if one of overflow-x or overflow-y is neither visible nor clip

Besides, if the scroller is not a scroll container, we don't create the scroll frame because we check IsScrollableOverflow() when building a scroll frame in nsCSSFrameConstructor. So I think our current code should be OK. The only exception is the root scroll frame. It seem we generate the root scroll frame always, so setting overflow:clip for html element still generate the root scroll frame. Therefore, this bug doesn't have to do anything on Gecko. Perhaps adding a test is enough.

[1] https://drafts.csswg.org/css-overflow-3/#scroll-container

Based on
https://drafts.csswg.org/scroll-animations-1/#current-time-algorithm,
if the source is not a scroll container, we return unresolved current
time (i.e. inactive timeline), so the animation effect is not applied to
the target.

Gecko checks overflow property when building scroll frame, so if
this frame is not a scroll container, we don't build a scroll frame for
it, and ScrollTimeline::GetScrollFrame() should return nullptr for this
case.

The root element is a special case because we always generate the root
scroll frame, so if the source is the root element, the animation still works
even if we set overflow:clip for html. This makes us match the behavior in
Chromium.

Attachment #9263386 - Attachment description: Bug 1746094 - Add a reftest when the scroller is not a scroll container. → Bug 1746094 - Add a reftest for a source which is not a scroll container.
Attachment #9263386 - Attachment description: Bug 1746094 - Add a reftest for a source which is not a scroll container. → Bug 1746094 - Add a test case for a source which is not a scroll container.
Depends on: 1754897
No longer depends on: 1754897

I added the related test in the patch (https://phabricator.services.mozilla.com/D146358) already. So close this bug.

Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → DUPLICATE
Attachment #9263386 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: