Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(36)

Issue 58143002: WindowBase64::atob() does not remove space characters from input (Closed)

Created:
7 years, 1 month ago by Inactive
Modified:
7 years, 1 month ago
CC:
blink-reviews
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

WindowBase64::atob() does not remove space characters from input WindowBase64::atob() does not remove space characters from input as mandated by the specification (Step 3): http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#dom-windowbase64-atob As a result, base64 decoding will fail if the input string contains HTML space characters. This CL makes our implementation more flexible so that it allows HTML spaces in the encoded input, which is apparently desired because quite common: https://www.w3.org/Bugs/Public/show_bug.cgi?id=22731 We now have a 100% pass rate on the following test suite: http://www.w3c-test.org/html/tests/submission/AryehGregor/base64.html BUG=314682 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=161395

Patch Set 1 #

Total comments: 3

Patch Set 2 : More optimal proposal #

Patch Set 3 : Fix style issue #

Total comments: 4

Patch Set 4 : Fix nits #

Unified diffs Side-by-side diffs Delta from patch set Stats (+86 lines, -67 lines) Patch
M LayoutTests/fast/dom/Window/atob-btoa.html View 1 2 3 2 chunks +45 lines, -33 lines 0 comments Download
M LayoutTests/fast/dom/Window/atob-btoa-expected.txt View 1 chunk +10 lines, -2 lines 0 comments Download
M Source/core/frame/DOMWindowBase64.cpp View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/page/Page.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/wtf/text/Base64.h View 1 2 3 3 chunks +8 lines, -12 lines 0 comments Download
M Source/wtf/text/Base64.cpp View 1 2 3 5 chunks +20 lines, -17 lines 0 comments Download

Messages

Total messages: 13 (0 generated)
Inactive
7 years, 1 month ago (2013-11-04 18:42:34 UTC) #1
arv (Not doing code reviews)
https://codereview.chromium.org/58143002/diff/1/Source/core/frame/DOMWindowBase64.cpp File Source/core/frame/DOMWindowBase64.cpp (right): https://codereview.chromium.org/58143002/diff/1/Source/core/frame/DOMWindowBase64.cpp#newcode69 Source/core/frame/DOMWindowBase64.cpp:69: if (encodedString.find(isHTMLSpace<UChar>) != NotFoundError) { Can we change base64Decode ...
7 years, 1 month ago (2013-11-04 19:54:53 UTC) #2
Inactive
https://codereview.chromium.org/58143002/diff/1/Source/core/frame/DOMWindowBase64.cpp File Source/core/frame/DOMWindowBase64.cpp (right): https://codereview.chromium.org/58143002/diff/1/Source/core/frame/DOMWindowBase64.cpp#newcode69 Source/core/frame/DOMWindowBase64.cpp:69: if (encodedString.find(isHTMLSpace<UChar>) != NotFoundError) { On 2013/11/04 19:54:53, arv ...
7 years, 1 month ago (2013-11-04 20:01:37 UTC) #3
tkent
https://codereview.chromium.org/58143002/diff/1/Source/core/frame/DOMWindowBase64.cpp File Source/core/frame/DOMWindowBase64.cpp (right): https://codereview.chromium.org/58143002/diff/1/Source/core/frame/DOMWindowBase64.cpp#newcode69 Source/core/frame/DOMWindowBase64.cpp:69: if (encodedString.find(isHTMLSpace<UChar>) != NotFoundError) { On 2013/11/04 20:01:37, Chris ...
7 years, 1 month ago (2013-11-05 02:21:56 UTC) #4
Inactive
On 2013/11/05 02:21:56, tkent wrote: > https://codereview.chromium.org/58143002/diff/1/Source/core/frame/DOMWindowBase64.cpp > File Source/core/frame/DOMWindowBase64.cpp (right): > > https://codereview.chromium.org/58143002/diff/1/Source/core/frame/DOMWindowBase64.cpp#newcode69 > ...
7 years, 1 month ago (2013-11-05 17:22:05 UTC) #5
Inactive
Ok, I refactored the WTF implementation to support our use cases and avoid going over ...
7 years, 1 month ago (2013-11-05 17:57:32 UTC) #6
arv (Not doing code reviews)
LGTM
7 years, 1 month ago (2013-11-05 18:13:13 UTC) #7
tkent
lgtm with nits https://codereview.chromium.org/58143002/diff/120001/LayoutTests/fast/dom/Window/atob-btoa.html File LayoutTests/fast/dom/Window/atob-btoa.html (right): https://codereview.chromium.org/58143002/diff/120001/LayoutTests/fast/dom/Window/atob-btoa.html#newcode42 LayoutTests/fast/dom/Window/atob-btoa.html:42: shouldBe('window.atob(" YQ==")', '"a"'); nit: You can ...
7 years, 1 month ago (2013-11-05 21:39:06 UTC) #8
Inactive
https://codereview.chromium.org/58143002/diff/120001/LayoutTests/fast/dom/Window/atob-btoa.html File LayoutTests/fast/dom/Window/atob-btoa.html (right): https://codereview.chromium.org/58143002/diff/120001/LayoutTests/fast/dom/Window/atob-btoa.html#newcode42 LayoutTests/fast/dom/Window/atob-btoa.html:42: shouldBe('window.atob(" YQ==")', '"a"'); On 2013/11/05 21:39:07, tkent wrote: > ...
7 years, 1 month ago (2013-11-05 21:55:56 UTC) #9
Inactive
I fixed the nits, landing..
7 years, 1 month ago (2013-11-05 22:14:06 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ch.dumez@samsung.com/58143002/200001
7 years, 1 month ago (2013-11-05 22:16:08 UTC) #11
commit-bot: I haz the power
Change committed as 161395
7 years, 1 month ago (2013-11-05 23:34:24 UTC) #12
Inactive
7 years, 1 month ago (2013-11-11 14:21:12 UTC) #13
Message was sent while issue was closed.
FYI, ap (Alexey) is pushing back on this change via
https://www.w3.org/Bugs/Public/show_bug.cgi?id=22731

I have a similar patch to get WebKit inline with us but it is currently blocked.

Powered by Google App Engine
This is Rietveld 408576698