зеркало из https://github.com/mozilla/gecko-dev.git
Back out 9e5d584bc36c (bug 711180) for unexpected passes
--HG-- extra : rebase_source : 058c7afe46b9fbe2653f3e933c60dddb157c7804
This commit is contained in:
Родитель
f11fc41386
Коммит
aa9de4fcf1
|
@ -665,25 +665,7 @@ nsContentUtils::Atob(const nsAString& aAsciiBase64String,
|
|||
return NS_ERROR_DOM_INVALID_CHARACTER_ERR;
|
||||
}
|
||||
|
||||
const PRUnichar* start = aAsciiBase64String.BeginReading();
|
||||
const PRUnichar* iter = start;
|
||||
const PRUnichar* end = aAsciiBase64String.EndReading();
|
||||
nsString trimmedString;
|
||||
if (!trimmedString.SetCapacity(aAsciiBase64String.Length(), fallible_t())) {
|
||||
return NS_ERROR_DOM_INVALID_CHARACTER_ERR;
|
||||
}
|
||||
bool needTrimming = false;
|
||||
while (iter < end) {
|
||||
if (!nsContentUtils::IsHTMLWhitespace(*iter)) {
|
||||
if (!needTrimming) {
|
||||
needTrimming = true;
|
||||
trimmedString.Append(start, iter - start);
|
||||
}
|
||||
trimmedString.Append(*iter);
|
||||
}
|
||||
iter++;
|
||||
}
|
||||
nsresult rv = Base64Decode(trimmedString, aBinaryData);
|
||||
nsresult rv = Base64Decode(aAsciiBase64String, aBinaryData);
|
||||
if (NS_FAILED(rv) && rv == NS_ERROR_INVALID_ARG) {
|
||||
return NS_ERROR_DOM_INVALID_CHARACTER_ERR;
|
||||
}
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=711180
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 711180</title>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=711180">Mozilla Bug 711180</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
|
||||
/** Test for Bug 711180 **/
|
||||
is(atob("aQ=="), atob("\t a\rQ\n=\f="), "Base64 space removal");
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
Загрузка…
Ссылка в новой задаче