Skip to content

Commit

Permalink
Move total-report window algorithm from source to report window list (#…
Browse files Browse the repository at this point in the history
…1082)

This will make it easier to reuse for Full Flex.
  • Loading branch information
apasel422 authored Oct 23, 2023
1 parent 2f80c94 commit 17ec657
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -634,14 +634,25 @@ A <dfn>report window</dfn> is a [=struct=] with the following items:

</dl>


A <dfn>report window list</dfn> is a [=list=] of [=report windows=].
It has the following constraints:

* Elements are in ascending order based on their [=report window/start=].
* Every element's [=report window/start=] is equal to the previous element's [=report window/end=], if it exists.
* There is at least one element in the list.

A [=report window list=] |list|'s <dfn for="report window list">total window</dfn> is
a [=report window=] [=struct=] with the following fields:

: [=report window/start=]
:: The [=report window/start=] of |list|[0].
: [=report window/end=]
:: The [=report window/end=] of |list|[|list|'s [=list/size=] - 1].

Note: The [=report window list/total window=] is conceptually a union of
[=report windows=], because there are no gaps in time between any of the
[=report windows|windows=].

<h3 id="trigger-data-matching-mode-header">Trigger-data matching mode</h3>

A <dfn>trigger-data matching mode</dfn> is one of the following:
Expand Down Expand Up @@ -718,17 +729,6 @@ An attribution source is a [=struct=] with the following items:

An [=attribution source=] |source|'s <dfn for="attribution source">expiry time</dfn> is |source|'s [=attribution source/source time=] + |source|'s [=attribution source/expiry=].

An [=attribution source=] |source|'s <dfn for="attribution source">total event-level report window</dfn> is
a [=report window=] [=struct=] with the following fields:

: [=report window/start=]
:: The [=report window/start=] of |source|'s first [=attribution source/event-level report window=].
: [=report window/end=]
:: The [=report window/end=] of |source|'s last [=attribution source/event-level report window=].

Note: The [=attribution source/total event-level report window=] is conceptually a union of [=report windows=], because there
are no gaps in time between any of the [=report windows|windows=] in [=attribution source/event-level report windows=].

An [=attribution source=] |source|'s <dfn for="attribution source">source site</dfn> is the result
of [=obtain a site|obtaining a site=] from |source|'s [=attribution source/source origin=].

Expand Down Expand Up @@ -2658,7 +2658,8 @@ To <dfn>trigger event-level attribution</dfn> given an [=attribution trigger=] |
1. Return the [=triggering result=] ("<code>[=triggering status/dropped=]</code>", |debugData|).
1. Let |windowResult| be the result of [=check whether a moment falls within a window=]
with |trigger|'s [=attribution trigger/trigger time=] and
|sourceToAttribute|'s [=attribution source/total event-level report window=].
|sourceToAttribute|'s [=attribution source/event-level report windows=]'s
[=report window list/total window=].
1. If |windowResult| is <strong>falls before</strong>:
1. Let |debugData| be the result of running [=obtain debug data on trigger registration=]
with "<code>[=trigger debug data type/trigger-event-report-window-not-started=]</code>",
Expand Down

0 comments on commit 17ec657

Please sign in to comment.