@@ -377,9 +377,9 @@ called once per observation. Instead, multiple observations can be batched into
377
377
one single call. This means that there is not always a single JS action that causes
378
378
some work that eventually triggers the observer callback; rather, there might be many.
379
379
380
- Given this, for consistency it would be preferable to instead propagate the context that
381
- was active when the observer callback was registered; that is, the context in which the
382
- class is constructed .
380
+ Given this, observer callbacks should always run with the empty context. This can be explained
381
+ by saying that layout changes are always considered to be a browser-internal trigger, even if
382
+ they were caused by changes injected into the DOM or styles through JavaScript .
383
383
384
384
- [ ` MutationObserver ` ] ( https://dom.spec.whatwg.org/#mutationobserver )
385
385
[ \[ DOM\] ] ( https://dom.spec.whatwg.org/ )
@@ -392,12 +392,12 @@ class is constructed.
392
392
- [ ` ReportingObserver ` ] ( https://w3c.github.io/reporting/#reportingobserver )
393
393
[ \[ REPORTING\] ] ( https://w3c.github.io/reporting/ )
394
394
395
- > [ !IMPORTANT ]
396
- > Due to concerns about observers leading to memory leaks, an alternative
397
- > option is to not use the context from when the observer was created, and instead call the observer's
398
- > callback with the empty context. This is coherent with the general design direction
399
- > of using the dispatch context, except that we would say that these observers are always
400
- > triggered as consequences of browser-internal code .
395
+ > [ !NOTE ]
396
+ > An older version of this proposal suggested to capture the context at the time the observer
397
+ > is create, and use it to run the callback. This has been removed due to memory leak concerns.
398
+ >
399
+ > It's under discussion wether observers should use the same mechanism as events (see below)
400
+ > to define a scoped fallback value for some ` AsyncContext.Variable ` s .
401
401
402
402
In some cases it might be useful to expose the causal context for individual
403
403
observations, by exposing an ` AsyncContext.Snapshot ` property on the observation
0 commit comments