Re: [w3c/ServiceWorker] Should the order of registrations returned by getRegistrations() be sorted by scope? (#1465)

Per https://searchfox.org/mozilla-central/rev/9415ecf29ba1acbef9381335e0ecde5916ca4073/dom/serviceworkers/ServiceWorkerManager.cpp#1678 we apparently order such that:
```cpp
    // Sort by length, with longest match first.
    // /foo/bar should be before /foo/
    // Similarly /foo/b is between the two.
```

This is an outgrowth of https://github.com/w3c/ServiceWorker/issues/287 deciding on longest prefix match now codified in https://w3c.github.io/ServiceWorker/#scope-match-algorithm.  We store things as an ordered list, and we order the list so that if we traverse the list in order, we will naturally find the longest prefix first.

This seems better than FIFO order to me and most consistent with the rest of the spec implementation.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/ServiceWorker/issues/1465#issuecomment-526984507

Received on Monday, 2 September 2019 02:56:56 UTC