window.atob() should ignore spaces in input as per:
https://html.spec.whatwg.org/#dom-windowbase64-atob (Step 3)
Currently, WebKit throws an exception and it is the only browser to do so. Firefox and Chrome behavior according to the specification.
This causes us to fail 10 checks in the following W3C HTML test:
Created attachment 269945 [details]
I'm pretty sure that we have an old bug with a discussion of what a stupid idea this was :(
(In reply to comment #3)
> I'm pretty sure that we have an old bug with a discussion of what a stupid
> idea this was :(
I forgot about it but now that you mention it, it does ring a bell.
The thing is that the spec has not changed since, other browsers still strip whitespaces as well. It is now covered by the W3C web-platform-tests too.
(In reply to comment #5)
> bug 123830
The fact at this point is that other browsers and the specification have been stripping spaces for several years now. Not doing this in WebKit is a compatibility risk and I think we should do this.
I'm afraid so, yes. It will probably change back eventually though.
Created attachment 270009 [details]
Comment on attachment 270009 [details]
View in context: https://bugs.webkit.org/attachment.cgi?id=270009&action=review
Don't forget to update the copyright on this file.
> +PASS window.atob(" YQ==") is "a"
Can you please add tests covering the error cases?
There are 3 "hadError = true;". Each should have a test.
Created attachment 270041 [details]
Created attachment 270044 [details]
Comment on attachment 270044 [details]
Clearing flags on attachment: 270044
Committed r195694: <http://trac.webkit.org/changeset/195694>
All reviewed patches have been landed. Closing bug.