diff --git a/application/basilisk/themes/windows/browser.css b/application/basilisk/themes/windows/browser.css index d87b8eeafa..30fbb681d0 100644 --- a/application/basilisk/themes/windows/browser.css +++ b/application/basilisk/themes/windows/browser.css @@ -123,6 +123,13 @@ toolbar:-moz-lwtheme { border-top: none; } +@media (-moz-os-version: windows-win10) and (-moz-windows-theme: aero) { + #navigator-toolbox { + /* Override the global style for Windows 10 that adds a bottom border */ + border-bottom: none; + }; +} + #navigator-toolbox::after { content: ""; display: -moz-box; diff --git a/application/basilisk/themes/windows/places/organizer.css b/application/basilisk/themes/windows/places/organizer.css index 4de603b9f3..263286d556 100644 --- a/application/basilisk/themes/windows/places/organizer.css +++ b/application/basilisk/themes/windows/places/organizer.css @@ -193,6 +193,13 @@ } } +@media (-moz-os-version: windows-win10) and (-moz-windows-theme: aero) { + #placesToolbox { + /* Override the global style for Windows 10 that adds a bottom border */ + border-bottom: none; + } +} + @media (-moz-windows-default-theme) and (-moz-os-version: windows-vista), (-moz-windows-default-theme) and (-moz-os-version: windows-win7) { #placesView, diff --git a/application/palemoon/themes/windows/browser.css b/application/palemoon/themes/windows/browser.css index 6bfb7b9c8d..d2bf31c071 100644 --- a/application/palemoon/themes/windows/browser.css +++ b/application/palemoon/themes/windows/browser.css @@ -91,6 +91,13 @@ border-top: none; } +@media (-moz-os-version: windows-win10) and (-moz-windows-theme: aero) { + #navigator-toolbox { + /* Override the global style for Windows 10 that adds a bottom border */ + border-bottom: none; + }; +} + #navigator-toolbox::after { content: ""; display: -moz-box; diff --git a/application/palemoon/themes/windows/places/organizer.css b/application/palemoon/themes/windows/places/organizer.css index 0a947c2ac0..53c30cfb90 100644 --- a/application/palemoon/themes/windows/places/organizer.css +++ b/application/palemoon/themes/windows/places/organizer.css @@ -214,6 +214,13 @@ } } +@media (-moz-os-version: windows-win10) and (-moz-windows-theme: aero) { + #placesToolbox { + /* Override the global style for Windows 10 that adds a bottom border */ + border-bottom: none; + } +} + @media (-moz-windows-default-theme) and (-moz-os-version: windows-vista), (-moz-windows-default-theme) and (-moz-os-version: windows-win7) { #placesView, diff --git a/dom/bindings/Bindings.conf b/dom/bindings/Bindings.conf index ddd32a4940..3ba753affd 100644 --- a/dom/bindings/Bindings.conf +++ b/dom/bindings/Bindings.conf @@ -298,7 +298,6 @@ DOMInterfaces = { # We can also get rid of the UnwrapArg bits in # the dom QueryInterface (in BindingUtils.cpp) at that point. 'hasXPConnectImpls': True, - 'concrete': False, 'jsImplParent': 'mozilla::DOMEventTargetHelper', 'implicitJSContext': [ 'dispatchEvent' ] }, diff --git a/dom/bindings/Codegen.py b/dom/bindings/Codegen.py index c9a5e9f419..42ce94fcb4 100644 --- a/dom/bindings/Codegen.py +++ b/dom/bindings/Codegen.py @@ -2321,22 +2321,11 @@ class MethodDefiner(PropertyDefiner): if len(signatures) > 1 or len(signatures[0][1]) > 1 or not argTypeIsIID(signatures[0][1][0]): raise TypeError("There should be only one queryInterface method with 1 argument of type IID") - # Make sure to not stick QueryInterface on abstract interfaces that - # have hasXPConnectImpls (like EventTarget). So only put it on - # interfaces that are concrete and all of whose ancestors are abstract. - def allAncestorsAbstract(iface): - if not iface.parent: - return True - desc = self.descriptor.getDescriptor(iface.parent.identifier.name) - if desc.concrete: - return False - return allAncestorsAbstract(iface.parent) + # Make sure to not stick QueryInterface on abstract interfaces. if (not self.descriptor.interface.hasInterfacePrototypeObject() or - not self.descriptor.concrete or - not allAncestorsAbstract(self.descriptor.interface)): + not self.descriptor.concrete): raise TypeError("QueryInterface is only supported on " - "interfaces that are concrete and all " - "of whose ancestors are abstract: " + + "interfaces that are concrete: " + self.descriptor.name) condition = "WantsQueryInterface<%s>::Enabled" % descriptor.nativeType self.regular.append({ diff --git a/dom/events/ConstructibleEventTarget.cpp b/dom/events/ConstructibleEventTarget.cpp new file mode 100644 index 0000000000..8e768f7a61 --- /dev/null +++ b/dom/events/ConstructibleEventTarget.cpp @@ -0,0 +1,20 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "mozilla/dom/ConstructibleEventTarget.h" +#include "mozilla/dom/EventTargetBinding.h" + +namespace mozilla { +namespace dom { + +JSObject* +ConstructibleEventTarget::WrapObject(JSContext* cx, JS::Handle aGivenProto) +{ + return EventTargetBinding::Wrap(cx, this, aGivenProto); +} + +} // namespace dom +} // namespace mozilla + diff --git a/dom/events/ConstructibleEventTarget.h b/dom/events/ConstructibleEventTarget.h new file mode 100644 index 0000000000..18f60d556c --- /dev/null +++ b/dom/events/ConstructibleEventTarget.h @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef mozilla_dom_ConstructibleEventTarget_h_ +#define mozilla_dom_ConstructibleEventTarget_h_ + +#include "mozilla/DOMEventTargetHelper.h" +#include "js/RootingAPI.h" + +namespace mozilla { +namespace dom { + +class ConstructibleEventTarget : public DOMEventTargetHelper +{ +public: + // We're not worrying about ISupports and Cycle Collection here just for a wrapper function. + // This does mean that ConstructibleEventTarget will show up in CC and refcount logs as a + // DOMEventTargetHelper, but that's OK. + + explicit ConstructibleEventTarget(nsIGlobalObject* aGlobalObject) + : DOMEventTargetHelper(aGlobalObject) + { + } + + virtual JSObject* WrapObject(JSContext* cx, + JS::Handle aGivenProto) override; +}; + +} // namespace dom +} // namespace mozilla + +#endif // mozilla_dom_ConstructibleEventTarget_h_ diff --git a/dom/events/DOMEventTargetHelper.h b/dom/events/DOMEventTargetHelper.h index 63f3598048..9a1938078d 100644 --- a/dom/events/DOMEventTargetHelper.h +++ b/dom/events/DOMEventTargetHelper.h @@ -146,10 +146,7 @@ public: void BindToOwner(nsPIDOMWindowInner* aOwner); void BindToOwner(DOMEventTargetHelper* aOther); virtual void DisconnectFromOwner(); - nsIGlobalObject* GetParentObject() const - { - return GetOwnerGlobal(); - } + using EventTarget::GetParentObject; virtual nsIGlobalObject* GetOwnerGlobal() const override { nsCOMPtr parentObject = do_QueryReferent(mParentObject); diff --git a/dom/events/EventTarget.cpp b/dom/events/EventTarget.cpp index cf69dcb859..5f9228c21c 100644 --- a/dom/events/EventTarget.cpp +++ b/dom/events/EventTarget.cpp @@ -7,11 +7,26 @@ #include "mozilla/dom/Event.h" #include "mozilla/dom/EventTarget.h" #include "mozilla/dom/EventTargetBinding.h" +#include "mozilla/dom/ConstructibleEventTarget.h" +#include "nsIGlobalObject.h" #include "nsThreadUtils.h" namespace mozilla { namespace dom { +/* static */ +already_AddRefed +EventTarget::Constructor(const GlobalObject& aGlobal, ErrorResult& aRv) +{ + nsCOMPtr global = do_QueryInterface(aGlobal.GetAsSupports()); + if (!global) { + aRv.Throw(NS_ERROR_UNEXPECTED); + return nullptr; + } + RefPtr target = new ConstructibleEventTarget(global); + return target.forget(); +} + void EventTarget::RemoveEventListener(const nsAString& aType, EventListener* aListener, diff --git a/dom/events/EventTarget.h b/dom/events/EventTarget.h index c64296993b..251600dfb9 100644 --- a/dom/events/EventTarget.h +++ b/dom/events/EventTarget.h @@ -26,6 +26,7 @@ class Event; class EventListener; class EventListenerOptionsOrBoolean; class EventHandlerNonNull; +class GlobalObject; template struct Nullable; @@ -41,6 +42,8 @@ public: NS_DECLARE_STATIC_IID_ACCESSOR(NS_EVENTTARGET_IID) // WebIDL API + static already_AddRefed Constructor(const GlobalObject& aGlobal, + ErrorResult& aRv); using nsIDOMEventTarget::AddEventListener; using nsIDOMEventTarget::RemoveEventListener; using nsIDOMEventTarget::DispatchEvent; @@ -55,6 +58,11 @@ public: ErrorResult& aRv); bool DispatchEvent(JSContext* aCx, Event& aEvent, ErrorResult& aRv); + nsIGlobalObject* GetParentObject() const + { + return GetOwnerGlobal(); + } + // Note, this takes the type in onfoo form! EventHandlerNonNull* GetEventHandler(const nsAString& aType) { diff --git a/dom/events/moz.build b/dom/events/moz.build index c5fd750146..d651167bd9 100644 --- a/dom/events/moz.build +++ b/dom/events/moz.build @@ -40,6 +40,7 @@ EXPORTS.mozilla.dom += [ 'ClipboardEvent.h', 'CommandEvent.h', 'CompositionEvent.h', + 'ConstructibleEventTarget.h', 'CustomEvent.h', 'DataContainerEvent.h', 'DataTransfer.h', @@ -80,6 +81,7 @@ SOURCES += [ 'ClipboardEvent.cpp', 'CommandEvent.cpp', 'CompositionEvent.cpp', + 'ConstructibleEventTarget.cpp', 'ContentEventHandler.cpp', 'CustomEvent.cpp', 'DataContainerEvent.cpp', diff --git a/dom/webidl/EventTarget.webidl b/dom/webidl/EventTarget.webidl index 9e8a267ff4..123fac4785 100644 --- a/dom/webidl/EventTarget.webidl +++ b/dom/webidl/EventTarget.webidl @@ -23,7 +23,8 @@ dictionary AddEventListenerOptions : EventListenerOptions { boolean once = false; }; -[Exposed=(Window,Worker,WorkerDebugger,System)] +[Constructor, + Exposed=(Window,Worker,WorkerDebugger,System)] interface EventTarget { /* Passing null for wantsUntrusted means "default behavior", which differs in content and chrome. In content that default boolean diff --git a/gfx/angle/src/libANGLE/renderer/d3d/d3d11/Image11.cpp b/gfx/angle/src/libANGLE/renderer/d3d/d3d11/Image11.cpp index d27a8d53af..332db77e92 100644 --- a/gfx/angle/src/libANGLE/renderer/d3d/d3d11/Image11.cpp +++ b/gfx/angle/src/libANGLE/renderer/d3d/d3d11/Image11.cpp @@ -205,6 +205,7 @@ bool Image11::redefine(GLenum target, GLenum internalformat, const gl::Extents & { if (mWidth != size.width || mHeight != size.height || + mDepth != size.depth || mInternalFormat != internalformat || forceRelease) { diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js index 8baae8ed2a..d2e34fb4ff 100644 --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js @@ -1463,9 +1463,7 @@ pref("network.http.redirection-limit", 20); // Enable http compression: comment this out in case of problems with 1.1 // NOTE: support for "compress" has been disabled per bug 196406. // NOTE: separate values with comma+space (", "): see bug 576033 -// NOTE: there is currently no reason except evangelism for https to not use brotli for http pref("network.http.accept-encoding", "gzip, deflate, br"); -pref("network.http.accept-encoding.secure", "gzip, deflate, br"); pref("network.http.pipelining" , true); pref("network.http.pipelining.ssl" , false); // disable pipelining over SSL diff --git a/netwerk/base/nsIOService.cpp b/netwerk/base/nsIOService.cpp index d04b3cef12..ffe3ab2ace 100644 --- a/netwerk/base/nsIOService.cpp +++ b/netwerk/base/nsIOService.cpp @@ -165,7 +165,7 @@ int16_t gBadPortList[] = { 6667, // Standard IRC [Apple addition] 6668, // Alternate IRC [Apple addition] 6669, // Alternate IRC [Apple addition] - 10080,// Amanda + // 10080,// (Amanda) too many collisions with other services, disabled for now. 0, // Sentinel value: This MUST be zero }; diff --git a/netwerk/base/nsStandardURL.cpp b/netwerk/base/nsStandardURL.cpp index 1866c10379..3d77093004 100644 --- a/netwerk/base/nsStandardURL.cpp +++ b/netwerk/base/nsStandardURL.cpp @@ -315,6 +315,46 @@ DumpLeakedURLs::~DumpLeakedURLs() } #endif +bool nsStandardURL::IsValid() { + auto checkSegment = [&](const nsStandardURL::URLSegment& aSeg) { + // Bad value + if (NS_WARN_IF(aSeg.mLen < -1)) { + return false; + } + if (aSeg.mLen == -1) { + return true; + } + + // Position outside of string + if (NS_WARN_IF(aSeg.mPos + aSeg.mLen > mSpec.Length())) { + return false; + } + + // Overflow + if (NS_WARN_IF(aSeg.mPos + aSeg.mLen < aSeg.mPos)) { + return false; + } + + return true; + }; + + bool allSegmentsValid = checkSegment(mScheme) && checkSegment(mAuthority) && + checkSegment(mUsername) && checkSegment(mPassword) && + checkSegment(mHost) && checkSegment(mPath) && + checkSegment(mFilepath) && checkSegment(mDirectory) && + checkSegment(mBasename) && checkSegment(mExtension) && + checkSegment(mQuery) && checkSegment(mRef); + if (!allSegmentsValid) { + return false; + } + + if (mScheme.mPos != 0) { + return false; + } + + return true; +} + void nsStandardURL::InitGlobalObjects() { @@ -2752,8 +2792,8 @@ nsStandardURL::SetFilePath(const nsACString &input) mSpec.Cut(mPath.mPos + 1, mFilepath.mLen - 1); // left shift query, and ref ShiftFromQuery(1 - mFilepath.mLen); - // One character for '/', and if we have a query or ref we add their - // length and one extra for each '?' or '#' characters + // One character for '/', and if we have a query or ref we add their + // length and one extra for each '?' or '#' characters mPath.mLen = 1 + (mQuery.mLen >= 0 ? (mQuery.mLen + 1) : 0) + (mRef.mLen >= 0 ? (mRef.mLen + 1) : 0); // these contain only a '/' @@ -3518,6 +3558,10 @@ nsStandardURL::Deserialize(const URIParams& aParams) return false; } + // If we exit early, make sure to clear the URL so we don't fail the sanity + // check in the destructor + auto clearOnExit = MakeScopeExit([&] { Clear(); }); + const StandardURLParams& params = aParams.get_StandardURLParams(); mURLType = params.urlType(); @@ -3565,7 +3609,7 @@ nsStandardURL::Deserialize(const URIParams& aParams) mSupportsFileURL = params.supportsFileURL(); mHostEncoding = params.hostEncoding(); - // Some sanity checks + // Some segment sanity checks NS_ENSURE_TRUE(mScheme.mPos == 0, false); NS_ENSURE_TRUE(mScheme.mLen > 0, false); // Make sure scheme is followed by :// (3 characters) @@ -3577,6 +3621,13 @@ nsStandardURL::Deserialize(const URIParams& aParams) NS_ENSURE_TRUE(mQuery.mLen == -1 || mSpec.CharAt(mQuery.mPos - 1) == '?', false); NS_ENSURE_TRUE(mRef.mLen == -1 || mSpec.CharAt(mRef.mPos - 1) == '#', false); + // Sanity-check the result + if (!IsValid()) { + return false; + } + + clearOnExit.release(); + // mSpecEncoding and mHostA are just caches that can be recovered as needed. return true; } diff --git a/netwerk/base/nsStandardURL.h b/netwerk/base/nsStandardURL.h index eba85528c7..580e1ff262 100644 --- a/netwerk/base/nsStandardURL.h +++ b/netwerk/base/nsStandardURL.h @@ -253,6 +253,9 @@ private: void FindHostLimit(nsACString::const_iterator& aStart, nsACString::const_iterator& aEnd); + // Checks if the URL has a valid representation. + bool IsValid(); + // mSpec contains the normalized version of the URL spec (UTF-8 encoded). nsCString mSpec; int32_t mDefaultPort; diff --git a/netwerk/cache2/CacheIOThread.cpp b/netwerk/cache2/CacheIOThread.cpp index c686c0f8d0..fe0a4ddb05 100644 --- a/netwerk/cache2/CacheIOThread.cpp +++ b/netwerk/cache2/CacheIOThread.cpp @@ -215,12 +215,22 @@ nsresult CacheIOThread::Init() mBlockingIOWatcher = MakeUnique(); } + // Increase the reference count while spawning a new thread. + // If PR_CreateThread succeeds, we will forget this reference and the thread + // will be responsible to release it when it completes. + RefPtr self = this; + mThread = PR_CreateThread(PR_USER_THREAD, ThreadFunc, this, PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_JOINABLE_THREAD, 128 * 1024); if (!mThread) { return NS_ERROR_FAILURE; } + + // IMPORTANT: The thread now owns this reference, so it's important that we + // leak it here, otherwise we'll end up with a bad refcount. + // See the dont_AddRef in ThreadFunc(). + Unused << self.forget().take(); return NS_OK; } @@ -382,7 +392,9 @@ void CacheIOThread::ThreadFunc(void* aClosure) { PR_SetCurrentThreadName("Cache2 I/O"); mozilla::IOInterposer::RegisterCurrentThread(); - CacheIOThread* thread = static_cast(aClosure); + // We hold on to this reference for the duration of the thread. + RefPtr thread = + dont_AddRef(static_cast(aClosure)); thread->ThreadFunc(); mozilla::IOInterposer::UnregisterCurrentThread(); } diff --git a/netwerk/protocol/http/HttpBaseChannel.cpp b/netwerk/protocol/http/HttpBaseChannel.cpp index f7040a4b4c..877915acb5 100644 --- a/netwerk/protocol/http/HttpBaseChannel.cpp +++ b/netwerk/protocol/http/HttpBaseChannel.cpp @@ -171,10 +171,7 @@ HttpBaseChannel::Init(nsIURI *aURI, int32_t port = -1; bool isHTTPS = false; - nsresult rv = mURI->SchemeIs("https", &isHTTPS); - if (NS_FAILED(rv)) return rv; - - rv = mURI->GetAsciiHost(host); + nsresult rv = mURI->GetAsciiHost(host); if (NS_FAILED(rv)) return rv; // Reject the URL if it doesn't specify a host @@ -201,7 +198,7 @@ HttpBaseChannel::Init(nsIURI *aURI, rv = mRequestHead.SetHeader(nsHttp::Host, hostLine); if (NS_FAILED(rv)) return rv; - rv = gHttpHandler->AddStandardRequestHeaders(&mRequestHead, isHTTPS, aContentPolicyType); + rv = gHttpHandler->AddStandardRequestHeaders(&mRequestHead, aContentPolicyType); if (NS_FAILED(rv)) return rv; nsAutoCString type; @@ -975,9 +972,7 @@ HttpBaseChannel::DoApplyContentConversions(nsIStreamListener* aNextListener, break; } - bool isHTTPS = false; - mURI->SchemeIs("https", &isHTTPS); - if (gHttpHandler->IsAcceptableEncoding(val, isHTTPS)) { + if (gHttpHandler->IsAcceptableEncoding(val)) { nsCOMPtr serv; rv = gHttpHandler->GetStreamConverterService(getter_AddRefs(serv)); diff --git a/netwerk/protocol/http/nsHttpHandler.cpp b/netwerk/protocol/http/nsHttpHandler.cpp index 30f5703a52..b103ac66ad 100644 --- a/netwerk/protocol/http/nsHttpHandler.cpp +++ b/netwerk/protocol/http/nsHttpHandler.cpp @@ -446,7 +446,6 @@ nsHttpHandler::InitConnectionMgr() nsresult nsHttpHandler::AddStandardRequestHeaders(nsHttpRequestHead *request, - bool isSecure, nsContentPolicyType aContentPolicyType) { nsresult rv; @@ -493,15 +492,9 @@ nsHttpHandler::AddStandardRequestHeaders(nsHttpRequestHead *request, } // Add the "Accept-Encoding" header - if (isSecure) { - rv = request->SetHeader(nsHttp::Accept_Encoding, mHttpsAcceptEncodings, - false, - nsHttpHeaderArray::eVarietyRequestDefault); - } else { - rv = request->SetHeader(nsHttp::Accept_Encoding, mHttpAcceptEncodings, - false, - nsHttpHeaderArray::eVarietyRequestDefault); - } + rv = request->SetHeader(nsHttp::Accept_Encoding, mAcceptEncodings, + false, + nsHttpHeaderArray::eVarietyRequestDefault); if (NS_FAILED(rv)) return rv; // add the "Send Hint" header @@ -535,19 +528,15 @@ nsHttpHandler::AddConnectionHeader(nsHttpRequestHead *request, } bool -nsHttpHandler::IsAcceptableEncoding(const char *enc, bool isSecure) +nsHttpHandler::IsAcceptableEncoding(const char *enc) { if (!enc) return false; // we used to accept x-foo anytime foo was acceptable, but that's just // continuing bad behavior.. so limit it to known x-* patterns - bool rv; - if (isSecure) { - rv = nsHttp::FindToken(mHttpsAcceptEncodings.get(), enc, HTTP_LWS ",") != nullptr; - } else { - rv = nsHttp::FindToken(mHttpAcceptEncodings.get(), enc, HTTP_LWS ",") != nullptr; - } + bool rv = nsHttp::FindToken(mAcceptEncodings.get(), enc, HTTP_LWS ",") != nullptr; + // gzip and deflate are inherently acceptable in modern HTTP - always // process them if a stream converter can also be found. if (!rv && @@ -555,8 +544,8 @@ nsHttpHandler::IsAcceptableEncoding(const char *enc, bool isSecure) !PL_strcasecmp(enc, "x-gzip") || !PL_strcasecmp(enc, "x-deflate"))) { rv = true; } - LOG(("nsHttpHandler::IsAceptableEncoding %s https=%d %d\n", - enc, isSecure, rv)); + LOG(("nsHttpHandler::IsAceptableEncoding %s %d\n", + enc, rv)); return rv; } @@ -1275,16 +1264,7 @@ nsHttpHandler::PrefsChanged(nsIPrefBranch *prefs, const char *pref) rv = prefs->GetCharPref(HTTP_PREF("accept-encoding"), getter_Copies(acceptEncodings)); if (NS_SUCCEEDED(rv)) { - SetAcceptEncodings(acceptEncodings, false); - } - } - - if (PREF_CHANGED(HTTP_PREF("accept-encoding.secure"))) { - nsXPIDLCString acceptEncodings; - rv = prefs->GetCharPref(HTTP_PREF("accept-encoding.secure"), - getter_Copies(acceptEncodings)); - if (NS_SUCCEEDED(rv)) { - SetAcceptEncodings(acceptEncodings, true); + SetAcceptEncodings(acceptEncodings); } } @@ -1910,18 +1890,9 @@ nsHttpHandler::SetAccept(const char *aAccept, AcceptType aType) } nsresult -nsHttpHandler::SetAcceptEncodings(const char *aAcceptEncodings, bool isSecure) +nsHttpHandler::SetAcceptEncodings(const char *aAcceptEncodings) { - if (isSecure) { - mHttpsAcceptEncodings = aAcceptEncodings; - } else { - // use legacy list if a secure override is not specified - mHttpAcceptEncodings = aAcceptEncodings; - if (mHttpsAcceptEncodings.IsEmpty()) { - mHttpsAcceptEncodings = aAcceptEncodings; - } - } - + mAcceptEncodings = aAcceptEncodings; return NS_OK; } diff --git a/netwerk/protocol/http/nsHttpHandler.h b/netwerk/protocol/http/nsHttpHandler.h index 4f632e0784..c3f6290095 100644 --- a/netwerk/protocol/http/nsHttpHandler.h +++ b/netwerk/protocol/http/nsHttpHandler.h @@ -79,10 +79,10 @@ public: nsHttpHandler(); nsresult Init(); - nsresult AddStandardRequestHeaders(nsHttpRequestHead *, bool isSecure, nsContentPolicyType aContentPolicyType); + nsresult AddStandardRequestHeaders(nsHttpRequestHead *, nsContentPolicyType aContentPolicyType); nsresult AddConnectionHeader(nsHttpRequestHead *, uint32_t capabilities); - bool IsAcceptableEncoding(const char *encoding, bool isSecure); + bool IsAcceptableEncoding(const char *encoding); const nsAFlatCString &UserAgent(); @@ -398,7 +398,7 @@ private: nsresult SetAccept(const char *, AcceptType aType); nsresult SetAcceptLanguages(); - nsresult SetAcceptEncodings(const char *, bool mIsSecure); + nsresult SetAcceptEncodings(const char *); nsresult InitConnectionMgr(); @@ -476,8 +476,7 @@ private: nsCString mAcceptStyle; nsCString mAcceptDefault; nsCString mAcceptLanguages; - nsCString mHttpAcceptEncodings; - nsCString mHttpsAcceptEncodings; + nsCString mAcceptEncodings; nsXPIDLCString mDefaultSocketType; diff --git a/netwerk/test/gtest/TestStandardURL.cpp b/netwerk/test/gtest/TestStandardURL.cpp index a013f351cf..44133efcbb 100644 --- a/netwerk/test/gtest/TestStandardURL.cpp +++ b/netwerk/test/gtest/TestStandardURL.cpp @@ -9,6 +9,10 @@ #include "nsComponentManagerUtils.h" #include "nsIIPCSerializableURI.h" #include "mozilla/ipc/URIUtils.h" +#include "mozilla/Unused.h" +#include "nsSerializationHelper.h" +#include "mozilla/Base64.h" +#include "nsEscape.h" TEST(TestStandardURL, Simple) { nsCOMPtr url( do_CreateInstance(NS_STANDARDURL_CONTRACTID) ); @@ -83,3 +87,50 @@ TEST(TestStandardURL, Deserialize_Bug1392739) nsCOMPtr url = do_CreateInstance(NS_STANDARDURL_CID); ASSERT_EQ(url->Deserialize(params), false); } + +TEST(TestStandardURL, CorruptSerialization) +{ + auto spec = "http://user:pass@example.com/path/to/file.ext?query#hash"_ns; + + nsCOMPtr uri; + nsresult rv = NS_MutateURI(NS_STANDARDURLMUTATOR_CONTRACTID) + .SetSpec(spec) + .Finalize(uri); + ASSERT_EQ(rv, NS_OK); + + nsAutoCString serialization; + nsCOMPtr serializable = do_QueryInterface(uri); + ASSERT_TRUE(serializable); + + // Check that the URL is normally serializable. + ASSERT_EQ(NS_OK, NS_SerializeToString(serializable, serialization)); + nsCOMPtr deserializedObject; + ASSERT_EQ(NS_OK, NS_DeserializeObject(serialization, + getter_AddRefs(deserializedObject))); + + nsAutoCString canonicalBin; + Unused << Base64Decode(serialization, canonicalBin); + +// The spec serialization begins at byte 49 +// If the implementation of nsStandardURL::Write changes, this test will need +// to be adjusted. +#define SPEC_OFFSET 49 + + ASSERT_EQ(Substring(canonicalBin, SPEC_OFFSET, 7), "http://"_ns); + + nsAutoCString corruptedBin = canonicalBin; + // change mScheme.mPos + corruptedBin.BeginWriting()[SPEC_OFFSET + spec.Length()] = 1; + Unused << Base64Encode(corruptedBin, serialization); + ASSERT_EQ( + NS_ERROR_MALFORMED_URI, + NS_DeserializeObject(serialization, getter_AddRefs(deserializedObject))); + + corruptedBin = canonicalBin; + // change mScheme.mLen + corruptedBin.BeginWriting()[SPEC_OFFSET + spec.Length() + 4] = 127; + Unused << Base64Encode(corruptedBin, serialization); + ASSERT_EQ( + NS_ERROR_MALFORMED_URI, + NS_DeserializeObject(serialization, getter_AddRefs(deserializedObject))); +} \ No newline at end of file diff --git a/nsprpub/pr/src/misc/prinit.c b/nsprpub/pr/src/misc/prinit.c index 5ac99fe588..a952ad6554 100644 --- a/nsprpub/pr/src/misc/prinit.c +++ b/nsprpub/pr/src/misc/prinit.c @@ -771,10 +771,15 @@ PR_IMPLEMENT(PRStatus) PR_CallOnce( _PR_ImplicitInitialization(); } - if (!once->initialized) { + PR_Lock(mod_init.ml); + PRIntn initialized = once->initialized; + PRStatus status = once->status; + PR_Unlock(mod_init.ml); + if (!initialized) { if (PR_ATOMIC_SET(&once->inProgress, 1) == 0) { - once->status = (*func)(); + status = (*func)(); PR_Lock(mod_init.ml); + once->status = status; once->initialized = 1; PR_NotifyAllCondVar(mod_init.cv); PR_Unlock(mod_init.ml); @@ -783,14 +788,18 @@ PR_IMPLEMENT(PRStatus) PR_CallOnce( while (!once->initialized) { PR_WaitCondVar(mod_init.cv, PR_INTERVAL_NO_TIMEOUT); } + status = once->status; PR_Unlock(mod_init.ml); + if (PR_SUCCESS != status) { + PR_SetError(PR_CALL_ONCE_ERROR, 0); + } } - } else { - if (PR_SUCCESS != once->status) { - PR_SetError(PR_CALL_ONCE_ERROR, 0); - } + return status; } - return once->status; + if (PR_SUCCESS != status) { + PR_SetError(PR_CALL_ONCE_ERROR, 0); + } + return status; } PR_IMPLEMENT(PRStatus) PR_CallOnceWithArg( @@ -802,10 +811,15 @@ PR_IMPLEMENT(PRStatus) PR_CallOnceWithArg( _PR_ImplicitInitialization(); } - if (!once->initialized) { + PR_Lock(mod_init.ml); + PRIntn initialized = once->initialized; + PRStatus status = once->status; + PR_Unlock(mod_init.ml); + if (!initialized) { if (PR_ATOMIC_SET(&once->inProgress, 1) == 0) { - once->status = (*func)(arg); + status = (*func)(arg); PR_Lock(mod_init.ml); + once->status = status; once->initialized = 1; PR_NotifyAllCondVar(mod_init.cv); PR_Unlock(mod_init.ml); @@ -814,14 +828,18 @@ PR_IMPLEMENT(PRStatus) PR_CallOnceWithArg( while (!once->initialized) { PR_WaitCondVar(mod_init.cv, PR_INTERVAL_NO_TIMEOUT); } + status = once->status; PR_Unlock(mod_init.ml); + if (PR_SUCCESS != status) { + PR_SetError(PR_CALL_ONCE_ERROR, 0); + } } - } else { - if (PR_SUCCESS != once->status) { - PR_SetError(PR_CALL_ONCE_ERROR, 0); - } + return status; } - return once->status; + if (PR_SUCCESS != status) { + PR_SetError(PR_CALL_ONCE_ERROR, 0); + } + return status; } PRBool _PR_Obsolete(const char *obsolete, const char *preferred) diff --git a/testing/web-platform/meta/html/semantics/interactive-elements/the-details-element/details.html.ini b/testing/web-platform/meta/html/semantics/interactive-elements/the-details-element/details.html.ini deleted file mode 100644 index 6ffca742cc..0000000000 --- a/testing/web-platform/meta/html/semantics/interactive-elements/the-details-element/details.html.ini +++ /dev/null @@ -1,3 +0,0 @@ -[details.html] - type: testharness - prefs: [dom.details_element.enabled:true] diff --git a/testing/web-platform/meta/html/semantics/interactive-elements/the-details-element/toggleEvent.html.ini b/testing/web-platform/meta/html/semantics/interactive-elements/the-details-element/toggleEvent.html.ini deleted file mode 100644 index 335ffd5b3a..0000000000 --- a/testing/web-platform/meta/html/semantics/interactive-elements/the-details-element/toggleEvent.html.ini +++ /dev/null @@ -1,3 +0,0 @@ -[toggleEvent.html] - type: testharness - prefs: [dom.details_element.enabled:true] diff --git a/toolkit/themes/windows/global/console/console.css b/toolkit/themes/windows/global/console/console.css index d918fb73c8..4fb3fab706 100644 --- a/toolkit/themes/windows/global/console/console.css +++ b/toolkit/themes/windows/global/console/console.css @@ -208,11 +208,13 @@ toolbar#ToolbarMode .toolbarbutton-text { } %ifdef XP_WIN -#ToolbarMode { - -moz-appearance: -moz-win-browsertabbar-toolbox; -} +@media not (-moz-os-version: windows-win10) { + #ToolbarMode { + -moz-appearance: -moz-win-browsertabbar-toolbox; + } -#ToolbarEval { - -moz-appearance: toolbox; + #ToolbarEval { + -moz-appearance: toolbox; + } } %endif diff --git a/toolkit/themes/windows/global/toolbar.css b/toolkit/themes/windows/global/toolbar.css index 97310e1aeb..0a6eb943a0 100644 --- a/toolkit/themes/windows/global/toolbar.css +++ b/toolkit/themes/windows/global/toolbar.css @@ -23,6 +23,12 @@ toolbox { so don't use the widget toolbox styling and fallback to -moz-Dialog's color which by default should be a non-blinding rgb(240, 240, 240) */ -moz-appearance: none; + + /* Since we are overriding the style we want to provide the bottom border + that is normally drawn by look&feel. + However, local application styling may also provide it on adjacent + widgets as a border-top. Those will need to omit it on Windows 10. */ + border-bottom: 1px solid ThreeDShadow; } } diff --git a/toolkit/themes/windows/global/tree.css b/toolkit/themes/windows/global/tree.css index 1300968248..ee176296b2 100644 --- a/toolkit/themes/windows/global/tree.css +++ b/toolkit/themes/windows/global/tree.css @@ -198,6 +198,14 @@ treechildren::-moz-tree-cell-text(progressmeter) { /* ::::: tree columns ::::: */ +@media (-moz-os-version: windows-win10) and (-moz-windows-theme: aero) { + treecols { + /* Windows 10's "aero" msstyle does not provide a complete style for + the treecols header so we need to provide a bottom border */ + border-bottom: 1px solid ThreeDLightShadow; + } +} + treecol, treecolpicker { -moz-appearance: treeheadercell; diff --git a/toolkit/themes/windows/mozapps/downloads/downloads.css b/toolkit/themes/windows/mozapps/downloads/downloads.css index 202ec016fe..3f1bcbec31 100644 --- a/toolkit/themes/windows/mozapps/downloads/downloads.css +++ b/toolkit/themes/windows/mozapps/downloads/downloads.css @@ -111,7 +111,7 @@ richlistitem[type="download"] .dateTime { margin-top: 3px; } -@media (-moz-windows-compositor) { +@media (-moz-windows-compositor) and (-moz-os-version: windows-win7) { #downloadManager { -moz-appearance: -moz-win-glass; background: transparent; diff --git a/widget/GfxInfoX11.cpp b/widget/GfxInfoX11.cpp index 05a2cab1a1..af374dc44a 100644 --- a/widget/GfxInfoX11.cpp +++ b/widget/GfxInfoX11.cpp @@ -359,7 +359,11 @@ GfxInfo::GetFeatureStatusImpl(int32_t aFeature, aSuggestedDriverVersion.AssignLiteral("Mesa 8.1"); } } - + else if (mIsNouveau && version(mMajorVersion, mMinorVersion) < version(11,0)) { + *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION; + aFailureId = "FEATURE_FAILURE_OLD_NOUVEAU"; + aSuggestedDriverVersion.AssignLiteral("Mesa 11.0"); + } } else if (mIsNVIDIA) { if (version(mMajorVersion, mMinorVersion, mRevisionVersion) < version(257,21)) { *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION;