Benjamin Joffe | 1 Jul 2006 11:11
Picon

Canvas 2d methods

Each of the methods defined for the canvas 2d context return null. I think it would be very convenient if instead they would return a reference to the 2d context for that canvas. This would allow writing such code as ctx.fill ().stroke() or ctx.moveTo(0,0).lineTo(10,10). This is how many of the native string and array methods work in javaScript.

dolphinling | 1 Jul 2006 15:23

Re: [html5] HTMLMapElement.images

Anne van Kesteren wrote:
> Quoting Shadow2531 <shadow2531@...>:
>> On 6/13/06, Anne van Kesteren <fora@...> wrote:
>>> Before I forget about this hereby a proposal to give the
>>> HTMLMapElement interface a new (readonly) member called `images` or
>>> equivalent representing an HTMLCollection consisting of
>>> HTMLImageElement and HTMLObjectElement (and perhaps
>>> HTMLCanvasElement?) elements that use that image map definition.
>>
>> Do you want the INPUT element in the collection too? (because of  
>> type="image")
> 
> Probably only when type="image", but yes.

Can you even have an image map on an <input type="image"> ?

--

-- 
dolphinling
<http://dolphinling.net/>

Vladimir Vukicevic | 2 Jul 2006 03:20
Picon

Re: Canvas 2d methods

On 7/1/06, Benjamin Joffe <canvasgame@...> wrote:
> Each of the methods defined for the canvas 2d context return null. I think
> it would be very convenient if instead they would return a reference to the
> 2d context for that canvas. This would allow writing such code as ctx.fill
> ().stroke() or ctx.moveTo(0,0).lineTo(10,10). This is how many of the native
> string and array methods work in javaScript.

This isn't a bad idea; the problem is that the cat's already out of
the bag here, and developers will end up writing ctx.moveTo()
ctx.lineTo() etc. for compatability.  I'm a fan of "with" in this
instance:  with (ctx) { moveTo(0,0); lineTo(10,10); } etc.

   - Vlad

Andrew Fedoniouk | 2 Jul 2006 04:54
Favicon

Re: Canvas 2d methods


----- Original Message ----- 
From: "Vladimir Vukicevic" <vladimirv@...>
To: "Benjamin Joffe" <canvasgame@...>
Cc: <whatwg@...>
Sent: Saturday, July 01, 2006 6:20 PM
Subject: Re: [whatwg] Canvas 2d methods

> On 7/1/06, Benjamin Joffe <canvasgame@...> wrote:
>> Each of the methods defined for the canvas 2d context return null. I 
>> think
>> it would be very convenient if instead they would return a reference to 
>> the
>> 2d context for that canvas. This would allow writing such code as 
>> ctx.fill
>> ().stroke() or ctx.moveTo(0,0).lineTo(10,10). This is how many of the 
>> native
>> string and array methods work in javaScript.
>
> This isn't a bad idea; the problem is that the cat's already out of
> the bag here, and developers will end up writing ctx.moveTo()
> ctx.lineTo() etc. for compatability.  I'm a fan of "with" in this
> instance:  with (ctx) { moveTo(0,0); lineTo(10,10); } etc.
>

In prototype based languages it is almost impossible to implement 'with'
effectively in the given notation.

ctx.moveTo(0,0).lineTo(10,10);

is more effective. In some circumstances - in times.

Andrew Fedoniouk.
http://terrainformatica.com

Stefan Gössner | 2 Jul 2006 08:41

Re: Canvas 2d methods

Benjamin Joffe wrote:

> Each of the methods defined for the canvas 2d context return null. I 
> think
> it would be very convenient if instead they would return a reference 
> to the
> 2d context for that canvas. This would allow writing such code as
> ctx.fill().stroke()
> or ctx.moveTo(0,0).lineTo(10,10). This is how many of the native 
> string and
> array methods work in javaScript.
>
I strongly agree and second this.
--
Stefan Gössner
http://goessner.net

Ian Hickson | 2 Jul 2006 07:21
Picon

Re: Canvas 2d methods

