Backed out changeset 10a3cbe9e42f (bug 1093611) for w4 test failures

This commit is contained in:
Carsten "Tomcat" Book 2014-11-25 11:02:02 +01:00
parent e152dca739
commit 5e16e0045e
6 changed files with 20 additions and 45 deletions

View File

@ -441,10 +441,8 @@ Link::GetHash(nsAString &_hash, ErrorResult& aError)
nsAutoCString ref;
nsresult rv = uri->GetRef(ref);
if (NS_SUCCEEDED(rv) && !ref.IsEmpty()) {
NS_UnescapeURL(ref); // XXX may result in random non-ASCII bytes!
_hash.Assign(char16_t('#'));
if (!nsContentUtils::ShouldEncodeURLHash()) {
NS_UnescapeURL(ref); // XXX may result in random non-ASCII bytes!
}
AppendUTF8toUTF16(ref, _hash);
}
}

View File

@ -514,10 +514,8 @@ URL::GetHash(nsString& aHash, ErrorResult& aRv) const
nsAutoCString ref;
nsresult rv = mURI->GetRef(ref);
if (NS_SUCCEEDED(rv) && !ref.IsEmpty()) {
NS_UnescapeURL(ref); // XXX may result in random non-ASCII bytes!
aHash.Assign(char16_t('#'));
if (!nsContentUtils::ShouldEncodeURLHash()) {
NS_UnescapeURL(ref); // XXX may result in random non-ASCII bytes!
}
AppendUTF8toUTF16(ref, aHash);
}
}

View File

@ -236,7 +236,6 @@ bool nsContentUtils::sFullscreenApiIsContentOnly = false;
bool nsContentUtils::sIsPerformanceTimingEnabled = false;
bool nsContentUtils::sIsResourceTimingEnabled = false;
bool nsContentUtils::sIsExperimentalAutocompleteEnabled = false;
bool nsContentUtils::sEncodeURLHash = true;
uint32_t nsContentUtils::sHandlingInputTimeout = 1000;
@ -514,9 +513,6 @@ nsContentUtils::Init()
Preferences::AddBoolVarCache(&sIsExperimentalAutocompleteEnabled,
"dom.forms.autocomplete.experimental", false);
Preferences::AddBoolVarCache(&sEncodeURLHash,
"dom.url.encode_hash", true);
Preferences::AddUintVarCache(&sHandlingInputTimeout,
"dom.event.handling-user-input-time-limit",
1000);

View File

@ -1853,11 +1853,6 @@ public:
return sIsResourceTimingEnabled;
}
static bool ShouldEncodeURLHash()
{
return sEncodeURLHash;
}
/**
* Returns true if the doc tree branch which contains aDoc contains any
* plugins which we don't control event dispatch for, i.e. do any plugins
@ -2309,7 +2304,6 @@ private:
static bool sIsPerformanceTimingEnabled;
static bool sIsResourceTimingEnabled;
static bool sIsExperimentalAutocompleteEnabled;
static bool sEncodeURLHash;
static nsHtml5StringParser* sHTMLFragmentParser;
static nsIParser* sXMLFragmentParser;

View File

@ -298,36 +298,28 @@ nsLocation::GetHash(nsAString& aHash)
nsAutoString unicodeRef;
rv = uri->GetRef(ref);
if (NS_SUCCEEDED(rv)) {
nsCOMPtr<nsITextToSubURI> textToSubURI(
do_GetService(NS_ITEXTTOSUBURI_CONTRACTID, &rv));
if (!nsContentUtils::ShouldEncodeURLHash()) {
if (NS_SUCCEEDED(rv)) {
nsCOMPtr<nsITextToSubURI> textToSubURI(
do_GetService(NS_ITEXTTOSUBURI_CONTRACTID, &rv));
if (NS_SUCCEEDED(rv)) {
nsAutoCString charset;
uri->GetOriginCharset(charset);
rv = textToSubURI->UnEscapeURIForUI(charset, ref, unicodeRef);
}
if (NS_FAILED(rv)) {
// Oh, well. No intl here!
NS_UnescapeURL(ref);
CopyASCIItoUTF16(ref, unicodeRef);
rv = NS_OK;
}
nsAutoCString charset;
uri->GetOriginCharset(charset);
rv = textToSubURI->UnEscapeURIForUI(charset, ref, unicodeRef);
}
if (NS_FAILED(rv)) {
// Oh, well. No intl here!
NS_UnescapeURL(ref);
CopyASCIItoUTF16(ref, unicodeRef);
rv = NS_OK;
}
}
if (NS_SUCCEEDED(rv) && !unicodeRef.IsEmpty()) {
aHash.Assign(char16_t('#'));
aHash.Append(unicodeRef);
}
} else { // URL Hash should be encoded
if (NS_SUCCEEDED(rv) && !ref.IsEmpty()) {
aHash.Assign(char16_t('#'));
AppendASCIItoUTF16(ref, aHash);
}
if (NS_SUCCEEDED(rv) && !unicodeRef.IsEmpty()) {
aHash.Assign(char16_t('#'));
aHash.Append(unicodeRef);
}
if (aHash == mCachedHash) {

View File

@ -161,9 +161,6 @@ pref("dom.webcrypto.enabled", true);
// Whether the UndoManager API is enabled
pref("dom.undo_manager.enabled", false);
// Whether URL,nsLocation,Link::GetHash should be percent encoded.
pref("dom.url.encode_hash", true);
// Whether to run add-on code in different compartments from browser code. This
// causes a separate compartment for each (addon, global) combination, which may
// significantly increase the number of compartments in the system.