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

Paint worklets: Converting a URL to a CanvasImageSource? #17432

Closed
asajeffrey opened this issue Jun 20, 2017 · 0 comments
Closed

Paint worklets: Converting a URL to a CanvasImageSource? #17432

asajeffrey opened this issue Jun 20, 2017 · 0 comments

Comments

@asajeffrey
Copy link
Member

@asajeffrey asajeffrey commented Jun 20, 2017

$ ./mach run -d http://localhost:8000/css-paint-api/paint2d-image.html 
Loading blob blob:http://localhost:8000/43f4fe21df594cfe94e3413ea355e78b
Loading blob blob:http://localhost:8000/43f4fe21df594cfe94e3413ea355e78b
Loading blob blob:http://localhost:8000/43f4fe21df594cfe94e3413ea355e78b
TypeError: argument could not be converted to any of: HTMLImageElement, HTMLCanvasElement, CanvasRenderingContext2D

Paint worklets do not have access to HTML elements, so it's not obvious how to convert a URL to an argument to drawImage.

Spec issue: w3c/css-houdini-drafts#416

@asajeffrey asajeffrey self-assigned this Jun 20, 2017
bors-servo added a commit that referenced this issue Jul 21, 2017
Implement drawing an image from a CSS style value into a canvas

<!-- Please describe your changes on the following line: -->

Implemented drawing a CSS style value into a canvas, which is needed for the Houdini CSS Paint API.

This PR is dependent on #17364.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #17432.
- [X] These changes do not require tests because the existing CSS paint API wpt test cases test this behaviour.

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17634)
<!-- Reviewable:end -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

1 participant
You can’t perform that action at this time.