Summary: | window.atob() should ignore spaces in input | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Chris Dumez <cdumez> | ||||||||||
Component: | DOM | Assignee: | Chris Dumez <cdumez> | ||||||||||
Status: | RESOLVED FIXED | ||||||||||||
Severity: | Normal | CC: | ap, benjamin, cmarcelo, commit-queue, rniwa, webkit-bug-importer | ||||||||||
Priority: | P2 | Keywords: | InRadar, WebExposed | ||||||||||
Version: | WebKit Nightly Build | ||||||||||||
Hardware: | Unspecified | ||||||||||||
OS: | Unspecified | ||||||||||||
URL: | https://html.spec.whatwg.org/#dom-windowbase64-atob | ||||||||||||
Attachments: |
|
Description
Chris Dumez
2016-01-26 16:13:45 PST
Created attachment 269945 [details]
WIP Patch
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]
Patch
Comment on attachment 270009 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=270009&action=review > Source/WTF/wtf/text/Base64.cpp:182 > } Don't forget to update the copyright on this file. > LayoutTests/fast/dom/Window/atob-btoa-expected.txt:29 > +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]
Patch
Created attachment 270044 [details]
Patch
Comment on attachment 270044 [details] Patch Clearing flags on attachment: 270044 Committed r195694: <http://trac.webkit.org/changeset/195694> All reviewed patches have been landed. Closing bug. |