Bug 234957

Summary: Expose iterators on AnimationList
Product: WebKit Reporter: Antoine Quint <graouts>
Component: AnimationsAssignee: Antoine Quint <graouts>
Status: RESOLVED FIXED    
Severity: Normal CC: darin, dino, esprehn+autocc, ews-watchlist, glenn, graouts, gyuyoung.kim, koivisto, macpherson, menard, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch koivisto: review+

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.