On Sat, 1 Jul 2006, Andrew Fedoniouk wrote:
> 
> In prototype based languages it is almost impossible to implement 'with' 
> effectively in the given notation.
> 
> ctx.moveTo(0,0).lineTo(10,10);
> 
> is more effective. In some circumstances - in times.

Why is it more effective for JS?

--

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Stefan Gössner | 2 Jul 2006 10:01

Re: Canvas 2d methods

Ian Hickson wrote:

>On Sat, 1 Jul 2006, Andrew Fedoniouk wrote:
>  
>
>>In prototype based languages it is almost impossible to implement 'with' 
>>effectively in the given notation.
>>
>>ctx.moveTo(0,0).lineTo(10,10);
>>
>>is more effective. In some circumstances - in times.
>>    
>>
>
>Why is it more effective for JS?
>
>  
>
see
http://yuiblog.com/blog/2006/04/11/with-statement-considered-harmful/

Nicholas Shanks | 2 Jul 2006 11:20

css3-fonts: New values for generic font families

I wish to submit two proposals for changes to the generic font  
families built into CSS. If someone could please forward these to  
whomever is currently working on the css3-fonts module, I would be  
much obliged.

1) That "monospace" and it's new inverse "proportional" be  
independent of the other generic families, and that both a generic  
and monospace/proportional (in either order) be specifiable together.  
This should be followed by a lone CSS2 generic for backwards  
compatibility. If not present, "proportional" should be assumed.

Examples:

Old:-  font-family: "Courier", "Courier New", monospace;
New:-   font-family: "Courier", "Courier New", serif monospace,  
monospace;

Old:-  font-family: "Monaco", monospace;
New:-   font-family: "Monaco", sans-serif monospace, monospace;

Old:-  font-family: "Hoefler Text", "Georgia", serif;
New:-   font-family: "Hoefler Text", "Georgia", proportional serif,  
serif;

2) The addition of two new generic family classes for the Latin  
script, namely:

blackletter (including fraktur, gotisch, schwabacher, rotunda, old  
english, &c.)
uncial (including insular, irish, &c.)

Blackletter is by far the most important of these, as it is quite  
common (much more so than 'fantasy') yet there are few universal  
blackletter fonts on all systems. Whilst it is often seen that a web  
designer will append "Arial" before the generic family—making the  
generics almost useless in that regard—due to the lack of universal  
fonts for either of these generics a user agent would likely find it  
falls back to them much more often than for 'serif' and 'sans-serif'.

- Nicholas Shanks.
Attachment (smime.p7s): application/pkcs7-signature, 2373 bytes
Ian Hickson | 2 Jul 2006 10:20
Picon

Re: Canvas 2d methods

On Sun, 2 Jul 2006, Stefan Gössner wrote:
> Ian Hickson wrote:
> > On Sat, 1 Jul 2006, Andrew Fedoniouk wrote:
> >  
> > > In prototype based languages it is almost impossible to implement 
> > > 'with' effectively in the given notation.
> > > 
> > > ctx.moveTo(0,0).lineTo(10,10);
> > > 
> > > is more effective. In some circumstances - in times.
> > 
> > Why is it more effective for JS?
>
> see 
> http://yuiblog.com/blog/2006/04/11/with-statement-considered-harmful/

I'm familiar with this, but it doesn't seem to be relevant for this case 
since all the method names are predefined and well-known.

--

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Ian Hickson | 1 Jul 2006 11:16
Picon

Re: Canvas 2d methods

On Sat, 1 Jul 2006, Benjamin Joffe wrote:
>
> Each of the methods defined for the canvas 2d context return null. I 
> think it would be very convenient if instead they would return a 
> reference to the 2d context for that canvas. This would allow writing 
> such code as ctx.fill().stroke() or ctx.moveTo(0,0).lineTo(10,10). This 
> is how many of the native string and array methods work in javaScript.

Why is that better than:

   with (ctx) {
     moveTo(0, 0)
     lineTo(10, 10)
     fill()
     stroke()
   }

...?

(Or on one line:

   with (ctx) { moveTo(0, 0); lineTo(10, 10); fill(); stroke(); }

...?)

--

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'


Gmane