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-paint-api] Add inputArguments to paint API #219

Closed
bfgeek opened this issue Jun 13, 2016 · 3 comments
Closed

[css-paint-api] Add inputArguments to paint API #219

bfgeek opened this issue Jun 13, 2016 · 3 comments

Comments

@bfgeek
Copy link
Contributor

bfgeek commented Jun 13, 2016

Syntax...

registerPaint('foo', class {
  static get inputArguments() { return ['<length>', '<number>']; }

  paint(ctx, geom, styleMap, args) {
    args[0] instanceof CSSLengthValue; // true
    args[1] instanceof CSSNumberValue;  // true
  }
});
@bfgeek
Copy link
Contributor Author

bfgeek commented Oct 11, 2016

background-image: paint(foo, 2px, 42);

@dmvaldman
Copy link

If this notation is adopted, is the inputArguments getter still necessary?

If that method is for caching purposes, it seems it wouldn't be necessary as you'd know when the cache is busted because this new notation explicitly defines the input arguments.

@tabatkins
Copy link
Member

I'm confused by your question - did you mean to refer to something else?

The inputArguments getter specifies the types of the arguments, so we know how to parse and expose them to the paint() function.

@bfgeek bfgeek closed this as completed in d2feee6 Apr 10, 2017
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

3 participants