Apologies for filing this after #133, but I've only noticed this while reviewing #135 and checking other specs that use observers.
Calling a PressureUpdateCallback with a dictionary is semantically confusing, as:
A callback can change the PressureRecord object it receives but it will not have any effect whatsoever.
A PressureRecord's members are not required but they are all always filled in anyway.
MutationRecord, Report, IntersectionObserverEntry and PerformanceEntry are all IDL interfaces with read-only attributes, which better indicates how these data structures are supposed to be used.
Additionally, you could also use internal slots in PressureRecord if you make it an interface, which can also help with #132 if you e.g. use an internal slot with a set to represent factors.
(Note that if you do this factors needs to become a FrozenArray, as a sequence cannot be used as an attribute)
Apologies for filing this after #133, but I've only noticed this while reviewing #135 and checking other specs that use observers.
Calling a
PressureUpdateCallback
with a dictionary is semantically confusing, as:PressureRecord
object it receives but it will not have any effect whatsoever.PressureRecord
's members are notrequired
but they are all always filled in anyway.MutationRecord, Report, IntersectionObserverEntry and PerformanceEntry are all IDL interfaces with read-only attributes, which better indicates how these data structures are supposed to be used.
Additionally, you could also use internal slots in
PressureRecord
if you make it an interface, which can also help with #132 if you e.g. use an internal slot with a set to represent factors.(Note that if you do this
factors
needs to become a FrozenArray, as a sequence cannot be used as an attribute)