[whatwg] Should video controls generate click events?

2013-06-27 Thread Philip Jägenstedt
In a discussion about a click to play/pause feature for Opera on  
Android, the issue of click event handlers came up.[1] The problem is that  
pages can do things like this:


v.onclick = function() {
  if (v.paused) {
v.play();
  } else {
v.pause();
  }
  // no preventDefault()
}

I created a demo [2] and it is indeed the case that this makes video  
controls unusable in both Presto and Chromium based browsers. Simon  
Pieters has brought this up before, but the spec wasn't changed at that  
point.[3]


While my demo may be on the hypothetical side, we do want users to be able  
to bring up the native controls via a context menu and be able to use them  
regardless of what the page does in its event handlers. So, I request that  
the spec be explicit that interacting with the video controls does not  
cause the normal script-visible events to be fired.


[1] https://codereview.chromium.org/17391015
[2] http://people.opera.com/~philipj/click.html
[3]  
http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2011-June/031916.html  
(search for As with the post Simon cites above)


--
Philip Jägenstedt
Opera Software


[whatwg] Maxlength attribute on input[type=number]

2013-06-27 Thread Steve Hoeksema
Hi,

The current whatwg standard [1] states that maxlength is not a valid attribute 
for input[type=number].

I built a form and tested it in Firefox, which honours the maxlength attribute, 
and then found that Chrome did not.

I thought this was a bug, so I reported it to Chromium [2], who determined it 
was not a bug and referred me to whatwg.

I'm wondering if there is a rationale for not supporting maxlength on a number 
field, and if not, how I can go about having the standard changed?


Cheers,

Steve

[1] 
http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary
[2] https://code.google.com/p/chromium/issues/detail?id=253798


Re: [whatwg] Maxlength attribute on input[type=number]

2013-06-27 Thread Scott González
Why would you want to set maxlength as opposed to setting max?


On Thu, Jun 27, 2013 at 5:42 PM, Steve Hoeksema st...@kotiri.com wrote:

 Hi,

 The current whatwg standard [1] states that maxlength is not a valid
 attribute for input[type=number].

 I built a form and tested it in Firefox, which honours the maxlength
 attribute, and then found that Chrome did not.

 I thought this was a bug, so I reported it to Chromium [2], who determined
 it was not a bug and referred me to whatwg.

 I'm wondering if there is a rationale for not supporting maxlength on a
 number field, and if not, how I can go about having the standard changed?


 Cheers,

 Steve

 [1]
 http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary
 [2] https://code.google.com/p/chromium/issues/detail?id=253798



Re: [whatwg] Maxlength attribute on input[type=number]

2013-06-27 Thread Steve Hoeksema
In my specific case, a numeric code with a maximum length.

Say it's 4 digits, and I'm using Chrome. I can put max=, but the browser 
still allows me to type 12345. It won't allow me to submit the form, and it 
highlights it as an error, but I can still enter it. Using a maxlength means I 
can't even enter 12345, and it's obvious that it will only accept 4 digits.

Using input[type=text] is not desirable because (e.g.) it pops up a 
alphabetical keyboard on iOS instead of a numeric keyboard.

I can of course restrict the length on input[type=number] with javascript, but 
if the browser supported it natively that would be far better.


On Friday, 28 June 2013 at 10:09 AM, Scott González wrote:

 Why would you want to set maxlength as opposed to setting max?
  
  
 On Thu, Jun 27, 2013 at 5:42 PM, Steve Hoeksema st...@kotiri.com 
 (mailto:st...@kotiri.com) wrote:
  Hi,
   
  The current whatwg standard [1] states that maxlength is not a valid 
  attribute for input[type=number].
   
  I built a form and tested it in Firefox, which honours the maxlength 
  attribute, and then found that Chrome did not.
   
  I thought this was a bug, so I reported it to Chromium [2], who determined 
  it was not a bug and referred me to whatwg.
   
  I'm wondering if there is a rationale for not supporting maxlength on a 
  number field, and if not, how I can go about having the standard changed?
   
   
  Cheers,
   
  Steve
   
  [1] 
  http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary
  [2] https://code.google.com/p/chromium/issues/detail?id=253798
  



Re: [whatwg] Maxlength attribute on input[type=number]

2013-06-27 Thread Jukka K. Korpela

2013-06-28 1:09, Scott González wrote:


Why would you want to set maxlength as opposed to setting max?


People want to do such things to cover old browsers that do not support 
type=number. Such browsers ignore both the type attribute and the max 
attribute, so to impose *some* limits, people would use maxlength.


Yucca




Re: [whatwg] Maxlength attribute on input[type=number]

2013-06-27 Thread Boris Zbarsky

On 6/27/13 5:42 PM, Steve Hoeksema wrote:

I built a form and tested it in Firefox, which honours the maxlength attribute, 
and then found that Chrome did not.


Note that I assume you tested this in a version of Firefox which does 
not support type=number...  so it was treated as type=text.


-Boris


Re: [whatwg] Maxlength attribute on input[type=number]

2013-06-27 Thread Steve Hoeksema
 Note that I assume you tested this in a version of Firefox which does not 
 support type=number... so it was treated as type=text.

So it does. I missed that - I was only entering numbers at that point. (FF 22.0 
on OS X) 


Re: [whatwg] Maxlength attribute on input[type=number]

2013-06-27 Thread Tab Atkins Jr.
On Thu, Jun 27, 2013 at 3:18 PM, Steve Hoeksema st...@kotiri.com wrote:
 In my specific case, a numeric code with a maximum length.

 Say it's 4 digits, and I'm using Chrome. I can put max=, but the browser 
 still allows me to type 12345. It won't allow me to submit the form, and it 
 highlights it as an error, but I can still enter it. Using a maxlength means 
 I can't even enter 12345, and it's obvious that it will only accept 4 digits.

 Using input[type=text] is not desirable because (e.g.) it pops up a 
 alphabetical keyboard on iOS instead of a numeric keyboard.

 I can of course restrict the length on input[type=number] with javascript, 
 but if the browser supported it natively that would be far better.

Numeric codes are almost certainly actually type=text, with a
pattern=\d+ or the like.  If the first digit is allowed to be 0,
it's not type=number.  Note that we have the inputmode attribute
http://www.whatwg.org/specs/web-apps/current-work/multipage/association-of-controls-and-forms.html#input-modalities:-the-inputmode-attribute
to still indicate that the on-screen keyboard should be numeric rather
than alphabetic.

~TJ


Re: [whatwg] Maxlength attribute on input[type=number]

2013-06-27 Thread Steve Hoeksema
 Numeric codes are almost certainly actually type=text, with a
 pattern=\d+ or the like. If the first digit is allowed to be 0,
 it's not type=number. Note that we have the inputmode attribute
 http://www.whatwg.org/specs/web-apps/current-work/multipage/association-of-controls-and-forms.html#input-modalities:-the-inputmode-attribute
 to still indicate that the on-screen keyboard should be numeric rather
 than alphabetic.

I hadn't considered the case of a leading zero. I guess inputmode will do what 
I need, even if its not supported yet. Thanks for your help.