Bug 228693 - Calling unobserve on ResizeObserver should not clear existing observations in active targets
Summary: Calling unobserve on ResizeObserver should not clear existing observations in...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ryosuke Niwa
URL:
Keywords: InRadar
Depends on: 227194
Blocks:
  Show dependency treegraph
 
Reported: 2021-08-01 17:47 PDT by Ryosuke Niwa
Modified: 2021-08-03 23:48 PDT (History)
5 users (show)

See Also:


Attachments
Patch (8.23 KB, patch)
2021-08-01 18:10 PDT, Ryosuke Niwa
cdumez: review+
cdumez: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 2021-08-01 17:47:29 PDT
According to the spec https://drafts.csswg.org/resize-observer/#dom-resizeobserver-unobserve,
we should not be clearing the active targets when unobserve is called.
Comment 1 Ryosuke Niwa 2021-08-01 17:49:36 PDT
Looks like Chrome has the same bug so that's a bit concerning...
Comment 2 Ryosuke Niwa 2021-08-01 18:10:04 PDT
Created attachment 434729 [details]
Patch
Comment 3 Chris Dumez 2021-08-02 08:19:41 PDT
Comment on attachment 434729 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=434729&action=review

r=me with changelog fix.

> LayoutTests/ChangeLog:13
> +2021-08-01  Ryosuke Niwa  <rniwa@webkit.org>

double change log.
Comment 4 Ryosuke Niwa 2021-08-02 13:01:49 PDT
Comment on attachment 434729 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=434729&action=review

>> LayoutTests/ChangeLog:13
>> +2021-08-01  Ryosuke Niwa  <rniwa@webkit.org>
> 
> double change log.

Weird. Not sure what happened here. Will fix before landing.
Comment 5 Ryosuke Niwa 2021-08-02 13:03:19 PDT
Committed r280551 (240178@main): <https://commits.webkit.org/240178@main>
Comment 6 Radar WebKit Bug Importer 2021-08-02 13:04:24 PDT
<rdar://problem/81425446>
Comment 7 Aleksandar Totic 2021-08-03 23:44:27 PDT
This might be a spec misunderstanding:

From the spec:

[[activeTargets]] represents all Elements whose size has changed since last observation broadcast that are eligible for broadcast.

What makes an element eligible is not explicitly defined. 
My intuition is that calling "unobserve" on an elment should make it inelligible.
Comment 8 Aleksandar Totic 2021-08-03 23:48:13 PDT
Filed spec bug: https://github.com/w3c/csswg-drafts/issues/6493