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-paint-api] Any way to pass JS Object/Var to the paint class or Set property as return value? #881
Comments
[css-paint-api]
Any way to pass JS Object/Var or Set property as return value?[css-paint-api]
Any way to pass JS Object/Var to the paint class or Set property as return value?
Can you explain what your use-case is? In general, the idea of the Paint API is that it creates a static image efficiently, and independently of any other code on the webpage. If you need to get information back out of your drawing code, it might be better to do the drawing with a regular canvas. |
The use case could be creating components like listbox/combobox that can display options in pseudo (before, after) elements. |
[css-paint-api]
Any way to pass JS Object/Var to the paint class or Set property as return value?
Unfortunately, using Paint API to replace the rendering of HTML elements (particularly text and interactive elements) is explicitly a non-goal for Paint API in its current form; doing it properly would require significant additional work in text rendering, layout, and accessibility to make the display remotely usable for users of the website. We do have plans for allowing more custom control over the painting phases of an element, but that's a future spec, and there is currently no timeline for working on that. |
@tabatkins I think you went too far. I didn't want the Paint API to be a replacement for HTMLElement, at least at this point. |
Consider the following code:
It seems that there is no relation between paint class inside of registerPaint and the globalScope, and also styleMap is readOnly.
How could we get the returned values?
The text was updated successfully, but these errors were encountered: