Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow setting thresholds #485

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

zcorpan
Copy link
Member

@zcorpan zcorpan commented Oct 21, 2021

Part of #428.

The following tasks have been completed:

  • Modified Web platform tests (link to pull request)

Implementation commitment:


Preview | Diff

Copy link
Collaborator

@emilio emilio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be nice to split this. Setting rootMargin should mostly be uncontroversial. Setting thresholds might require a bit more thought.

index.bs Outdated
readonly attribute DOMString rootMargin;
readonly attribute FrozenArray<double> thresholds;
attribute DOMString rootMargin;
attribute FrozenArray<double> thresholds;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think non-readonly FrozenArrays are a thing?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What should we use here?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably sequence<double>? Though not a webIDL expert so...

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ObservableArray<double> would be best, yeah. Attributes cannot be sequence<>s. You can have settable FrozenArray<>s, but the semantics are confusing, thus we invented ObservableArray<>...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
attribute FrozenArray&lt;double&gt; thresholds;
attribute ObservableArray&lt;double&gt; thresholds;

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, fixed.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ObservableArrays don't have on-getting/on-setting algorithms though. They need a different setup, "set an indexed value" and "delete an indexed value". See https://webidl.spec.whatwg.org/#idl-observable-array

@zcorpan
Copy link
Member Author

zcorpan commented Oct 26, 2021

rootMargin split to #486

I can edit this branch to only change thresholds. (Edit: done)

@zcorpan zcorpan changed the title Allow setting rootMargin and thresholds Allow setting thresholds Oct 26, 2021
Co-authored-by: Emilio Cobos Álvarez <[email protected]>
@szager-chromium
Copy link
Collaborator

As with modifying rootMargin, we need to specify the effect of modifying thresholds on previousThresholdIndex:

#486 (comment)

@domfarolino
Copy link
Member

This thread was buried in my inbox and I got to it by doing some cleaning up. Out of curiosity, is there any progress here? @zcorpan Do you plan to continue this?

@zcorpan
Copy link
Member Author

zcorpan commented Nov 25, 2022

@domfarolino if there's impl interest I can make a plan. :)

@domfarolino
Copy link
Member

I see. Maybe we can just ping @szager-chromium and @emilio, and I'm not sure for Apple? ....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants