whatwg / whatwg/html

How should BroadcastChannel and BFCache interact?

Open
#7,253 18 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

interop topic: history topic: serialize and transfer
Dominant language
HTML
Stars
9.4k
Forks
3.2k
PR merge metrics
PR metrics pending

Description

Forking off from #7252. I don't think this is urgently needed, just trying to gather all the info in one place.

If we all agreed that FF"s behaviour was the best we could get and that any messages sent while in the cache must cause eviction (e.g. because there was a fatal correctness issue with doing otherwise), then that seems reasonable to spec and to test. I don't think that's currently the case though.

@fergald I'm having trouble parsing this. What's the proposal you think makes sense as a path forward for standardization?

The question for BFCache is whether a message being sent to a BFCached frame should cause the frame/page to become unsalvageable. What's specced right now is that the message should not be delivered.. We can

1 leave it as is
2 spec that it makes it unsalvageable
3 spec that it may be queued and delivered if the page is restored (size of queue is up to implementation, marking as unsalvageable is OK at any point)
4 spec that it's dropped
5 note that it's currently unresolved

1 and 3 are somewhat equivalent in that if we don't disallow it, a browser is not out of spec for doing it (although it's following an unspecced queuing algorithm).

2 is Firefox's behaviour.
3 is nobody's behaviour but does not seem incompatible with current spec and doesn't seem raise security or privacy issues. It could be a surprise to some pages to receive events late or in quick succession as the queue is flushed (arguably no worse than if a page ran a very long task).
4 is nobody's behaviour either but dropping messages violates expectations of reliability

I would just like to avoid speccing or testing that we cannot queue and deliver later, unless someone has a strong reason for it being wrong.

@asutherland @wanderview @rubberyuzu @cdumez @domenic

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the BroadcastChannel postMessage section of the HTML Standard and the related discussion in issue #7252. Read the 18-comment thread to understand the competing BFCache behaviors and unresolved concerns. Done means reaching agreement on a behavior and reflecting that decision in the standard and its tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
html
Domain
web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.