base64DecodeInternal() is not conforming to HTML5(window.atob) spec. Window.atob has not been implemented in accordance with base64 spec(http://www.w3.org/TR/html5/webappapis.html#atob). 4. If the length of input divides by 4 leaving no remainder, then: if input ends with one or two "=" (U+003D) characters, remove them from input. (in spec) 6. If input contains a character that is not in the following list of characters and character ranges, throw an InvalidCharacterError exception and abort these steps (in spec) - Currently in WebKit, if input invalid charater, did not throw an InvalidCharacterError exception and abort. This issue is reproducible at w3c approved test site (http://w3c-test.org/html/tests/approved/base64.html). So, I will upload the patch as soon as possible.
how does the HTML5 specified behavior compare with other implementations? FF, IE, etc?
(In reply to comment #1) > how does the HTML5 specified behavior compare with other implementations? FF, IE, etc? In case of WebKit, result of w3c approved test site is "350 pass/18 fail". On the other hand, firefox result is 366 pass / 2 fail. - 2 fails are TC error, so firefox supports the spec, perfectly. Opera is also better than WebKit.(Result : 363 pass / 5 fail).
in the case of tests where one or more other browsers also fail, then care should be given to the validity of the test in question; some evaluation/discussion may be needed before implementing changes to pass the test; in other words, don't simply assume that the w3c tests are always valid
Thanks for your kind concern. I have tried double-checking to make sure about mismatching between TC and Spec. Failed 14 test cases which are proper. However, 2 failed TCs have below bugs. Let atob("ab="). (- this test is contained the "http://w3c-test.org/html/tests/approved/base64.htm") According to No. 4 of aboved spec, Because length of "ab=" is not divisible by 4, cannot remove the "=". According to No. 6 of aboved spec, "=" is not in the following list of characters and character ranges("+" (U+002B), "/" (U+002F), ASCII digits, uppercase ASCII letters and lowercase ASCII letters). So,should throw an InvalidCharacterError exception and abort. but in Webkit, do not following No. 4 spec and always remove ends with "=" characters, so do not throw an error.
Created attachment 185186 [details] Initial patch!
(In reply to comment #3) > in the case of tests where one or more other browsers also fail, then care should be given to the validity of the test in question; some evaluation/discussion may be needed before implementing changes to pass the test; in other words, don't simply assume that the w3c tests are always valid This is an important point. Thanks for pointing that out.
*** This bug has been marked as a duplicate of bug 118898 ***