Bug 238441 - Implement ServiceWorker WindowClient.ancestorOrigins
Summary: Implement ServiceWorker WindowClient.ancestorOrigins
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Service Workers (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: youenn fablet
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-03-28 02:06 PDT by youenn fablet
Modified: 2022-03-31 00:52 PDT (History)
17 users (show)

See Also:


Attachments
Patch (15.81 KB, patch)
2022-03-28 03:40 PDT, youenn fablet
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (17.71 KB, patch)
2022-03-28 06:03 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch (19.61 KB, patch)
2022-03-28 06:59 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch for landing (22.59 KB, patch)
2022-03-30 03:05 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch (5.08 KB, patch)
2022-03-30 10:24 PDT, Rob Buis
no flags Details | Formatted Diff | Diff
Patch (5.83 KB, patch)
2022-03-30 10:27 PDT, Rob Buis
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description youenn fablet 2022-03-28 02:06:50 PDT
Implement ServiceWorker WindowClient.ancestorOrigins
Comment 1 youenn fablet 2022-03-28 03:40:27 PDT
Created attachment 455895 [details]
Patch
Comment 2 youenn fablet 2022-03-28 06:03:43 PDT
Created attachment 455910 [details]
Patch
Comment 3 youenn fablet 2022-03-28 06:59:30 PDT
Created attachment 455913 [details]
Patch
Comment 4 Chris Dumez 2022-03-29 08:51:14 PDT
Comment on attachment 455913 [details]
Patch

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

r=me but watch out before landing because I think I found a correctness bug.

> Source/WebCore/workers/service/ServiceWorkerClientData.cpp:62
> +    return { identifier, type, frameType, url.isolatedCopy(), lastNavigationWasAppInitiated, isVisible, isFocused, focusOrder, ancestorOrigins };

I bet this should be `crossThreadCopy(ancestorOrigins)`, not `ancestorOrigins`.

> Source/WebCore/workers/service/ServiceWorkerClientData.cpp:80
> +    while (frame) {

nit: I personally think this would look nicer as a for loop (see how it is already implemented in Location::ancestorOrigins()).

> Source/WebCore/workers/service/ServiceWorkerWindowClient.h:46
> +    bool focused() const { return data().isFocused; }

Not a fan of this change as it seems to go against coding style. Booleans without prefixes don't look great.
Comment 5 youenn fablet 2022-03-30 00:49:07 PDT
(In reply to Chris Dumez from comment #4)
> Comment on attachment 455913 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=455913&action=review
> 
> r=me but watch out before landing because I think I found a correctness bug.

Thanks, will fix it.
Comment 6 youenn fablet 2022-03-30 03:05:18 PDT
Created attachment 456108 [details]
Patch for landing
Comment 7 EWS 2022-03-30 06:29:14 PDT
Committed r292105 (249025@main): <https://commits.webkit.org/249025@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 456108 [details].
Comment 8 Radar WebKit Bug Importer 2022-03-30 06:30:22 PDT
<rdar://problem/91041206>
Comment 9 Rob Buis 2022-03-30 10:24:39 PDT
Reopening to attach new patch.
Comment 10 Rob Buis 2022-03-30 10:24:42 PDT
Created attachment 456140 [details]
Patch
Comment 11 EWS Watchlist 2022-03-30 10:26:27 PDT
This patch modifies the imported WPT tests. Please ensure that any changes on the tests (not coming from a WPT import) are exported to WPT. Please see https://trac.webkit.org/wiki/WPTExportProcess
Comment 12 Rob Buis 2022-03-30 10:27:57 PDT
Created attachment 456142 [details]
Patch
Comment 13 Rob Buis 2022-03-30 10:30:45 PDT
Uploaded to wrong bug.