Bug 234957 - Expose iterators on AnimationList
Summary: Expose iterators on AnimationList
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Animations (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Antoine Quint
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-01-07 07:42 PST by Antoine Quint
Modified: 2022-01-07 11:11 PST (History)
11 users (show)

See Also:


Attachments
Patch (9.57 KB, patch)
2022-01-07 07:43 PST, Antoine Quint
koivisto: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Antoine Quint 2022-01-07 07:42:17 PST
Expose iterators on AnimationList
Comment 1 Antoine Quint 2022-01-07 07:43:08 PST
Created attachment 448589 [details]
Patch
Comment 2 Darin Adler 2022-01-07 09:12:17 PST
Comment on attachment 448589 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=448589&action=review

> Source/WebCore/platform/animation/AnimationList.h:63
> +    using const_reverse_iterator = Vector<Ref<Animation>>::const_reverse_iterator;
> +    const_reverse_iterator rbegin() const { return m_animations.rbegin(); }
> +    const_reverse_iterator rend() const { return m_animations.rend(); }

Pretty sure you can just use auto:

    auto rbegin() const { return m_animations.rbegin(); }
Comment 3 Antoine Quint 2022-01-07 10:48:56 PST
Committed r287762 (245825@trunk): <https://commits.webkit.org/245825@trunk>
Comment 4 Radar WebKit Bug Importer 2022-01-07 10:49:30 PST
<rdar://problem/87261244>
Comment 5 Antoine Quint 2022-01-07 11:11:19 PST
(In reply to Darin Adler from comment #2)
> Comment on attachment 448589 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=448589&action=review
> 
> > Source/WebCore/platform/animation/AnimationList.h:63
> > +    using const_reverse_iterator = Vector<Ref<Animation>>::const_reverse_iterator;
> > +    const_reverse_iterator rbegin() const { return m_animations.rbegin(); }
> > +    const_reverse_iterator rend() const { return m_animations.rend(); }
> 
> Pretty sure you can just use auto:
> 
>     auto rbegin() const { return m_animations.rbegin(); }

Sadly, not possible, see https://webkit.slack.com/archives/C01ARTA5TDM/p1641565899019200?thread_ts=1641557977.011000&cid=C01ARTA5TDM.