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

Layers: Layer based scoring API #12650

Closed
jridgewell opened this issue Jan 3, 2018 · 2 comments
Closed

Layers: Layer based scoring API #12650

jridgewell opened this issue Jan 3, 2018 · 2 comments

Comments

@jridgewell
Copy link
Contributor

#11830 (comment)

Internally we can do math as we need. My question is what API we export outside and what API is actually needed. Local position, i.e. {layer, topInLayer, leftInLayer} totally always makes sense. But absolute position might not really exist in a general case, or it could be some weird that it'd be only usable in few cases, such as document ad position. But for runtime's scheduling what do we need?

  • In-layer local top/left: clear.
  • Intersection with any layer/viewport: intersection ratio is a great API and very clear and unambiguous.
  • Scheduling scores: might be easier to pass a hierarchy-walker style callback to calculate double values?

Also, I have a performance question about the same: in theory calculating intersection ratio and distance scores does not require us to constantly recalculate structs of the form {top, left, right, bottom}. This likely would be impactful if these structs depend on scroll position and would help reduce object creates.

@ampprojectbot
Copy link
Member

This is a high priority issue but it hasn't been updated in awhile. @jridgewell Do you have any updates?

@jridgewell
Copy link
Contributor Author

jridgewell commented Jan 29, 2018

@ampprojectbot is sooo needy. PR is #12958.

@jridgewell jridgewell added this to TODO in Layers via automation Jan 30, 2018
@jridgewell jridgewell moved this from TODO to In Progress in Layers Jan 30, 2018
Layers automation moved this from In Progress to Done Jan 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Layers
  
Done
Development

No branches or pull requests

2 participants