[whatwg] Add <input> "Switch" Type

alonn alonisser at gmail.com
Sun Sep 22 02:51:06 PDT 2013


+1 from the web author perspective. would be nice if this wasn't so
"Hackish" and if the look was more consistent.

I do agree that this could be achieved (maybe more backwards compatibly)
with an "switch" attribute on the ```checkbox``` input type.




Twitter:@alonisser <https://twitter.com/alonisser>
LinkedIn Profile <http://www.linkedin.com/in/alonisser>
Facebook <https://www.facebook.com/alonisser>
*Tech blog:*4p-tech.co.il/blog
*Personal Blog:*degeladom.wordpress.com
Tel:972-54-6734469


On Sat, Sep 21, 2013 at 9:06 PM, <whatwg-request at lists.whatwg.org> wrote:

> Send whatwg mailing list submissions to
>         whatwg at lists.whatwg.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         http://lists.whatwg.org/listinfo.cgi/whatwg-whatwg.org
> or, via email, send a message with subject or body 'help' to
>         whatwg-request at lists.whatwg.org
>
> You can reach the person managing the list at
>         whatwg-owner at lists.whatwg.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of whatwg digest..."
>
> When replying to digest messages, please please PLEASE update the subject
> line so it isn't the digest subject line.
> Today's Topics:
>
>    1. Re: Canvas - Somewhat inconsistent rules in the spec for
>       drawImage (Robert O'Callahan)
>    2. Add <input> "Switch" Type (Brian Blakely)
>    3. Re: Add <input> "Switch" Type (Tab Atkins Jr.)
>    4. Re: Add <input> "Switch" Type (Brian M. Blakely)
>
>
> ---------- Forwarded message ----------
> From: "Robert O'Callahan" <robert at ocallahan.org>
> To: Justin Novosad <junov at google.com>
> Cc: Simon Sarris <simon.sarris at gmail.com>, WHATWG List <whatwg at whatwg.org>
> Date: Sat, 21 Sep 2013 10:13:43 +1200
> Subject: Re: [whatwg] Canvas - Somewhat inconsistent rules in the spec for
> drawImage
> On Sat, Sep 21, 2013 at 6:40 AM, Justin Novosad <junov at google.com> wrote:
>
> > If we do anything, it should be the latter (draw nothing) to avoid
> breaking
> > existing apps.
> >
>
> I agree. I commented on this a while ago, and I still think it's simpler
> and more robust for drawing a zero-size "anything" to just draw nothing.
>
> Rob
> --
> Jtehsauts  tshaei dS,o n" Wohfy  Mdaon  yhoaus  eanuttehrotraiitny  eovni
> le atrhtohu gthot sf oirng iyvoeu rs ihnesa.r"t sS?o  Whhei csha iids  teoa
> stiheer :p atroa lsyazye,d  'mYaonu,r  "sGients  uapr,e  tfaokreg iyvoeunr,
> 'm aotr  atnod  sgaoy ,h o'mGee.t"  uTph eann dt hwea lmka'n?  gBoutt  uIp
> waanndt  wyeonut  thoo mken.o w  *
> *
>
>
>
> ---------- Forwarded message ----------
> From: Brian Blakely <anewpage.media at gmail.com>
> To: "whatwg at lists.whatwg.org" <whatwg at lists.whatwg.org>
> Cc:
> Date: Fri, 20 Sep 2013 18:36:53 -0400
> Subject: [whatwg] Add <input> "Switch" Type
> "iPhone OS" introduced the switch control (http://i.imgur.com/TA79fo2.png)
> in 2007.  Since then, there have been many attempts to recreate this on the
> Web Platform by hacking existing control types and using a lot of
> meaningless markup, to varying degrees of success.
>
> The proposal is to add a "switch" <input> type.  When it is active, the UA
> should render a switch control.  It looks like this:
>
> <input type="switch" on />
>
> The "on" attribute indicates whether the switch is in its "on" or "off"
> state.  There is no "off" attribute, as switches are off by default.  The
> values corresponding to each state are true and false, respectively.
>
> List of OSs that implement switch controls (likely incomplete):
>
>    - Windows 8
>    - OS X
>    - iOS
>    - Android
>    - Blackberry OS
>    - Windows Phone
>
> The major advantage here, as with all controls in HTML, is that the
> behavior and default appearance of the control is guaranteed to be
> consistent for a user across the Web, and likely match their host OS as
> well.  This is sure to be a very attractive and convenient solution for
> authors.
>
>
>
> ---------- Forwarded message ----------
> From: "Tab Atkins Jr." <jackalmage at gmail.com>
> To: Brian Blakely <anewpage.media at gmail.com>
> Cc: "whatwg at lists.whatwg.org" <whatwg at lists.whatwg.org>
> Date: Fri, 20 Sep 2013 15:44:55 -0700
> Subject: Re: [whatwg] Add <input> "Switch" Type
> On Fri, Sep 20, 2013 at 3:36 PM, Brian Blakely <anewpage.media at gmail.com>
> wrote:
> > "iPhone OS" introduced the switch control (
> http://i.imgur.com/TA79fo2.png)
> > in 2007.  Since then, there have been many attempts to recreate this on
> the
> > Web Platform by hacking existing control types and using a lot of
> > meaningless markup, to varying degrees of success.
> >
> > The proposal is to add a "switch" <input> type.  When it is active, the
> UA
> > should render a switch control.  It looks like this:
> >
> > <input type="switch" on />
> >
> > The "on" attribute indicates whether the switch is in its "on" or "off"
> > state.  There is no "off" attribute, as switches are off by default.  The
> > values corresponding to each state are true and false, respectively.
> >
> > List of OSs that implement switch controls (likely incomplete):
> >
> >    - Windows 8
> >    - OS X
> >    - iOS
> >    - Android
> >    - Blackberry OS
> >    - Windows Phone
> >
> > The major advantage here, as with all controls in HTML, is that the
> > behavior and default appearance of the control is guaranteed to be
> > consistent for a user across the Web, and likely match their host OS as
> > well.  This is sure to be a very attractive and convenient solution for
> > authors.
>
> This is just a "checkbox" input with different styling, yes?
>
> ~TJ
>
>
>
> ---------- Forwarded message ----------
> From: "Brian M. Blakely" <anewpage.media at gmail.com>
> To: "Tab Atkins Jr." <jackalmage at gmail.com>
> Cc: "whatwg at lists.whatwg.org" <whatwg at lists.whatwg.org>
> Date: Fri, 20 Sep 2013 19:03:06 -0400
> Subject: Re: [whatwg] Add <input> "Switch" Type
> I was contemplating whether to propose a new input type, or an attribute
> valid only for checkboxes. But it isn't a checkbox, so I went with a new
> type value.  You can choose to slide the switch or click it in most OS
> implementations, so even the behavior is different from a checkbox.
>
> I consider it a different input type the way "range" and "number" are
> different, despite being semantically identical.
>
>
> > On Sep 20, 2013, at 6:44 PM, "Tab Atkins Jr." <jackalmage at gmail.com>
> wrote:
> >
> >> On Fri, Sep 20, 2013 at 3:36 PM, Brian Blakely <
> anewpage.media at gmail.com> wrote:
> >> "iPhone OS" introduced the switch control (
> http://i.imgur.com/TA79fo2.png)
> >> in 2007.  Since then, there have been many attempts to recreate this on
> the
> >> Web Platform by hacking existing control types and using a lot of
> >> meaningless markup, to varying degrees of success.
> >>
> >> The proposal is to add a "switch" <input> type.  When it is active, the
> UA
> >> should render a switch control.  It looks like this:
> >>
> >> <input type="switch" on />
> >>
> >> The "on" attribute indicates whether the switch is in its "on" or "off"
> >> state.  There is no "off" attribute, as switches are off by default.
>  The
> >> values corresponding to each state are true and false, respectively.
> >>
> >> List of OSs that implement switch controls (likely incomplete):
> >>
> >>   - Windows 8
> >>   - OS X
> >>   - iOS
> >>   - Android
> >>   - Blackberry OS
> >>   - Windows Phone
> >>
> >> The major advantage here, as with all controls in HTML, is that the
> >> behavior and default appearance of the control is guaranteed to be
> >> consistent for a user across the Web, and likely match their host OS as
> >> well.  This is sure to be a very attractive and convenient solution for
> >> authors.
> >
> > This is just a "checkbox" input with different styling, yes?
> >
> > ~TJ
>
>
> _______________________________________________
> whatwg mailing list
> whatwg at lists.whatwg.org
> http://lists.whatwg.org/listinfo.cgi/whatwg-whatwg.org
>
>



More information about the whatwg mailing list