-
Notifications
You must be signed in to change notification settings - Fork 37
Description
Looking at Chromium's implementation, I see a lot of "report body" interfaces:
ReportBody
CSPViolationReportBody
CoopAccessViolationReportBody
DeprecationReportBody
InterventionReportBody
DocumentPolicyViolationReportBody
FeaturePolicyViolationReportBody
However, most of these don't exist in specifications. And, many of them are using [NoInterfaceObject]
, which no longer exists on the web platform (it was removed from Web IDL).
I'm unsure how the spec is supposed to work here, and the specs definitely don't seem to match implementations.
-
The Reporting API's "queue a violation report" algorithm takes an "object". But, the
ReportingObserver
API usesReportBody
, so is there an implicit requirement that such objects be subclasses ofReportBody
? -
Some specs appear to fill this out using a generic "a new object" language, e.g. Fetch and COEP. This does not involve any interfaces. The proposed COOP reporting spec in Cross origin opener policy reporting whatwg/html#5518 does the same, although as noted above, the in-progress Chromium implementation seems to use an interface. How do these things show up in
ReportingObserver
? -
I can't figure out what the CSP spec is doing, but it certainly doesn't use
CSPViolationReportBody
. -
I can't find any spec for
InterventionReportBody
orDeprecationReportBody
. -
DocumentPolicyViolationReportBody
doesn't exist in Document Policy, and I can't find where that spec queues reports. Maybe that part isn't written yet? -
Permissions Policy seems to be fully on board the interface train: it declares a proper, non-NoInterfaceObject report body interface, and sends that through the "queue a violation report" algorithm.
This seems like a pretty big mess.
My recommendation if we were starting from scratch would be to not use interfaces for this, and have "queue a violation report" take either an object, or something more structured (like a record<USVString, any>
or an Infra ordered map) to give guidance to callers. Implementations could unobservably use IDL dictionaries behind the scenes if they wanted, but specs would use the Fetch/COEP/COOP style of just supplying a table of keys/values. And we'd get rid of ReportBody
entirely and make ReportingObserver
's body
just an object?
instead of a ReportBody?
.
However, we're not starting from scratch, so I'm unsure what the best path forward is.