Re: [whatwg] proposal: Add support for masking to canvas

2013-01-29 Thread Ian Hickson
On Wed, 30 Jan 2013, Boris Zbarsky wrote: > On 1/30/13 12:55 AM, Rik Cabanier wrote: > >void maskImage(optional MaskOptions options); > > > > Why is it optional? > > Because http://dev.w3.org/2006/webapi/WebIDL/#idl-operations says (if you > scroll down a ways): > > If the type of an a

Re: [whatwg] [Notifications] Constructor should not have side effects

2013-01-29 Thread Garrett Smith
On 1/29/13, Bjoern Hoehrmann wrote: > * Ryosuke Niwa wrote: >>On Jan 29, 2013, at 10:26 AM, Elliott Sprehn wrote: >>> For example you can do var request = new XMLHttp( ) at the start of >>> a >>> function, but then later decide you didn't want to send the request, and >>> never call send().

Re: [whatwg] proposal: Add support for masking to canvas

2013-01-29 Thread Boris Zbarsky
On 1/30/13 12:55 AM, Rik Cabanier wrote: void maskImage(optional MaskOptions options); Why is it optional? Because http://dev.w3.org/2006/webapi/WebIDL/#idl-operations says (if you scroll down a ways): If the type of an argument is a dictionary type or a union type that has a dic

Re: [whatwg] proposal: Add support for masking to canvas

2013-01-29 Thread Ian Hickson
On Wed, 30 Jan 2013, Boris Zbarsky wrote: > On 1/30/13 12:13 AM, Rik Cabanier wrote: > > ah, sorry. I looked at the dictionary for hitregions > > Sounds like we should consider fixing this hitregions thing whatever it is. The HitRegionOptions dictionary has (some) nullable members to allow the "

Re: [whatwg] proposal: Add support for masking to canvas

