From 9d6b9797c077977ae3bcea66cc7d3d301001be28 Mon Sep 17 00:00:00 2001 From: alvinhochun Date: Thu, 24 Sep 2020 22:30:26 +0800 Subject: [PATCH] Clarify ControlFlow::Poll doc for web (#1725) Make it clear that ControlFlow::Poll causing events to be sent on `requestAnimationFrame` is an implementation detail which should not be relied on. --- src/event_loop.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/event_loop.rs b/src/event_loop.rs index efc67efd..edc5670a 100644 --- a/src/event_loop.rs +++ b/src/event_loop.rs @@ -74,9 +74,11 @@ pub enum ControlFlow { /// When the current loop iteration finishes, immediately begin a new iteration regardless of /// whether or not new events are available to process. /// - /// For web, events are queued and usually sent when `requestAnimationFrame` fires but sometimes - /// the events in the queue may be sent before the next `requestAnimationFrame` callback, for - /// example when the scaling of the page has changed. + /// ## Platform-specific + /// - **Web:** Events are queued and usually sent when `requestAnimationFrame` fires but sometimes + /// the events in the queue may be sent before the next `requestAnimationFrame` callback, for + /// example when the scaling of the page has changed. This should be treated as an implementation + /// detail which should not be relied on. Poll, /// When the current loop iteration finishes, suspend the thread until another event arrives. Wait,