W3C home > Mailing lists > Public > whatwg@whatwg.org > February 2011

[whatwg] Specs for window.atob() and window.btoa()

From: Jonas Sicking <jonas@sicking.cc>
Date: Sat, 5 Feb 2011 17:29:13 -0800
Message-ID: <AANLkTimPERmrwjsEAwQz=s4C7nCzv+JJ8QnDQqEDKa0U@mail.gmail.com>
On Sat, Feb 5, 2011 at 4:29 PM, Aryeh Gregor <Simetrical+w3c at gmail.com> wrote:
> On Fri, Feb 4, 2011 at 6:59 PM, Simon Pieters <simonp at opera.com> wrote:
>> Is the compat problem for not throwing for whitespace or for not throwing
>> for other garbage? If it's for other garbage, we could allow whitespace but
>> throw for other garbage. (The bugs I can find in our database with a quick
>> search is about non-ASCII characters not throwing.)
>
> Opera people were the only ones who told me about these compat
> problems, so it could be just non-ASCII characters. ?I went with
> Gecko's behavior exactly because it seemed simpler than WebKit's and I
> had been told Opera's wasn't fully web-compatible. ?Both Gecko and
> WebKit do throw on any whitespace.
>
>> Better performance seems like an incentive.
>
> I don't object to a spec change if browsers are willing to change
> their implementations. ?I'd be a bit surprised if these functions are
> widely used in performance-critical situations, though.

As a firefox developer, I'd be interested in avoiding throwing if it
can make things easier for authors (and it is web compatible).

So my first question is, can someone give examples of sources of
base64 data which contains whitespace?

I agree that this function probably doesn't appear in a lot of
performance critical code paths. However it might show up in places
which deal with large bodies of data, so if people can avoid cloning
that data unnecessarily then that's a win.

/ Jonas
Received on Saturday, 5 February 2011 17:29:13 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:30 UTC