2013-01-29 Thread Rik Cabanier
On Tue, Jan 29, 2013 at 9:49 PM, Boris Zbarsky wrote: > On 1/30/13 12:37 AM, Rik Cabanier wrote: > >> enum CanvasMaskType { luminosity, alpha}; >> > > Last nits. Need quotes around the enum values. So: > > enum CanvasMaskType { "luminosity", "alpha" }; > > void maskImage(MaskOptions

Re: [whatwg] proposal: Add support for masking to canvas

2013-01-29 Thread Boris Zbarsky
On 1/30/13 12:37 AM, Rik Cabanier wrote: enum CanvasMaskType { luminosity, alpha}; Last nits. Need quotes around the enum values. So: enum CanvasMaskType { "luminosity", "alpha" }; void maskImage(MaskOptions options); I believe that has to be: void maskImage(optional MaskOpt

Re: [whatwg] proposal: Add support for masking to canvas

2013-01-29 Thread Rik Cabanier
I want to get it right! :-) After looking at the CG API, maybe imageSmoothing could be a part of the mask too. Third try: enum CanvasMaskType { luminosity, alpha}; dictionary MaskOptions { CanvasImageSource image; unrestricted double sx; unrestricted double sy; unrestricted double sw; unrestrict

Re: [whatwg] proposal: Add support for masking to canvas

2013-01-29 Thread Boris Zbarsky
On 1/30/13 12:13 AM, Rik Cabanier wrote: ah, sorry. I looked at the dictionary for hitregions Sounds like we should consider fixing this hitregions thing whatever it is. optional unrestricted double sx; That's not actually valid WebIDL, with the "optional". And that's because all d

Re: [whatwg] proposal: Add support for masking to canvas

2013-01-29 Thread Rik Cabanier
ah, sorry. I looked at the dictionary for hitregions and assumed that's how you make something optional in a dict [1] Second try: enum CanvasMaskType { luminosity, alpha}; dictionary maskOptions { CanvasImageSource image; optional unrestricted double sx; optional unrestricted double sy; optional

Re: [whatwg] proposal: Add support for masking to canvas

2013-01-29 Thread Tab Atkins Jr.
On Tue, Jan 29, 2013 at 9:04 PM, Boris Zbarsky wrote: > On 1/29/13 11:37 PM, Rik Cabanier wrote: >> >> So the API could be as follows: > > ... > >> unrestricted double? sx; >> unrestricted double? sy; > > > Do these actually need to be nullable? What's the use case for setting them > to null? > >

Re: [whatwg] proposal: Add support for masking to canvas

2013-01-29 Thread Boris Zbarsky
On 1/29/13 11:37 PM, Rik Cabanier wrote: So the API could be as follows: ... unrestricted double? sx; unrestricted double? sy; Do these actually need to be nullable? What's the use case for setting them to null? Same thing for the rest of this dictionary's members. -Boris

Re: [whatwg] proposal: Add support for masking to canvas

2013-01-29 Thread Tab Atkins Jr.
On Tue, Jan 29, 2013 at 8:37 PM, Rik Cabanier wrote: > So the API could be as follows: > > enum CanvasMaskType { luminosity, alpha}; > dictionary maskOptions { > > CanvasImageSource image; > unrestricted double? sx; > unrestricted double? sy; > unrestricted double? sw; > unrestricted double? sh; >

Re: [whatwg] remove resetClip from the Canvas 2D spec

2013-01-29 Thread Rik Cabanier
On Tue, Jan 29, 2013 at 8:28 PM, Charles Pritchard wrote: > On 1/29/2013 8:23 PM, Tab Atkins Jr. wrote: > >> On Tue, Jan 29, 2013 at 6:10 PM, Rik Cabanier wrote: >> >>> It restores the graphics state back to the state at 'save' time and this >>> includes the clip area. >>> 'Clip' is a nested ope

Re: [whatwg] remove resetClip from the Canvas 2D spec

2013-01-29 Thread Rik Cabanier
On Tue, Jan 29, 2013 at 8:23 PM, Tab Atkins Jr. wrote: > On Tue, Jan 29, 2013 at 6:10 PM, Rik Cabanier wrote: > > It restores the graphics state back to the state at 'save' time and this > > includes the clip area. > > 'Clip' is a nested operation so every clip will be the intersection of > the >

Re: [whatwg] proposal: Add support for masking to canvas

2013-01-29 Thread Rik Cabanier
Thanks! I like that better too. So the API could be as follows: enum CanvasMaskType { luminosity, alpha}; dictionary maskOptions { CanvasImageSource image; unrestricted double? sx; unrestricted double? sy; unrestricted double? sw; unrestricted double? sh; unrestricted double dx; unrestricted dou

Re: [whatwg] remove resetClip from the Canvas 2D spec

2013-01-29 Thread Tab Atkins Jr.
On Tue, Jan 29, 2013 at 6:10 PM, Rik Cabanier wrote: > It restores the graphics state back to the state at 'save' time and this > includes the clip area. > 'Clip' is a nested operation so every clip will be the intersection of the > existing clip area and the new one. > > PDF also has no initclip/

Re: [whatwg] proposal: Add support for masking to canvas

2013-01-29 Thread Tab Atkins Jr.
On Tue, Jan 29, 2013 at 7:30 PM, Rik Cabanier wrote: > Do you believe it's OK to have 12 arguments or would a dictionary be better? No, it's not okay. ^_^ Particularly when some of the parameters are boolean - boolean positional arguments are the devil. Go with a dict. ~TJ

Re: [whatwg] proposal: Add support for masking to canvas

2013-01-29 Thread Rik Cabanier
Jatinder, I forgot to ask what you think of the API itself. Do you believe it's OK to have 12 arguments or would a dictionary be better? Rik On Tue, Jan 29, 2013 at 5:34 PM, Jatinder Mann wrote: > Seeing that alpha and luminance masking is definitely useful, I would > like to see them added t

Re: [whatwg] proposal: Add support for masking to canvas

2013-01-29 Thread Rik Cabanier
luminance would be calculated the same as for compositing and blending: https://dvcs.w3.org/hg/FXTF/rawfile/tip/compositing/index.html#blendingnonseparable This is done with no adjustment for gamma. Maybe we can add real ICC color management later so you can blend/mask in other RGB colorspaces o

Re: [whatwg] remove resetClip from the Canvas 2D spec

2013-01-29 Thread Rik Cabanier
On Tue, Jan 29, 2013 at 5:27 PM, Tab Atkins Jr. wrote: > On Tue, Jan 29, 2013 at 5:00 PM, Rik Cabanier wrote: > > All, > > > > we were looking at how resetClip [1] could be implemented in WebKit. > > Looking over the Core Graphics implementation, this feature can't be > > implemented without sign

Re: [whatwg] remove resetClip from the Canvas 2D spec

2013-01-29 Thread Tab Atkins Jr.
On Tue, Jan 29, 2013 at 5:00 PM, Rik Cabanier wrote: > All, > > we were looking at how resetClip [1] could be implemented in WebKit. > Looking over the Core Graphics implementation, this feature can't be > implemented without significant overhead. I also found an email from 2007 > where Maciej sta

[whatwg] [Canvas] Behavior on non-invertable CTM

2013-01-29 Thread Dirk Schulze
Hi, The spec doesn't have any wording about the behavior on non-invertible CTMs on Canvas contexts. Is it still possible to add segments to the current path once a CTM is not invertible anymore? Does the path get rejected completely then? Implementations are fairly different. Here are two exam

Re: [whatwg] [Notifications] Constructor should not have side effects

2013-01-29 Thread Bjoern Hoehrmann
* Ryosuke Niwa wrote: >On Jan 29, 2013, at 10:26 AM, Elliott Sprehn wrote: >> For example you can do var request = new XMLHttp( ) at the start of a >> function, but then later decide you didn't want to send the request, and >> never call send(). > >Is that even a valid use case? It seems dubi

Re: [whatwg] remove resetClip from the Canvas 2D spec

2013-01-29 Thread Simon Sarris
I opened the bug about this originally back in 2011, asking that it be added (it was in March 2012 to the WHATWG spec). For the sake of the discussion that bug is here: https://www.w3.org/Bugs/Public/show_bug.cgi?id=14499 The reason is that (almost) every single piece of canvas context state can

[whatwg] remove resetClip from the Canvas 2D spec

2013-01-29 Thread Rik Cabanier
All, we were looking at how resetClip [1] could be implemented in WebKit. Looking over the Core Graphics implementation, this feature can't be implemented without significant overhead. I also found an email from 2007 where Maciej states the same concern. [2] Since no browser has implemented it, c

Re: [whatwg] [Notifications] Constructor should not have side effects

2013-01-29 Thread Glenn Maynard
On Jan 29, 2013 12:07 PM, "Stewart Brodie" wrote: > For example, how can you add event listeners to something that doesn't > exist yet? Particularly if you want to use a closure with the new object. > The same way as always: just attach the listener. You can't "miss" events, since it's guaran

Re: [whatwg] [Notifications] Constructor should not have side effects

2013-01-29 Thread Garrett Smith
On 1/29/13, Elliott Sprehn wrote: > On Tue, Jan 29, 2013 at 10:38 AM, Jake Archibald > wrote: > >> On 29 January 2013 05:36, Charles McCathie Nevile >> wrote: >> >> Exactly. And if we designed XMLHttpRequest from scratch it would have >> them >> >> too. >> > >> > Really? This doesn't seem like a

Re: [whatwg] [Notifications] Constructor should not have side effects

2013-01-29 Thread Ryosuke Niwa
On Jan 29, 2013, at 12:41 PM, Elliott Sprehn wrote: > On Tue, Jan 29, 2013 at 3:32 PM, Ian Hickson wrote: > On Tue, 29 Jan 2013, Elliott Sprehn wrote: > > On Tue, Jan 29, 2013 at 3:02 PM, Ryosuke Niwa wrote: > > > > > > ... Is that even a valid use case? It seems dubious to instantiate a > > >

Re: [whatwg] [Notifications] Constructor should not have side effects

2013-01-29 Thread Elliott Sprehn
On Tue, Jan 29, 2013 at 3:32 PM, Ian Hickson wrote: > On Tue, 29 Jan 2013, Elliott Sprehn wrote: > > On Tue, Jan 29, 2013 at 3:02 PM, Ryosuke Niwa wrote: > > > > > > ... Is that even a valid use case? It seems dubious to instantiate a > > > class named "request" and then not send a request. > >

Re: [whatwg] [Notifications] Constructor should not have side effects

2013-01-29 Thread Ian Hickson
On Tue, 29 Jan 2013, Elliott Sprehn wrote: > On Tue, Jan 29, 2013 at 3:02 PM, Ryosuke Niwa wrote: > > > > ... Is that even a valid use case? It seems dubious to instantiate a > > class named "request" and then not send a request. > > You can't go down that line of thinking because it doesn't gene

Re: [whatwg] [Notifications] Constructor should not have side effects

2013-01-29 Thread Elliott Sprehn
On Tue, Jan 29, 2013 at 3:02 PM, Ryosuke Niwa wrote: > ... > Is that even a valid use case? It seems dubious to instantiate a class > named "request" and then not send a request. > > You can't go down that line of thinking because it doesn't generalize. For instance why would I instantiate a clas

Re: [whatwg] [Notifications] Constructor should not have side effects

2013-01-29 Thread Ian Hickson
On Tue, 29 Jan 2013, Ryosuke Niwa wrote: > > > > It also lets you create clean abstractions and layers so one library > > may create the notification, but another one may eventually show it. > > This seems like a valid concern. Do existing libraries do this with XHR > and other objects that sep

Re: [whatwg] [Notifications] Constructor should not have side effects

2013-01-29 Thread Ryosuke Niwa
On Jan 29, 2013, at 10:26 AM, Elliott Sprehn wrote: > On Tue, Jan 29, 2013 at 10:38 AM, Jake Archibald > wrote: > >> On 29 JanuaJake Archibald ry 2013 05:36, Charles >> McCathie Nevile >> wrote: Exactly. And if we designed XMLHttpRequest from scratch it would have >> them too. >>>

Re: [whatwg] [Notifications] Constructor should not have side effects

2013-01-29 Thread Ian Hickson
On Tue, 29 Jan 2013, Elliott Sprehn wrote: > On Tue, Jan 29, 2013 at 10:38 AM, Jake Archibald wrote: > > > > Why doesn't it seem like a good idea? Is there a use-case for creating > > a Notification/XMLHttpRequest/WebSocket/EventSource without performing > > their action? > > Yes, because decoup

Re: [whatwg] [Notifications] Constructor should not have side effects

2013-01-29 Thread Elliott Sprehn
On Tue, Jan 29, 2013 at 10:38 AM, Jake Archibald wrote: > On 29 January 2013 05:36, Charles McCathie Nevile > wrote: > >> Exactly. And if we designed XMLHttpRequest from scratch it would have > them > >> too. > > > > Really? This doesn't seem like a good idea, so I'd be interested to know > > why

Re: [whatwg] [Notifications] Constructor should not have side effects

2013-01-29 Thread Stewart Brodie
Glenn Maynard wrote: > On Tue, Jan 29, 2013 at 7:36 AM, Charles McCathie Nevile < > cha...@yandex-team.ru> wrote: > > > Really? This doesn't seem like a good idea, so I'd be interested to know > > why. Is there an explanation laid out somewhere? > > Just to ask from another perspective: why doe

[whatwg] [canvas] coordinate space definition bogus?

2013-01-29 Thread Dirk Schulze
Hi, I think the definition of "coordinate space" is misleading in the specification. "" The canvas element has two attributes to control the size of the coordinate space: width and height. "" This implies that the coordinate space is limited by this size. This is not the case. The coordinate

Re: [whatwg] The canvas 2D context resetClip() function

2013-01-29 Thread Rik Cabanier
Has it been implemented by 2 browsers? The W3 version should only contain APIs that are available. On Tue, Jan 29, 2013 at 3:35 AM, Richard wrote: > Hi, > > In March 2012 there were a number of additions to the canvas 2D > context - including the resetClip() function. However I can't now find >

Re: [whatwg] [Notifications] Constructor should not have side effects

2013-01-29 Thread Glenn Maynard
On Tue, Jan 29, 2013 at 7:36 AM, Charles McCathie Nevile < cha...@yandex-team.ru> wrote: > Really? This doesn't seem like a good idea, so I'd be interested to know > why. Is there an explanation laid out somewhere? > Just to ask from another perspective: why doesn't it seem like a good idea? Hav

Re: [whatwg] [Notifications] Constructor should not have side effects

2013-01-29 Thread Jake Archibald
On 29 January 2013 05:36, Charles McCathie Nevile wrote: >> Exactly. And if we designed XMLHttpRequest from scratch it would have them >> too. > > Really? This doesn't seem like a good idea, so I'd be interested to know > why. Is there an explanation laid out somewhere? Why doesn't it seem like a

Re: [whatwg] Make the files attribute of the input element writable

2013-01-29 Thread Garrett Smith
On 1/17/13, Ian Hickson wrote: > On Fri, 7 Dec 2012, Victor Costan wrote: >> On Wed, Dec 5, 2012 at 12:11 PM, Ian Hickson wrote: >> > On Wed, 5 Dec 2012, Victor Costan wrote: >> >> >> >> There was a thread on this mailing list discussing making it possible >> >> to set the file data behind an el

Re: [whatwg] [Notifications] Constructor should not have side effects

2013-01-29 Thread Charles McCathie Nevile
On Tue, 29 Jan 2013 11:28:01 +0100, Anne van Kesteren wrote: On Mon, Jan 28, 2013 at 11:41 PM, Olli Pettay wrote: WebSocket, EventSource etc ctors do have "side effects". Exactly. And if we designed XMLHttpRequest from scratch it would have them too. Really? This doesn't seem like a

Re: [whatwg] The canvas 2D context resetClip() function

2013-01-29 Thread Richard
Hi, > The spec has it > http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-resetclip Thanks - was looking at the version of the spec on w3.org. -- Richard

Re: [whatwg] Make the files attribute of the input element writable

2013-01-29 Thread Mounir Lamouri
On 07/12/12 21:42, Victor Costan wrote: > On Wed, Dec 5, 2012 at 12:11 PM, Ian Hickson wrote: >> On Wed, 5 Dec 2012, Victor Costan wrote: >>> >>> There was a thread on this mailing list discussing making it possible to >>> set the file data behind an element. >>> http://lists.whatwg.org/htdig.cgi

Re: [whatwg] The canvas 2D context resetClip() function

2013-01-29 Thread Olli Pettay
On 01/29/2013 01:35 PM, Richard wrote: Hi, In March 2012 there were a number of additions to the canvas 2D context - including the resetClip() function. However I can't now find this function mentioned in the spec (http://www.w3.org/html/wg/drafts/2dcontext/html5_canvas/). Has it been removed?

[whatwg] The canvas 2D context resetClip() function

2013-01-29 Thread Richard
Hi, In March 2012 there were a number of additions to the canvas 2D context - including the resetClip() function. However I can't now find this function mentioned in the spec (http://www.w3.org/html/wg/drafts/2dcontext/html5_canvas/). Has it been removed? Thanks. -- Richard

Re: [whatwg] [Notifications] Constructor should not have side effects

2013-01-29 Thread Anne van Kesteren
On Mon, Jan 28, 2013 at 11:41 PM, Olli Pettay wrote: > WebSocket, EventSource etc ctors do have "side effects". Exactly. And if we designed XMLHttpRequest from scratch it would have them too. -- http://annevankesteren.nl/

Re: [whatwg] Proposal: HTMLCanvasElement.printCallback API

2013-01-29 Thread Robert O'Callahan
On Tue, Jan 29, 2013 at 7:33 PM, Elliott Sprehn wrote: > Why can't I do this for or or any number of other things > then? All those things want to be beautiful when printed too. :) In that > world I really think we want something closer to Element#printCallback. > That doesn't make sense to m