What is the issue with the HTML Standard?
EventSource interaction with BFCache seems underspecified today.
As far as I can tell, the HTML Standard does not clearly define what should happen when an EventSource associated Document becomes non-fully-active due to entering the back/forward cache, and then later becomes fully active again when restored.
This appears to leave room for interop differences:
- Safari allows the page to enter BFCache, closes the
EventSource, and reconnects when the page is restored.
- Chrome is moving toward matching Safari's behavior.
- Firefox appears to keep such pages out of BFCache.
So I think it would be helpful to clarify the expected behavior for EventSource, for example along these lines:
- when a document becomes non-fully-active due to BFCache, its
EventSource should stop delivering events;
- the user agent may close / fail the active connection at that point;
- events that would have arrived while the document is in BFCache should not be queued for later delivery;
- when the document is restored and becomes fully active again, the
EventSource may resume through its normal reconnection behavior.
Relatedly, there is already BFCache-oriented guidance for spec in the TAG document “Supporting BFCached Documents”, but it seems like the normative clarification should live in the HTML Standard's EventSource processing model.
Would such a clarification be acceptable here? If so, I’d be happy to put together a PR.
cc: @ricea @rakina @annevk @zcorpan
What is the issue with the HTML Standard?
EventSourceinteraction with BFCache seems underspecified today.As far as I can tell, the HTML Standard does not clearly define what should happen when an
EventSourceassociated Document becomes non-fully-active due to entering the back/forward cache, and then later becomes fully active again when restored.This appears to leave room for interop differences:
EventSource, and reconnects when the page is restored.So I think it would be helpful to clarify the expected behavior for
EventSource, for example along these lines:EventSourceshould stop delivering events;EventSourcemay resume through its normal reconnection behavior.Relatedly, there is already BFCache-oriented guidance for spec in the TAG document “Supporting BFCached Documents”, but it seems like the normative clarification should live in the HTML Standard's
EventSourceprocessing model.Would such a clarification be acceptable here? If so, I’d be happy to put together a PR.
cc: @ricea @rakina @annevk @zcorpan