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

[css-typed-om] How is state change in CSSURLImageValue handled? #741

Open
gagyibenedek opened this issue Mar 29, 2018 · 2 comments
Open

Comments

@gagyibenedek
Copy link

Based on this example the state change doesn't trigger any callback, it just has a new value at the next repaint. Is this correct? This seems strange, since the example from above needs some kind of continuous repaint (e.g. an infinite animation) for it to make sense, otherwise the actual image will never be shown, only the sad face.

Also, the code from above doesn't work on the latest Chrome, it stays in the 'unloaded' state indefinitely. Not sure if this is a Chrome bug or the code from the draft is outdated.

@tabatkins
Copy link
Member

Because the property is of <image> type, it knows how to invalidate based on the loading state of images - when the image changes state, it'll automatically trigger a repaint, just like if you depended on a <length> property and changed the value.

Unsure about the possible bug, tho. @bfgeek?

@gagyibenedek
Copy link
Author

I see, that makes sense. Thanks for the quick answer!
I think this information could be added to the CSSImageValue object description, since it's different from the way asynch loading is usually done (callbacks or promises), and this may surprise people. Should I open a PR? Or is this something that's better off in the MDN docs?

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

No branches or pull requests

2 participants