mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
Merge inbound to m-c a=merge CLOSED TREE
This commit is contained in:
commit
76bf2680e6
@ -635,8 +635,11 @@ pref("accessibility.typeaheadfind", false);
|
||||
pref("accessibility.typeaheadfind.timeout", 5000);
|
||||
pref("accessibility.typeaheadfind.linksonly", false);
|
||||
pref("accessibility.typeaheadfind.flashBar", 1);
|
||||
|
||||
#ifdef NIGHTLY_BUILD
|
||||
pref("findbar.highlightAll", true);
|
||||
pref("findbar.modalHighlight", true);
|
||||
#endif
|
||||
|
||||
// Tracks when accessibility is loaded into the previous session.
|
||||
pref("accessibility.loadedInLastSession", false);
|
||||
|
@ -4,7 +4,7 @@
|
||||
* 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 "nsLocation.h"
|
||||
#include "Location.h"
|
||||
#include "nsIScriptSecurityManager.h"
|
||||
#include "nsIScriptObjectPrincipal.h"
|
||||
#include "nsIScriptContext.h"
|
||||
@ -35,8 +35,8 @@
|
||||
#include "ScriptSettings.h"
|
||||
#include "mozilla/dom/LocationBinding.h"
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::dom;
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
static nsresult
|
||||
GetDocumentCharacterSetForURI(const nsAString& aHref, nsACString& aCharset)
|
||||
@ -50,7 +50,7 @@ GetDocumentCharacterSetForURI(const nsAString& aHref, nsACString& aCharset)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsLocation::nsLocation(nsPIDOMWindowInner* aWindow, nsIDocShell *aDocShell)
|
||||
Location::Location(nsPIDOMWindowInner* aWindow, nsIDocShell *aDocShell)
|
||||
: mInnerWindow(aWindow)
|
||||
{
|
||||
MOZ_ASSERT(aDocShell);
|
||||
@ -59,49 +59,49 @@ nsLocation::nsLocation(nsPIDOMWindowInner* aWindow, nsIDocShell *aDocShell)
|
||||
mDocShell = do_GetWeakReference(aDocShell);
|
||||
}
|
||||
|
||||
nsLocation::~nsLocation()
|
||||
Location::~Location()
|
||||
{
|
||||
}
|
||||
|
||||
// QueryInterface implementation for nsLocation
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsLocation)
|
||||
// QueryInterface implementation for Location
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(Location)
|
||||
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMLocation)
|
||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMLocation)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(nsLocation)
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(Location)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsLocation)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(Location)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(mInnerWindow);
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsLocation)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(Location)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mInnerWindow)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(nsLocation)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(Location)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTING_ADDREF(nsLocation)
|
||||
NS_IMPL_CYCLE_COLLECTING_RELEASE(nsLocation)
|
||||
NS_IMPL_CYCLE_COLLECTING_ADDREF(Location)
|
||||
NS_IMPL_CYCLE_COLLECTING_RELEASE(Location)
|
||||
|
||||
void
|
||||
nsLocation::SetDocShell(nsIDocShell *aDocShell)
|
||||
Location::SetDocShell(nsIDocShell *aDocShell)
|
||||
{
|
||||
mDocShell = do_GetWeakReference(aDocShell);
|
||||
}
|
||||
|
||||
nsIDocShell *
|
||||
nsLocation::GetDocShell()
|
||||
Location::GetDocShell()
|
||||
{
|
||||
nsCOMPtr<nsIDocShell> docshell(do_QueryReferent(mDocShell));
|
||||
return docshell;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsLocation::CheckURL(nsIURI* aURI, nsIDocShellLoadInfo** aLoadInfo)
|
||||
Location::CheckURL(nsIURI* aURI, nsIDocShellLoadInfo** aLoadInfo)
|
||||
{
|
||||
*aLoadInfo = nullptr;
|
||||
|
||||
@ -164,10 +164,11 @@ nsLocation::CheckURL(nsIURI* aURI, nsIDocShellLoadInfo** aLoadInfo)
|
||||
sourceURI = docCurrentURI;
|
||||
}
|
||||
else {
|
||||
// Use principalURI as long as it is not an nsNullPrincipalURI.
|
||||
// We could add a method such as GetReferrerURI to principals to make this
|
||||
// cleaner, but given that we need to start using Source Browsing Context
|
||||
// for referrer (see Bug 960639) this may be wasted effort at this stage.
|
||||
// Use principalURI as long as it is not an nsNullPrincipalURI. We
|
||||
// could add a method such as GetReferrerURI to principals to make this
|
||||
// cleaner, but given that we need to start using Source Browsing
|
||||
// Context for referrer (see Bug 960639) this may be wasted effort at
|
||||
// this stage.
|
||||
if (principalURI) {
|
||||
bool isNullPrincipalScheme;
|
||||
rv = principalURI->SchemeIs(NS_NULLPRINCIPAL_SCHEME,
|
||||
@ -205,7 +206,7 @@ nsLocation::CheckURL(nsIURI* aURI, nsIDocShellLoadInfo** aLoadInfo)
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsLocation::GetURI(nsIURI** aURI, bool aGetInnermostURI)
|
||||
Location::GetURI(nsIURI** aURI, bool aGetInnermostURI)
|
||||
{
|
||||
*aURI = nullptr;
|
||||
|
||||
@ -243,7 +244,7 @@ nsLocation::GetURI(nsIURI** aURI, bool aGetInnermostURI)
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsLocation::GetWritableURI(nsIURI** aURI, const nsACString* aNewRef)
|
||||
Location::GetWritableURI(nsIURI** aURI, const nsACString* aNewRef)
|
||||
{
|
||||
*aURI = nullptr;
|
||||
|
||||
@ -262,7 +263,7 @@ nsLocation::GetWritableURI(nsIURI** aURI, const nsACString* aNewRef)
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsLocation::SetURI(nsIURI* aURI, bool aReplace)
|
||||
Location::SetURI(nsIURI* aURI, bool aReplace)
|
||||
{
|
||||
nsCOMPtr<nsIDocShell> docShell(do_QueryReferent(mDocShell));
|
||||
if (docShell) {
|
||||
@ -292,7 +293,7 @@ nsLocation::SetURI(nsIURI* aURI, bool aReplace)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsLocation::GetHash(nsAString& aHash)
|
||||
Location::GetHash(nsAString& aHash)
|
||||
{
|
||||
aHash.SetLength(0);
|
||||
|
||||
@ -351,7 +352,7 @@ nsLocation::GetHash(nsAString& aHash)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsLocation::SetHash(const nsAString& aHash)
|
||||
Location::SetHash(const nsAString& aHash)
|
||||
{
|
||||
NS_ConvertUTF16toUTF8 hash(aHash);
|
||||
if (hash.IsEmpty() || hash.First() != char16_t('#')) {
|
||||
@ -367,7 +368,7 @@ nsLocation::SetHash(const nsAString& aHash)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsLocation::GetHost(nsAString& aHost)
|
||||
Location::GetHost(nsAString& aHost)
|
||||
{
|
||||
aHost.Truncate();
|
||||
|
||||
@ -390,7 +391,7 @@ nsLocation::GetHost(nsAString& aHost)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsLocation::SetHost(const nsAString& aHost)
|
||||
Location::SetHost(const nsAString& aHost)
|
||||
{
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
nsresult rv = GetWritableURI(getter_AddRefs(uri));
|
||||
@ -407,7 +408,7 @@ nsLocation::SetHost(const nsAString& aHost)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsLocation::GetHostname(nsAString& aHostname)
|
||||
Location::GetHostname(nsAString& aHostname)
|
||||
{
|
||||
aHostname.Truncate();
|
||||
|
||||
@ -421,7 +422,7 @@ nsLocation::GetHostname(nsAString& aHostname)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsLocation::SetHostname(const nsAString& aHostname)
|
||||
Location::SetHostname(const nsAString& aHostname)
|
||||
{
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
nsresult rv = GetWritableURI(getter_AddRefs(uri));
|
||||
@ -438,7 +439,7 @@ nsLocation::SetHostname(const nsAString& aHostname)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsLocation::GetHref(nsAString& aHref)
|
||||
Location::GetHref(nsAString& aHref)
|
||||
{
|
||||
aHref.Truncate();
|
||||
|
||||
@ -461,7 +462,7 @@ nsLocation::GetHref(nsAString& aHref)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsLocation::SetHref(const nsAString& aHref)
|
||||
Location::SetHref(const nsAString& aHref)
|
||||
{
|
||||
nsAutoString oldHref;
|
||||
nsresult rv = NS_OK;
|
||||
@ -487,7 +488,7 @@ nsLocation::SetHref(const nsAString& aHref)
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsLocation::SetHrefWithContext(JSContext* cx, const nsAString& aHref,
|
||||
Location::SetHrefWithContext(JSContext* cx, const nsAString& aHref,
|
||||
bool aReplace)
|
||||
{
|
||||
nsCOMPtr<nsIURI> base;
|
||||
@ -503,7 +504,7 @@ nsLocation::SetHrefWithContext(JSContext* cx, const nsAString& aHref,
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsLocation::SetHrefWithBase(const nsAString& aHref, nsIURI* aBase,
|
||||
Location::SetHrefWithBase(const nsAString& aHref, nsIURI* aBase,
|
||||
bool aReplace)
|
||||
{
|
||||
nsresult result;
|
||||
@ -553,7 +554,7 @@ nsLocation::SetHrefWithBase(const nsAString& aHref, nsIURI* aBase,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsLocation::GetOrigin(nsAString& aOrigin)
|
||||
Location::GetOrigin(nsAString& aOrigin)
|
||||
{
|
||||
aOrigin.Truncate();
|
||||
|
||||
@ -571,7 +572,7 @@ nsLocation::GetOrigin(nsAString& aOrigin)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsLocation::GetPathname(nsAString& aPathname)
|
||||
Location::GetPathname(nsAString& aPathname)
|
||||
{
|
||||
aPathname.Truncate();
|
||||
|
||||
@ -595,7 +596,7 @@ nsLocation::GetPathname(nsAString& aPathname)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsLocation::SetPathname(const nsAString& aPathname)
|
||||
Location::SetPathname(const nsAString& aPathname)
|
||||
{
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
nsresult rv = GetWritableURI(getter_AddRefs(uri));
|
||||
@ -612,7 +613,7 @@ nsLocation::SetPathname(const nsAString& aPathname)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsLocation::GetPort(nsAString& aPort)
|
||||
Location::GetPort(nsAString& aPort)
|
||||
{
|
||||
aPort.SetLength(0);
|
||||
|
||||
@ -639,7 +640,7 @@ nsLocation::GetPort(nsAString& aPort)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsLocation::SetPort(const nsAString& aPort)
|
||||
Location::SetPort(const nsAString& aPort)
|
||||
{
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
nsresult rv = GetWritableURI(getter_AddRefs(uri));
|
||||
@ -670,7 +671,7 @@ nsLocation::SetPort(const nsAString& aPort)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsLocation::GetProtocol(nsAString& aProtocol)
|
||||
Location::GetProtocol(nsAString& aProtocol)
|
||||
{
|
||||
aProtocol.SetLength(0);
|
||||
|
||||
@ -694,7 +695,7 @@ nsLocation::GetProtocol(nsAString& aProtocol)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsLocation::SetProtocol(const nsAString& aProtocol)
|
||||
Location::SetProtocol(const nsAString& aProtocol)
|
||||
{
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
nsresult rv = GetWritableURI(getter_AddRefs(uri));
|
||||
@ -721,7 +722,7 @@ nsLocation::SetProtocol(const nsAString& aProtocol)
|
||||
}
|
||||
|
||||
void
|
||||
nsLocation::GetUsername(nsAString& aUsername, ErrorResult& aError)
|
||||
Location::GetUsername(nsAString& aUsername, ErrorResult& aError)
|
||||
{
|
||||
THROW_AND_RETURN_IF_CALLER_DOESNT_SUBSUME();
|
||||
|
||||
@ -738,7 +739,7 @@ nsLocation::GetUsername(nsAString& aUsername, ErrorResult& aError)
|
||||
}
|
||||
|
||||
void
|
||||
nsLocation::SetUsername(const nsAString& aUsername, ErrorResult& aError)
|
||||
Location::SetUsername(const nsAString& aUsername, ErrorResult& aError)
|
||||
{
|
||||
THROW_AND_RETURN_IF_CALLER_DOESNT_SUBSUME();
|
||||
|
||||
@ -763,7 +764,7 @@ nsLocation::SetUsername(const nsAString& aUsername, ErrorResult& aError)
|
||||
}
|
||||
|
||||
void
|
||||
nsLocation::GetPassword(nsAString& aPassword, ErrorResult& aError)
|
||||
Location::GetPassword(nsAString& aPassword, ErrorResult& aError)
|
||||
{
|
||||
THROW_AND_RETURN_IF_CALLER_DOESNT_SUBSUME();
|
||||
|
||||
@ -780,7 +781,7 @@ nsLocation::GetPassword(nsAString& aPassword, ErrorResult& aError)
|
||||
}
|
||||
|
||||
void
|
||||
nsLocation::SetPassword(const nsAString& aPassword, ErrorResult& aError)
|
||||
Location::SetPassword(const nsAString& aPassword, ErrorResult& aError)
|
||||
{
|
||||
THROW_AND_RETURN_IF_CALLER_DOESNT_SUBSUME();
|
||||
|
||||
@ -805,7 +806,7 @@ nsLocation::SetPassword(const nsAString& aPassword, ErrorResult& aError)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsLocation::GetSearch(nsAString& aSearch)
|
||||
Location::GetSearch(nsAString& aSearch)
|
||||
{
|
||||
aSearch.SetLength(0);
|
||||
|
||||
@ -831,7 +832,7 @@ nsLocation::GetSearch(nsAString& aSearch)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsLocation::SetSearch(const nsAString& aSearch)
|
||||
Location::SetSearch(const nsAString& aSearch)
|
||||
{
|
||||
nsresult rv = SetSearchInternal(aSearch);
|
||||
if (NS_FAILED(rv)) {
|
||||
@ -842,7 +843,7 @@ nsLocation::SetSearch(const nsAString& aSearch)
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsLocation::SetSearchInternal(const nsAString& aSearch)
|
||||
Location::SetSearchInternal(const nsAString& aSearch)
|
||||
{
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
nsresult rv = GetWritableURI(getter_AddRefs(uri));
|
||||
@ -861,12 +862,13 @@ nsLocation::SetSearchInternal(const nsAString& aSearch)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsLocation::Reload(bool aForceget)
|
||||
Location::Reload(bool aForceget)
|
||||
{
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIDocShell> docShell(do_QueryReferent(mDocShell));
|
||||
nsCOMPtr<nsIWebNavigation> webNav(do_QueryInterface(docShell));
|
||||
nsCOMPtr<nsPIDOMWindowOuter> window = docShell ? docShell->GetWindow() : nullptr;
|
||||
nsCOMPtr<nsPIDOMWindowOuter> window = docShell ? docShell->GetWindow()
|
||||
: nullptr;
|
||||
|
||||
if (window && window->IsHandlingResizeEvent()) {
|
||||
// location.reload() was called on a window that is handling a
|
||||
@ -909,7 +911,7 @@ nsLocation::Reload(bool aForceget)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsLocation::Replace(const nsAString& aUrl)
|
||||
Location::Replace(const nsAString& aUrl)
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
if (JSContext *cx = nsContentUtils::GetCurrentJSContext()) {
|
||||
@ -930,7 +932,7 @@ nsLocation::Replace(const nsAString& aUrl)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsLocation::Assign(const nsAString& aUrl)
|
||||
Location::Assign(const nsAString& aUrl)
|
||||
{
|
||||
if (JSContext *cx = nsContentUtils::GetCurrentJSContext()) {
|
||||
return SetHrefWithContext(cx, aUrl, false);
|
||||
@ -955,13 +957,13 @@ nsLocation::Assign(const nsAString& aUrl)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsLocation::ToString(nsAString& aReturn)
|
||||
Location::ToString(nsAString& aReturn)
|
||||
{
|
||||
return GetHref(aReturn);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsLocation::ValueOf(nsIDOMLocation** aReturn)
|
||||
Location::ValueOf(nsIDOMLocation** aReturn)
|
||||
{
|
||||
nsCOMPtr<nsIDOMLocation> loc(this);
|
||||
loc.forget(aReturn);
|
||||
@ -969,18 +971,19 @@ nsLocation::ValueOf(nsIDOMLocation** aReturn)
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsLocation::GetSourceBaseURL(JSContext* cx, nsIURI** sourceURL)
|
||||
Location::GetSourceBaseURL(JSContext* cx, nsIURI** sourceURL)
|
||||
{
|
||||
*sourceURL = nullptr;
|
||||
nsIDocument* doc = GetEntryDocument();
|
||||
// If there's no entry document, we either have no Script Entry Point or one
|
||||
// that isn't a DOM Window. This doesn't generally happen with the DOM,
|
||||
// but can sometimes happen with extension code in certain IPC configurations.
|
||||
// If this happens, try falling back on the current document associated with
|
||||
// the docshell. If that fails, just return null and hope that the caller passed
|
||||
// that isn't a DOM Window. This doesn't generally happen with the DOM, but
|
||||
// can sometimes happen with extension code in certain IPC configurations. If
|
||||
// this happens, try falling back on the current document associated with the
|
||||
// docshell. If that fails, just return null and hope that the caller passed
|
||||
// an absolute URI.
|
||||
if (!doc && GetDocShell()) {
|
||||
nsCOMPtr<nsPIDOMWindowOuter> docShellWin = do_QueryInterface(GetDocShell()->GetScriptGlobalObject());
|
||||
nsCOMPtr<nsPIDOMWindowOuter> docShellWin =
|
||||
do_QueryInterface(GetDocShell()->GetScriptGlobalObject());
|
||||
if (docShellWin) {
|
||||
doc = docShellWin->GetDoc();
|
||||
}
|
||||
@ -991,7 +994,7 @@ nsLocation::GetSourceBaseURL(JSContext* cx, nsIURI** sourceURL)
|
||||
}
|
||||
|
||||
bool
|
||||
nsLocation::CallerSubsumes()
|
||||
Location::CallerSubsumes()
|
||||
{
|
||||
// Get the principal associated with the location object. Note that this is
|
||||
// the principal of the page which will actually be navigated, not the
|
||||
@ -1003,13 +1006,17 @@ nsLocation::CallerSubsumes()
|
||||
return false;
|
||||
nsCOMPtr<nsIScriptObjectPrincipal> sop = do_QueryInterface(outer);
|
||||
bool subsumes = false;
|
||||
nsresult rv = nsContentUtils::SubjectPrincipal()->SubsumesConsideringDomain(sop->GetPrincipal(), &subsumes);
|
||||
nsresult rv =
|
||||
nsContentUtils::SubjectPrincipal()->SubsumesConsideringDomain(sop->GetPrincipal(), &subsumes);
|
||||
NS_ENSURE_SUCCESS(rv, false);
|
||||
return subsumes;
|
||||
}
|
||||
|
||||
JSObject*
|
||||
nsLocation::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
|
||||
Location::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
|
||||
{
|
||||
return LocationBinding::Wrap(aCx, this, aGivenProto);
|
||||
}
|
||||
|
||||
} // dom namespace
|
||||
} // mozilla namespace
|
@ -4,36 +4,37 @@
|
||||
* 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 nsLocation_h__
|
||||
#define nsLocation_h__
|
||||
#ifndef mozilla_dom_Location_h
|
||||
#define mozilla_dom_Location_h
|
||||
|
||||
#include "nsIDOMLocation.h"
|
||||
#include "nsString.h"
|
||||
#include "nsIWeakReferenceUtils.h"
|
||||
#include "nsWrapperCache.h"
|
||||
#include "nsCycleCollectionParticipant.h"
|
||||
#include "js/TypeDecls.h"
|
||||
#include "mozilla/ErrorResult.h"
|
||||
#include "nsCycleCollectionParticipant.h"
|
||||
#include "nsIDOMLocation.h"
|
||||
#include "nsIWeakReferenceUtils.h"
|
||||
#include "nsPIDOMWindow.h"
|
||||
#include "nsString.h"
|
||||
#include "nsWrapperCache.h"
|
||||
|
||||
class nsIURI;
|
||||
class nsIDocShell;
|
||||
class nsIDocShellLoadInfo;
|
||||
class nsIURI;
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
//*****************************************************************************
|
||||
// nsLocation: Script "location" object
|
||||
// Location: Script "location" object
|
||||
//*****************************************************************************
|
||||
|
||||
class nsLocation final : public nsIDOMLocation
|
||||
, public nsWrapperCache
|
||||
class Location final : public nsIDOMLocation
|
||||
, public nsWrapperCache
|
||||
{
|
||||
typedef mozilla::ErrorResult ErrorResult;
|
||||
|
||||
public:
|
||||
nsLocation(nsPIDOMWindowInner* aWindow, nsIDocShell *aDocShell);
|
||||
Location(nsPIDOMWindowInner* aWindow, nsIDocShell *aDocShell);
|
||||
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(nsLocation,
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(Location,
|
||||
nsIDOMLocation)
|
||||
|
||||
void SetDocShell(nsIDocShell *aDocShell);
|
||||
@ -164,10 +165,12 @@ public:
|
||||
{
|
||||
return mInnerWindow;
|
||||
}
|
||||
virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
|
||||
|
||||
virtual JSObject* WrapObject(JSContext* aCx,
|
||||
JS::Handle<JSObject*> aGivenProto) override;
|
||||
|
||||
protected:
|
||||
virtual ~nsLocation();
|
||||
virtual ~Location();
|
||||
|
||||
nsresult SetSearchInternal(const nsAString& aSearch);
|
||||
|
||||
@ -193,4 +196,7 @@ protected:
|
||||
nsWeakPtr mDocShell;
|
||||
};
|
||||
|
||||
#endif // nsLocation_h__
|
||||
} // dom namespace
|
||||
} // mozilla namespace
|
||||
|
||||
#endif // mozilla_dom_Location_h
|
@ -185,6 +185,7 @@ EXPORTS.mozilla.dom += [
|
||||
'ImageEncoder.h',
|
||||
'ImportManager.h',
|
||||
'Link.h',
|
||||
'Location.h',
|
||||
'NameSpaceConstants.h',
|
||||
'Navigator.h',
|
||||
'NodeInfo.h',
|
||||
@ -244,6 +245,7 @@ UNIFIED_SOURCES += [
|
||||
'ImageEncoder.cpp',
|
||||
'ImportManager.cpp',
|
||||
'Link.cpp',
|
||||
'Location.cpp',
|
||||
'MultipartBlobImpl.cpp',
|
||||
'Navigator.cpp',
|
||||
'NodeInfo.cpp',
|
||||
@ -288,7 +290,6 @@ UNIFIED_SOURCES += [
|
||||
'nsJSTimeoutHandler.cpp',
|
||||
'nsJSUtils.cpp',
|
||||
'nsLineBreaker.cpp',
|
||||
'nsLocation.cpp',
|
||||
'nsMappedAttributeElement.cpp',
|
||||
'nsMappedAttributes.cpp',
|
||||
'nsMimeTypeArray.cpp',
|
||||
|
@ -243,7 +243,7 @@
|
||||
#include "nsIMutableArray.h"
|
||||
#include "mozilla/dom/DOMStringList.h"
|
||||
#include "nsWindowMemoryReporter.h"
|
||||
#include "nsLocation.h"
|
||||
#include "mozilla/dom/Location.h"
|
||||
#include "mozilla/dom/FontFaceSet.h"
|
||||
#include "mozilla/dom/BoxObject.h"
|
||||
#include "gfxPrefs.h"
|
||||
@ -6518,7 +6518,7 @@ nsDocument::GetLocation(nsIDOMLocation **_retval)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
already_AddRefed<nsLocation>
|
||||
already_AddRefed<Location>
|
||||
nsIDocument::GetLocation() const
|
||||
{
|
||||
nsCOMPtr<nsPIDOMWindowInner> w = do_QueryInterface(mScriptGlobalObject);
|
||||
@ -6529,7 +6529,7 @@ nsIDocument::GetLocation() const
|
||||
|
||||
nsGlobalWindow* window = nsGlobalWindow::Cast(w);
|
||||
ErrorResult dummy;
|
||||
RefPtr<nsLocation> loc = window->GetLocation(dummy);
|
||||
RefPtr<Location> loc = window->GetLocation(dummy);
|
||||
dummy.SuppressException();
|
||||
return loc.forget();
|
||||
}
|
||||
|
@ -203,7 +203,7 @@
|
||||
#include "mozilla/BasePrincipal.h"
|
||||
#include "mozilla/Services.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
#include "nsLocation.h"
|
||||
#include "mozilla/dom/Location.h"
|
||||
#include "nsHTMLDocument.h"
|
||||
#include "nsWrapperCacheInlines.h"
|
||||
#include "mozilla/DOMEventTargetHelper.h"
|
||||
@ -9754,14 +9754,14 @@ nsGlobalWindow::GetPrivateRoot()
|
||||
return top;
|
||||
}
|
||||
|
||||
nsLocation*
|
||||
Location*
|
||||
nsGlobalWindow::GetLocation(ErrorResult& aError)
|
||||
{
|
||||
MOZ_RELEASE_ASSERT(IsInnerWindow());
|
||||
|
||||
nsIDocShell *docShell = GetDocShell();
|
||||
if (!mLocation && docShell) {
|
||||
mLocation = new nsLocation(AsInner(), docShell);
|
||||
mLocation = new Location(AsInner(), docShell);
|
||||
}
|
||||
return mLocation;
|
||||
}
|
||||
|
@ -88,7 +88,6 @@ class nsIScriptTimeoutHandler;
|
||||
class nsIWebBrowserChrome;
|
||||
|
||||
class nsDOMWindowList;
|
||||
class nsLocation;
|
||||
class nsScreen;
|
||||
class nsHistory;
|
||||
class nsGlobalWindowObserver;
|
||||
@ -111,6 +110,7 @@ class External;
|
||||
class Function;
|
||||
class Gamepad;
|
||||
enum class ImageBitmapFormat : uint32_t;
|
||||
class Location;
|
||||
class MediaQueryList;
|
||||
class MozSelfSupport;
|
||||
class Navigator;
|
||||
@ -880,7 +880,7 @@ public:
|
||||
void GetName(nsAString& aName, mozilla::ErrorResult& aError);
|
||||
void SetNameOuter(const nsAString& aName, mozilla::ErrorResult& aError);
|
||||
void SetName(const nsAString& aName, mozilla::ErrorResult& aError);
|
||||
nsLocation* GetLocation(mozilla::ErrorResult& aError);
|
||||
mozilla::dom::Location* GetLocation(mozilla::ErrorResult& aError);
|
||||
nsIDOMLocation* GetLocation() override;
|
||||
nsHistory* GetHistory(mozilla::ErrorResult& aError);
|
||||
mozilla::dom::CustomElementsRegistry* CustomElements() override;
|
||||
@ -1850,7 +1850,7 @@ protected:
|
||||
nsTimeout* mTimeoutInsertionPoint;
|
||||
uint32_t mTimeoutPublicIdCounter;
|
||||
uint32_t mTimeoutFiringDepth;
|
||||
RefPtr<nsLocation> mLocation;
|
||||
RefPtr<mozilla::dom::Location> mLocation;
|
||||
RefPtr<nsHistory> mHistory;
|
||||
RefPtr<mozilla::dom::CustomElementsRegistry> mCustomElements;
|
||||
|
||||
|
@ -85,7 +85,6 @@ class nsIStreamListener;
|
||||
class nsIStructuredCloneContainer;
|
||||
class nsIURI;
|
||||
class nsIVariant;
|
||||
class nsLocation;
|
||||
class nsViewManager;
|
||||
class nsPresContext;
|
||||
class nsRange;
|
||||
@ -138,6 +137,7 @@ class ImportManager;
|
||||
class HTMLBodyElement;
|
||||
struct LifecycleCallbackArgs;
|
||||
class Link;
|
||||
class Location;
|
||||
class MediaQueryList;
|
||||
class GlobalObject;
|
||||
class NodeFilter;
|
||||
@ -2561,7 +2561,7 @@ public:
|
||||
const nsAString& aQualifiedName,
|
||||
mozilla::ErrorResult& rv);
|
||||
void GetInputEncoding(nsAString& aInputEncoding) const;
|
||||
already_AddRefed<nsLocation> GetLocation() const;
|
||||
already_AddRefed<mozilla::dom::Location> GetLocation() const;
|
||||
void GetReferrer(nsAString& aReferrer) const;
|
||||
void GetLastModified(nsAString& aLastModified) const;
|
||||
void GetReadyState(nsAString& aReadyState) const;
|
||||
|
@ -638,10 +638,6 @@ DOMInterfaces = {
|
||||
'nativeType': 'mozilla::DOMLocalMediaStream'
|
||||
},
|
||||
|
||||
'Location': {
|
||||
'nativeType': 'nsLocation',
|
||||
},
|
||||
|
||||
'MediaList': {
|
||||
'nativeType': 'nsMediaList',
|
||||
'headerFile': 'nsIMediaList.h',
|
||||
|
@ -1159,12 +1159,6 @@ CanvasRenderingContext2D::Reset()
|
||||
mCanvasElement->InvalidateCanvas();
|
||||
}
|
||||
|
||||
// only do this for non-docshell created contexts,
|
||||
// since those are the ones that we created a surface for
|
||||
if (mTarget && IsTargetValid() && !mDocShell) {
|
||||
gCanvasAzureMemoryUsed -= mWidth * mHeight * 4;
|
||||
}
|
||||
|
||||
bool forceReset = true;
|
||||
ReturnTarget(forceReset);
|
||||
mTarget = nullptr;
|
||||
@ -1627,8 +1621,6 @@ CanvasRenderingContext2D::EnsureTarget(const gfx::Rect* aCoveredRect,
|
||||
mTarget = newTarget.forget();
|
||||
mBufferProvider = newProvider.forget();
|
||||
|
||||
RegisterAllocation();
|
||||
|
||||
// Skia expects the unused X channel to contains 0 even for opaque operations
|
||||
// so we can't skip clearing in that case, even if we are going to cover the
|
||||
// entire canvas in the next drawing operation.
|
||||
@ -1672,10 +1664,6 @@ CanvasRenderingContext2D::SetErrorState()
|
||||
{
|
||||
EnsureErrorTarget();
|
||||
|
||||
if (mTarget && mTarget != sErrorTarget) {
|
||||
gCanvasAzureMemoryUsed -= mWidth * mHeight * 4;
|
||||
}
|
||||
|
||||
mTarget = sErrorTarget;
|
||||
mBufferProvider = nullptr;
|
||||
|
||||
@ -1684,22 +1672,13 @@ CanvasRenderingContext2D::SetErrorState()
|
||||
}
|
||||
|
||||
void
|
||||
CanvasRenderingContext2D::RegisterAllocation()
|
||||
EnsureCanvasMemoryReporter()
|
||||
{
|
||||
// XXX - It would make more sense to track the allocation in
|
||||
// PeristentBufferProvider, rather than here.
|
||||
static bool registered = false;
|
||||
// FIXME: Disable the reporter for now, see bug 1241865
|
||||
if (!registered && false) {
|
||||
if (!registered) {
|
||||
registered = true;
|
||||
RegisterStrongMemoryReporter(new Canvas2dPixelsReporter());
|
||||
}
|
||||
|
||||
gCanvasAzureMemoryUsed += mWidth * mHeight * 4;
|
||||
JSContext* context = nsContentUtils::GetCurrentJSContext();
|
||||
if (context) {
|
||||
JS_updateMallocCounter(context, mWidth * mHeight * 4);
|
||||
}
|
||||
}
|
||||
|
||||
static already_AddRefed<LayerManager>
|
||||
@ -1783,7 +1762,9 @@ CanvasRenderingContext2D::TrySharedTarget(RefPtr<gfx::DrawTarget>& aOutDT,
|
||||
return false;
|
||||
}
|
||||
|
||||
aOutProvider = layerManager->CreatePersistentBufferProvider(GetSize(), GetSurfaceFormat());
|
||||
EnsureCanvasMemoryReporter();
|
||||
aOutProvider = layerManager->CreatePersistentBufferProvider(GetSize(), GetSurfaceFormat(),
|
||||
&gCanvasAzureMemoryUsed);
|
||||
|
||||
if (!aOutProvider) {
|
||||
return false;
|
||||
@ -4891,9 +4872,6 @@ CanvasRenderingContext2D::DrawImage(const CanvasImageSource& aImage,
|
||||
|
||||
if (!res.mSourceSurface) {
|
||||
res = nsLayoutUtils::SurfaceFromElement(element, sfeFlags, mTarget);
|
||||
if (res.mSourceSurface) {
|
||||
gfxUtils::WriteAsPNG(res.mSourceSurface, "/Volumes/firefoxos/Dev/mozilla-git/temp.png");
|
||||
}
|
||||
}
|
||||
|
||||
if (!res.mSourceSurface && !res.mDrawInfo.mImgContainer) {
|
||||
|
@ -237,7 +237,8 @@ public:
|
||||
// The XPCOM CaptureEvents works fine for us.
|
||||
// The XPCOM ReleaseEvents works fine for us.
|
||||
// We're picking up GetLocation from Document
|
||||
already_AddRefed<nsLocation> GetLocation() const {
|
||||
already_AddRefed<mozilla::dom::Location> GetLocation() const
|
||||
{
|
||||
return nsIDocument::GetLocation();
|
||||
}
|
||||
|
||||
|
@ -95,7 +95,7 @@ function doTestEncoded() {
|
||||
parsed = JSON.parse(target.hash.substring(1));
|
||||
is(parsed.b.key, 'value', 'JSON not parsed correctly');
|
||||
|
||||
// Tests nsLocation::GetHash
|
||||
// Tests Location::GetHash
|
||||
|
||||
window.history.pushState(1, document.title, '#q=♥â¥#hello');
|
||||
is(location.hash,'#q=♥â¥#hello', 'Unexpected location hash');
|
||||
|
@ -160,7 +160,7 @@ WebVTTListener::OnCue(JS::Handle<JS::Value> aCue, JSContext* aCx)
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
TextTrackCue* cue;
|
||||
TextTrackCue* cue = nullptr;
|
||||
nsresult rv = UNWRAP_OBJECT(VTTCue, &aCue.toObject(), cue);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
|
@ -439,7 +439,7 @@ PeerConnectionTest.prototype.updateChainSteps = function() {
|
||||
if (this.testOptions.h264) {
|
||||
this.chain.insertAfterEach(
|
||||
'PC_LOCAL_CREATE_OFFER',
|
||||
[PC_LOCAL_REMOVE_VP8_FROM_OFFER]);
|
||||
[PC_LOCAL_REMOVE_ALL_BUT_H264_FROM_OFFER]);
|
||||
}
|
||||
if (!this.testOptions.bundle) {
|
||||
this.chain.insertAfterEach(
|
||||
|
@ -24,16 +24,14 @@ checkSdpCLineNotDefault: function(sdpStr, label) {
|
||||
ok(!sdpStr.includes("c=IN IP4 0.0.0.0"), label + ": SDP contains non-zero IP c line");
|
||||
},
|
||||
|
||||
// Also remove mode 0 if it's offered
|
||||
// Note, we don't bother removing the fmtp lines, which makes a good test
|
||||
// for some SDP parsing issues.
|
||||
removeVP8: function(sdp) {
|
||||
var updated_sdp = sdp.replace("a=rtpmap:120 VP8/90000\r\n","");
|
||||
updated_sdp = updated_sdp.replace("RTP/SAVPF 120 126 97\r\n","RTP/SAVPF 126 97\r\n");
|
||||
updated_sdp = updated_sdp.replace("RTP/SAVPF 120 126\r\n","RTP/SAVPF 126\r\n");
|
||||
updated_sdp = updated_sdp.replace("a=rtcp-fb:120 nack\r\n","");
|
||||
updated_sdp = updated_sdp.replace("a=rtcp-fb:120 nack pli\r\n","");
|
||||
updated_sdp = updated_sdp.replace("a=rtcp-fb:120 ccm fir\r\n","");
|
||||
// for some SDP parsing issues. It would be good to have a "removeAllButCodec(sdp, codec)" too.
|
||||
removeCodec: function(sdp, codec) {
|
||||
var updated_sdp = sdp.replace(new RegExp("a=rtpmap:" + codec + ".*\\/90000\\r\\n",""),"");
|
||||
updated_sdp = updated_sdp.replace(new RegExp("(RTP\\/SAVPF.*)( " + codec + ")(.*\\r\\n)",""),"$1$3");
|
||||
updated_sdp = updated_sdp.replace(new RegExp("a=rtcp-fb:" + codec + " nack\\r\\n",""),"");
|
||||
updated_sdp = updated_sdp.replace(new RegExp("a=rtcp-fb:" + codec + " nack pli\\r\\n",""),"");
|
||||
updated_sdp = updated_sdp.replace(new RegExp("a=rtcp-fb:" + codec + " ccm fir\\r\\n",""),"");
|
||||
return updated_sdp;
|
||||
},
|
||||
|
||||
@ -125,7 +123,8 @@ verifySdp: function(desc, expectedType, offerConstraintsList, offerOptions,
|
||||
if (testOptions.h264) {
|
||||
ok(desc.sdp.includes("a=rtpmap:126 H264/90000"), "H.264 codec is present in SDP");
|
||||
} else {
|
||||
ok(desc.sdp.includes("a=rtpmap:120 VP8/90000"), "VP8 codec is present in SDP");
|
||||
ok(desc.sdp.includes("a=rtpmap:120 VP8/90000") ||
|
||||
desc.sdp.includes("a=rtpmap:121 VP9/90000"), "VP8 or VP9 codec is present in SDP");
|
||||
}
|
||||
is(testOptions.rtcpmux, desc.sdp.includes("a=rtcp-mux"), "RTCP Mux is offered in SDP");
|
||||
}
|
||||
|
@ -507,9 +507,10 @@ var commandsPeerConnectionOfferAnswer = [
|
||||
}
|
||||
];
|
||||
|
||||
function PC_LOCAL_REMOVE_VP8_FROM_OFFER(test) {
|
||||
function PC_LOCAL_REMOVE_ALL_BUT_H264_FROM_OFFER(test) {
|
||||
isnot(test.originalOffer.sdp.search("H264/90000"), -1, "H.264 should be present in the SDP offer");
|
||||
test.originalOffer.sdp = sdputils.removeVP8(test.originalOffer.sdp);
|
||||
test.originalOffer.sdp = sdputils.removeCodec(sdputils.removeCodec(sdputils.removeCodec(
|
||||
test.originalOffer.sdp, 120), 121, 97));
|
||||
info("Updated H264 only offer: " + JSON.stringify(test.originalOffer));
|
||||
};
|
||||
|
||||
|
@ -16,7 +16,9 @@
|
||||
f().then(() => ok(false, msg),
|
||||
e => is(e.name, reason, msg));
|
||||
|
||||
var removeVP8 = d => (d.sdp = d.sdp.replace("a=rtpmap:120 VP8/90000\r\n", ""), d);
|
||||
var removeAllButCodec = (d, codec) =>
|
||||
(d.sdp = d.sdp.replace(/m=video (\w) UDP\/TLS\/RTP\/SAVPF \w.*\r\n/,
|
||||
"m=video $1 UDP/TLS/RTP/SAVPF " + codec + "\r\n"), d);
|
||||
|
||||
function testScale(codec) {
|
||||
var pc1 = new RTCPeerConnection();
|
||||
@ -30,7 +32,7 @@
|
||||
|
||||
pc1.onnegotiationneeded = e =>
|
||||
pc1.createOffer()
|
||||
.then(d => pc1.setLocalDescription(codec == "VP8" ? d : removeVP8(d)))
|
||||
.then(d => pc1.setLocalDescription(codec == "VP8" ? d : removeAllButCodec(d, 126)))
|
||||
.then(() => pc2.setRemoteDescription(pc1.localDescription))
|
||||
.then(() => pc2.createAnswer()).then(d => pc2.setLocalDescription(d))
|
||||
.then(() => pc1.setRemoteDescription(pc2.localDescription))
|
||||
|
@ -826,7 +826,7 @@ mount_operation_ask_password (GMountOperation *mount_op,
|
||||
if (flags & G_ASK_PASSWORD_NEED_USERNAME) {
|
||||
if (!realm.IsEmpty()) {
|
||||
const char16_t *strings[] = { realm.get(), dispHost.get() };
|
||||
bundle->FormatStringFromName(u"EnterLoginForRealm2",
|
||||
bundle->FormatStringFromName(u"EnterLoginForRealm3",
|
||||
strings, 2, getter_Copies(nsmessage));
|
||||
} else {
|
||||
const char16_t *strings[] = { dispHost.get() };
|
||||
|
@ -27,6 +27,7 @@
|
||||
|
||||
#ifdef XP_DARWIN
|
||||
#include "ScaledFontMac.h"
|
||||
#include "NativeFontResourceMac.h"
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_WIDGET_GTK
|
||||
@ -548,6 +549,8 @@ Factory::CreateNativeFontResource(uint8_t *aData, uint32_t aSize,
|
||||
return NativeFontResourceGDI::Create(aData, aSize,
|
||||
/* aNeedsCairo = */ true);
|
||||
}
|
||||
#elif XP_DARWIN
|
||||
return NativeFontResourceMac::Create(aData, aSize);
|
||||
#else
|
||||
gfxWarning() << "Unable to create cairo scaled font from truetype data";
|
||||
return nullptr;
|
||||
|
@ -128,6 +128,7 @@ enum class LogReason : int {
|
||||
InvalidCacheSurface,
|
||||
AlphaWithBasicClient,
|
||||
UnbalancedClipStack,
|
||||
ProcessingError,
|
||||
// End
|
||||
MustBeLessThanThis = 101,
|
||||
};
|
||||
|
66
gfx/2d/NativeFontResourceMac.cpp
Normal file
66
gfx/2d/NativeFontResourceMac.cpp
Normal file
@ -0,0 +1,66 @@
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||
/* 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 "NativeFontResourceMac.h"
|
||||
#include "Types.h"
|
||||
|
||||
#include "mozilla/RefPtr.h"
|
||||
|
||||
#ifdef MOZ_WIDGET_UIKIT
|
||||
#include <CoreFoundation/CoreFoundation.h>
|
||||
#endif
|
||||
|
||||
namespace mozilla {
|
||||
namespace gfx {
|
||||
|
||||
/* static */
|
||||
already_AddRefed<NativeFontResourceMac>
|
||||
NativeFontResourceMac::Create(uint8_t *aFontData, uint32_t aDataLength)
|
||||
{
|
||||
// copy font data
|
||||
CFDataRef data = CFDataCreate(kCFAllocatorDefault, aFontData, aDataLength);
|
||||
if (!data) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// create a provider
|
||||
CGDataProviderRef provider = CGDataProviderCreateWithCFData(data);
|
||||
|
||||
// release our reference to the CFData, provider keeps it alive
|
||||
CFRelease(data);
|
||||
|
||||
// create the font object
|
||||
CGFontRef fontRef = CGFontCreateWithDataProvider(provider);
|
||||
|
||||
// release our reference, font will keep it alive as long as needed
|
||||
CGDataProviderRelease(provider);
|
||||
|
||||
if (!fontRef) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// passes ownership of fontRef to the NativeFontResourceMac instance
|
||||
RefPtr<NativeFontResourceMac> fontResource =
|
||||
new NativeFontResourceMac(fontRef);
|
||||
|
||||
return fontResource.forget();
|
||||
}
|
||||
|
||||
already_AddRefed<ScaledFont>
|
||||
NativeFontResourceMac::CreateScaledFont(uint32_t aIndex, uint32_t aGlyphSize)
|
||||
{
|
||||
RefPtr<ScaledFontBase> scaledFont = new ScaledFontMac(mFontRef, aGlyphSize);
|
||||
|
||||
if (!scaledFont->PopulateCairoScaledFont()) {
|
||||
gfxWarning() << "Unable to create cairo scaled Mac font.";
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return scaledFont.forget();
|
||||
}
|
||||
|
||||
} // gfx
|
||||
} // mozilla
|
42
gfx/2d/NativeFontResourceMac.h
Normal file
42
gfx/2d/NativeFontResourceMac.h
Normal file
@ -0,0 +1,42 @@
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||
/* 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_gfx_NativeFontResourceMac_h
|
||||
#define mozilla_gfx_NativeFontResourceMac_h
|
||||
|
||||
#include "2D.h"
|
||||
#include "mozilla/AlreadyAddRefed.h"
|
||||
#include "ScaledFontMac.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace gfx {
|
||||
|
||||
class NativeFontResourceMac final : public NativeFontResource
|
||||
{
|
||||
public:
|
||||
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(NativeFontResourceMac)
|
||||
|
||||
static already_AddRefed<NativeFontResourceMac>
|
||||
Create(uint8_t *aFontData, uint32_t aDataLength);
|
||||
|
||||
already_AddRefed<ScaledFont>
|
||||
CreateScaledFont(uint32_t aIndex, uint32_t aGlyphSize);
|
||||
|
||||
~NativeFontResourceMac()
|
||||
{
|
||||
CFRelease(mFontRef);
|
||||
}
|
||||
|
||||
private:
|
||||
explicit NativeFontResourceMac(CGFontRef aFontRef) : mFontRef(aFontRef) {}
|
||||
|
||||
CGFontRef mFontRef;
|
||||
};
|
||||
|
||||
} // gfx
|
||||
} // mozilla
|
||||
|
||||
#endif // mozilla_gfx_NativeFontResourceMac_h
|
@ -1519,6 +1519,10 @@ RecordedFontData::PlayEvent(Translator *aTranslator) const
|
||||
RefPtr<NativeFontResource> fontResource =
|
||||
Factory::CreateNativeFontResource(mData, mFontDetails.size,
|
||||
aTranslator->GetDesiredFontType());
|
||||
if (!fontResource) {
|
||||
return false;
|
||||
}
|
||||
|
||||
aTranslator->AddNativeFontResource(mFontDetails.fontDataKey, fontResource);
|
||||
return true;
|
||||
}
|
||||
|
@ -10,6 +10,10 @@
|
||||
#include "Logging.h"
|
||||
#include "mozilla/Move.h"
|
||||
|
||||
#if defined(XP_MACOSX)
|
||||
#include <CoreFoundation/CoreFoundation.h>
|
||||
#endif
|
||||
|
||||
namespace mozilla {
|
||||
namespace gfx {
|
||||
|
||||
@ -27,6 +31,8 @@ static const BigEndianUint16 ENCODING_ID_MICROSOFT_SYMBOL = 0;
|
||||
static const BigEndianUint16 ENCODING_ID_MICROSOFT_UNICODEBMP = 1;
|
||||
static const BigEndianUint16 ENCODING_ID_MICROSOFT_UNICODEFULL = 10;
|
||||
|
||||
static const BigEndianUint16 ENCODING_ID_MAC_ROMAN = 0;
|
||||
|
||||
static const BigEndianUint16 LANG_ID_MAC_ENGLISH = 0;
|
||||
|
||||
static const BigEndianUint16 LANG_ID_MICROSOFT_EN_US = 0x0409;
|
||||
@ -53,6 +59,15 @@ struct NameRecord
|
||||
|
||||
#pragma pack(pop)
|
||||
|
||||
enum ENameDecoder : int
|
||||
{
|
||||
eNameDecoderUTF16,
|
||||
#if defined(XP_MACOSX)
|
||||
eNameDecoderMacRoman,
|
||||
#endif
|
||||
eNameDecoderNone
|
||||
};
|
||||
|
||||
/* static */
|
||||
UniquePtr<SFNTNameTable>
|
||||
SFNTNameTable::Create(const uint8_t *aNameData, uint32_t aDataLength)
|
||||
@ -98,14 +113,6 @@ SFNTNameTable::SFNTNameTable(const NameHeader *aNameHeader,
|
||||
MOZ_ASSERT(reinterpret_cast<const uint8_t*>(aNameHeader) == aNameData);
|
||||
}
|
||||
|
||||
#if defined(XP_MACOSX)
|
||||
static const BigEndianUint16 CANONICAL_LANG_ID = LANG_ID_MAC_ENGLISH;
|
||||
static const BigEndianUint16 PLATFORM_ID = PLATFORM_ID_MAC;
|
||||
#else
|
||||
static const BigEndianUint16 CANONICAL_LANG_ID = LANG_ID_MICROSOFT_EN_US;
|
||||
static const BigEndianUint16 PLATFORM_ID = PLATFORM_ID_MICROSOFT;
|
||||
#endif
|
||||
|
||||
static bool
|
||||
IsUTF16Encoding(const NameRecord *aNameRecord)
|
||||
{
|
||||
@ -122,18 +129,39 @@ IsUTF16Encoding(const NameRecord *aNameRecord)
|
||||
return false;
|
||||
}
|
||||
|
||||
static NameRecordMatchers*
|
||||
CreateCanonicalU16Matchers(const BigEndianUint16& aNameID)
|
||||
#if defined(XP_MACOSX)
|
||||
static bool
|
||||
IsMacRomanEncoding(const NameRecord *aNameRecord)
|
||||
{
|
||||
if (aNameRecord->platformID == PLATFORM_ID_MAC &&
|
||||
aNameRecord->encodingID == ENCODING_ID_MAC_ROMAN) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
static NameRecordMatchers*
|
||||
CreateCanonicalMatchers(const BigEndianUint16& aNameID)
|
||||
{
|
||||
// For Windows, we return only Microsoft platform name record
|
||||
// matchers. On Mac, we return matchers for both Microsoft platform
|
||||
// records and Mac platform records.
|
||||
NameRecordMatchers *matchers = new NameRecordMatchers();
|
||||
|
||||
// First, look for the English name (this will normally succeed).
|
||||
#if defined(XP_MACOSX)
|
||||
// First, look for the English name.
|
||||
if (!matchers->append(
|
||||
[=](const NameRecord *aNameRecord) {
|
||||
return aNameRecord->nameID == aNameID &&
|
||||
aNameRecord->languageID == CANONICAL_LANG_ID &&
|
||||
aNameRecord->platformID == PLATFORM_ID &&
|
||||
IsUTF16Encoding(aNameRecord);
|
||||
if (aNameRecord->nameID == aNameID &&
|
||||
aNameRecord->languageID == LANG_ID_MAC_ENGLISH &&
|
||||
aNameRecord->platformID == PLATFORM_ID_MAC &&
|
||||
IsMacRomanEncoding(aNameRecord)) {
|
||||
return eNameDecoderMacRoman;
|
||||
} else {
|
||||
return eNameDecoderNone;
|
||||
}
|
||||
})) {
|
||||
MOZ_CRASH();
|
||||
}
|
||||
@ -141,33 +169,46 @@ CreateCanonicalU16Matchers(const BigEndianUint16& aNameID)
|
||||
// Second, look for all languages.
|
||||
if (!matchers->append(
|
||||
[=](const NameRecord *aNameRecord) {
|
||||
return aNameRecord->nameID == aNameID &&
|
||||
aNameRecord->platformID == PLATFORM_ID &&
|
||||
IsUTF16Encoding(aNameRecord);
|
||||
if (aNameRecord->nameID == aNameID &&
|
||||
aNameRecord->platformID == PLATFORM_ID_MAC &&
|
||||
IsMacRomanEncoding(aNameRecord)) {
|
||||
return eNameDecoderMacRoman;
|
||||
} else {
|
||||
return eNameDecoderNone;
|
||||
}
|
||||
})) {
|
||||
MOZ_CRASH();
|
||||
}
|
||||
#endif /* defined(XP_MACOSX) */
|
||||
|
||||
// First, look for the English name (this will normally succeed).
|
||||
if (!matchers->append(
|
||||
[=](const NameRecord *aNameRecord) {
|
||||
if (aNameRecord->nameID == aNameID &&
|
||||
aNameRecord->languageID == LANG_ID_MICROSOFT_EN_US &&
|
||||
aNameRecord->platformID == PLATFORM_ID_MICROSOFT &&
|
||||
IsUTF16Encoding(aNameRecord)) {
|
||||
return eNameDecoderUTF16;
|
||||
} else {
|
||||
return eNameDecoderNone;
|
||||
}
|
||||
})) {
|
||||
MOZ_CRASH();
|
||||
}
|
||||
|
||||
#if defined(XP_MACOSX)
|
||||
// On Mac may be dealing with font that only has Microsoft name entries.
|
||||
// Second, look for all languages.
|
||||
if (!matchers->append(
|
||||
[=](const NameRecord *aNameRecord) {
|
||||
return aNameRecord->nameID == aNameID &&
|
||||
aNameRecord->languageID == LANG_ID_MICROSOFT_EN_US &&
|
||||
aNameRecord->platformID == PLATFORM_ID_MICROSOFT &&
|
||||
IsUTF16Encoding(aNameRecord);
|
||||
if (aNameRecord->nameID == aNameID &&
|
||||
aNameRecord->platformID == PLATFORM_ID_MICROSOFT &&
|
||||
IsUTF16Encoding(aNameRecord)) {
|
||||
return eNameDecoderUTF16;
|
||||
} else {
|
||||
return eNameDecoderNone;
|
||||
}
|
||||
})) {
|
||||
MOZ_CRASH();
|
||||
}
|
||||
if (!matchers->append(
|
||||
[=](const NameRecord *aNameRecord) {
|
||||
return aNameRecord->nameID == aNameID &&
|
||||
aNameRecord->platformID == PLATFORM_ID_MICROSOFT &&
|
||||
IsUTF16Encoding(aNameRecord);
|
||||
})) {
|
||||
MOZ_CRASH();
|
||||
}
|
||||
#endif
|
||||
|
||||
return matchers;
|
||||
}
|
||||
@ -176,7 +217,7 @@ static const NameRecordMatchers&
|
||||
FullNameMatchers()
|
||||
{
|
||||
static const NameRecordMatchers *sFullNameMatchers =
|
||||
CreateCanonicalU16Matchers(NAME_ID_FULL);
|
||||
CreateCanonicalMatchers(NAME_ID_FULL);
|
||||
return *sFullNameMatchers;
|
||||
}
|
||||
|
||||
@ -184,7 +225,7 @@ static const NameRecordMatchers&
|
||||
FamilyMatchers()
|
||||
{
|
||||
static const NameRecordMatchers *sFamilyMatchers =
|
||||
CreateCanonicalU16Matchers(NAME_ID_FAMILY);
|
||||
CreateCanonicalMatchers(NAME_ID_FAMILY);
|
||||
return *sFamilyMatchers;
|
||||
}
|
||||
|
||||
@ -192,7 +233,7 @@ static const NameRecordMatchers&
|
||||
StyleMatchers()
|
||||
{
|
||||
static const NameRecordMatchers *sStyleMatchers =
|
||||
CreateCanonicalU16Matchers(NAME_ID_STYLE);
|
||||
CreateCanonicalMatchers(NAME_ID_STYLE);
|
||||
return *sStyleMatchers;
|
||||
}
|
||||
|
||||
@ -230,8 +271,18 @@ SFNTNameTable::ReadU16Name(const NameRecordMatchers& aMatchers,
|
||||
for (size_t i = 0; i < aMatchers.length(); ++i) {
|
||||
const NameRecord* record = mFirstRecord;
|
||||
while (record != mEndOfRecords) {
|
||||
if (aMatchers[i](record)) {
|
||||
return ReadU16NameFromRecord(record, aU16Name);
|
||||
switch (aMatchers[i](record)) {
|
||||
case eNameDecoderUTF16:
|
||||
return ReadU16NameFromU16Record(record, aU16Name);
|
||||
#if defined(XP_MACOSX)
|
||||
case eNameDecoderMacRoman:
|
||||
return ReadU16NameFromMacRomanRecord(record, aU16Name);
|
||||
#endif
|
||||
case eNameDecoderNone:
|
||||
break;
|
||||
default:
|
||||
MOZ_CRASH("Invalid matcher encoding type");
|
||||
break;
|
||||
}
|
||||
++record;
|
||||
}
|
||||
@ -241,8 +292,8 @@ SFNTNameTable::ReadU16Name(const NameRecordMatchers& aMatchers,
|
||||
}
|
||||
|
||||
bool
|
||||
SFNTNameTable::ReadU16NameFromRecord(const NameRecord *aNameRecord,
|
||||
mozilla::u16string& aU16Name)
|
||||
SFNTNameTable::ReadU16NameFromU16Record(const NameRecord *aNameRecord,
|
||||
mozilla::u16string& aU16Name)
|
||||
{
|
||||
uint32_t offset = aNameRecord->offset;
|
||||
uint32_t length = aNameRecord->length;
|
||||
@ -261,5 +312,46 @@ SFNTNameTable::ReadU16NameFromRecord(const NameRecord *aNameRecord,
|
||||
return true;
|
||||
}
|
||||
|
||||
#if defined(XP_MACOSX)
|
||||
bool
|
||||
SFNTNameTable::ReadU16NameFromMacRomanRecord(const NameRecord *aNameRecord,
|
||||
mozilla::u16string& aU16Name)
|
||||
{
|
||||
uint32_t offset = aNameRecord->offset;
|
||||
uint32_t length = aNameRecord->length;
|
||||
if (mStringDataLength < offset + length) {
|
||||
gfxWarning() << "Name data too short to contain name string.";
|
||||
return false;
|
||||
}
|
||||
if (length > INT_MAX) {
|
||||
gfxWarning() << "Name record too long to decode.";
|
||||
return false;
|
||||
}
|
||||
|
||||
// pointer to the Mac Roman encoded string in the name record
|
||||
const uint8_t *encodedStr = mStringData + offset;
|
||||
|
||||
CFStringRef cfString;
|
||||
cfString = CFStringCreateWithBytesNoCopy(kCFAllocatorDefault, encodedStr,
|
||||
length, kCFStringEncodingMacRoman,
|
||||
false, kCFAllocatorNull);
|
||||
|
||||
// length (in UTF-16 code pairs) of the decoded string
|
||||
CFIndex decodedLength = CFStringGetLength(cfString);
|
||||
|
||||
// temporary buffer
|
||||
UniquePtr<UniChar[]> u16Buffer = MakeUnique<UniChar[]>(decodedLength);
|
||||
|
||||
CFStringGetCharacters(cfString, CFRangeMake(0, decodedLength),
|
||||
u16Buffer.get());
|
||||
|
||||
CFRelease(cfString);
|
||||
|
||||
aU16Name.assign(reinterpret_cast<char16_t*>(u16Buffer.get()), decodedLength);
|
||||
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
} // gfx
|
||||
} // mozilla
|
||||
|
@ -17,8 +17,9 @@ namespace gfx {
|
||||
|
||||
struct NameHeader;
|
||||
struct NameRecord;
|
||||
enum ENameDecoder : int;
|
||||
|
||||
typedef Vector<function<bool(const NameRecord*)>> NameRecordMatchers;
|
||||
typedef Vector<function<ENameDecoder(const NameRecord*)>> NameRecordMatchers;
|
||||
|
||||
class SFNTNameTable final
|
||||
{
|
||||
@ -38,7 +39,7 @@ public:
|
||||
/**
|
||||
* Gets the full name from the name table. If the full name string is not
|
||||
* present it will use the family space concatenated with the style.
|
||||
* This will only read names that are already UTF16.
|
||||
* This will only read names that are already UTF16 or Mac OS Roman.
|
||||
*
|
||||
* @param aU16FullName string to be populated with the full name.
|
||||
* @return true if the full name is successfully read.
|
||||
@ -52,8 +53,13 @@ private:
|
||||
|
||||
bool ReadU16Name(const NameRecordMatchers& aMatchers, mozilla::u16string& aU16Name);
|
||||
|
||||
bool ReadU16NameFromRecord(const NameRecord *aNameRecord,
|
||||
mozilla::u16string& aU16Name);
|
||||
bool ReadU16NameFromU16Record(const NameRecord *aNameRecord,
|
||||
mozilla::u16string& aU16Name);
|
||||
|
||||
#if defined(XP_MACOSX)
|
||||
bool ReadU16NameFromMacRomanRecord(const NameRecord *aNameRecord,
|
||||
mozilla::u16string& aU16Name);
|
||||
#endif
|
||||
|
||||
const NameRecord *mFirstRecord;
|
||||
const NameRecord *mEndOfRecords;
|
||||
|
@ -24,6 +24,9 @@ CGPathRef CGFontGetGlyphPath(CGFontRef fontRef, CGAffineTransform *textTransform
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef USE_CAIRO_SCALED_FONT
|
||||
#include "cairo-quartz.h"
|
||||
#endif
|
||||
|
||||
namespace mozilla {
|
||||
namespace gfx {
|
||||
@ -284,5 +287,14 @@ ScaledFontMac::GetFontFileData(FontFileDataOutput aDataCallback, void *aBaton)
|
||||
|
||||
}
|
||||
|
||||
#ifdef USE_CAIRO_SCALED_FONT
|
||||
cairo_font_face_t*
|
||||
ScaledFontMac::GetCairoFontFace()
|
||||
{
|
||||
MOZ_ASSERT(mFont);
|
||||
return cairo_quartz_font_face_create_for_cgfont(mFont);
|
||||
}
|
||||
#endif
|
||||
|
||||
} // namespace gfx
|
||||
} // namespace mozilla
|
||||
|
@ -35,6 +35,10 @@ public:
|
||||
virtual void CopyGlyphsToBuilder(const GlyphBuffer &aBuffer, PathBuilder *aBuilder, BackendType aBackendType, const Matrix *aTransformHint);
|
||||
virtual bool GetFontFileData(FontFileDataOutput aDataCallback, void *aBaton);
|
||||
|
||||
#ifdef USE_CAIRO_SCALED_FONT
|
||||
cairo_font_face_t* GetCairoFontFace();
|
||||
#endif
|
||||
|
||||
private:
|
||||
friend class DrawTargetCG;
|
||||
friend class DrawTargetSkia;
|
||||
|
@ -64,6 +64,7 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('cocoa', 'uikit'):
|
||||
]
|
||||
UNIFIED_SOURCES += [
|
||||
'DrawTargetCG.cpp',
|
||||
'NativeFontResourceMac.cpp',
|
||||
'PathCG.cpp',
|
||||
'ScaledFontMac.cpp',
|
||||
'SourceSurfaceCG.cpp',
|
||||
|
@ -115,27 +115,19 @@ public:
|
||||
|
||||
virtual bool RecvDestroy() override
|
||||
{
|
||||
if (!mDestroyed) {
|
||||
Destroy();
|
||||
mDestroyed = true;
|
||||
}
|
||||
DestroyIfNeeded();
|
||||
Unused << Protocol::Send__delete__(this);
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual bool RecvDestroySync() override
|
||||
{
|
||||
if (!mDestroyed) {
|
||||
Destroy();
|
||||
mDestroyed = true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
typedef ipc::IProtocolManager<ipc::IProtocol>::ActorDestroyReason Why;
|
||||
|
||||
virtual void ActorDestroy(Why) override
|
||||
{
|
||||
virtual void ActorDestroy(Why) override {
|
||||
DestroyIfNeeded();
|
||||
}
|
||||
|
||||
protected:
|
||||
void DestroyIfNeeded() {
|
||||
if (!mDestroyed) {
|
||||
Destroy();
|
||||
mDestroyed = true;
|
||||
|
@ -202,15 +202,18 @@ LayerManager::CreateDrawTarget(const IntSize &aSize,
|
||||
|
||||
already_AddRefed<PersistentBufferProvider>
|
||||
LayerManager::CreatePersistentBufferProvider(const mozilla::gfx::IntSize &aSize,
|
||||
mozilla::gfx::SurfaceFormat aFormat)
|
||||
mozilla::gfx::SurfaceFormat aFormat,
|
||||
int64_t* aMemoryCounter)
|
||||
{
|
||||
RefPtr<PersistentBufferProviderBasic> bufferProvider =
|
||||
PersistentBufferProviderBasic::Create(aSize, aFormat,
|
||||
gfxPlatform::GetPlatform()->GetPreferredCanvasBackend());
|
||||
gfxPlatform::GetPlatform()->GetPreferredCanvasBackend(),
|
||||
aMemoryCounter
|
||||
);
|
||||
|
||||
if (!bufferProvider) {
|
||||
bufferProvider = PersistentBufferProviderBasic::Create(aSize, aFormat,
|
||||
gfxPlatform::GetPlatform()->GetFallbackCanvasBackend());
|
||||
gfxPlatform::GetPlatform()->GetFallbackCanvasBackend(), aMemoryCounter);
|
||||
}
|
||||
|
||||
return bufferProvider.forget();
|
||||
|
@ -485,7 +485,8 @@ public:
|
||||
*/
|
||||
virtual already_AddRefed<PersistentBufferProvider>
|
||||
CreatePersistentBufferProvider(const mozilla::gfx::IntSize &aSize,
|
||||
mozilla::gfx::SurfaceFormat aFormat);
|
||||
mozilla::gfx::SurfaceFormat aFormat,
|
||||
int64_t* aMemoryCounter);
|
||||
|
||||
virtual bool CanUseCanvasLayerForSize(const gfx::IntSize &aSize) { return true; }
|
||||
|
||||
|
@ -16,14 +16,23 @@ using namespace gfx;
|
||||
|
||||
namespace layers {
|
||||
|
||||
PersistentBufferProviderBasic::PersistentBufferProviderBasic(DrawTarget* aDt)
|
||||
PersistentBufferProviderBasic::PersistentBufferProviderBasic(DrawTarget* aDt, int64_t* aMemoryCounter)
|
||||
: mDrawTarget(aDt)
|
||||
, mMemoryCounter(aMemoryCounter)
|
||||
{
|
||||
if (mMemoryCounter) {
|
||||
IntSize size = mDrawTarget->GetSize();
|
||||
*mMemoryCounter += size.width * size.height * gfx::BytesPerPixel(mDrawTarget->GetFormat());
|
||||
}
|
||||
MOZ_COUNT_CTOR(PersistentBufferProviderBasic);
|
||||
}
|
||||
|
||||
PersistentBufferProviderBasic::~PersistentBufferProviderBasic()
|
||||
{
|
||||
if (mMemoryCounter) {
|
||||
IntSize size = mDrawTarget->GetSize();
|
||||
*mMemoryCounter -= size.width * size.height * gfx::BytesPerPixel(mDrawTarget->GetFormat());
|
||||
}
|
||||
MOZ_COUNT_DTOR(PersistentBufferProviderBasic);
|
||||
}
|
||||
|
||||
@ -67,7 +76,7 @@ PersistentBufferProviderBasic::ReturnSnapshot(already_AddRefed<gfx::SourceSurfac
|
||||
//static
|
||||
already_AddRefed<PersistentBufferProviderBasic>
|
||||
PersistentBufferProviderBasic::Create(gfx::IntSize aSize, gfx::SurfaceFormat aFormat,
|
||||
gfx::BackendType aBackend)
|
||||
gfx::BackendType aBackend, int64_t* aMemoryCounter)
|
||||
{
|
||||
RefPtr<DrawTarget> dt = gfxPlatform::GetPlatform()->CreateDrawTargetForBackend(aBackend, aSize, aFormat);
|
||||
|
||||
@ -76,7 +85,7 @@ PersistentBufferProviderBasic::Create(gfx::IntSize aSize, gfx::SurfaceFormat aFo
|
||||
}
|
||||
|
||||
RefPtr<PersistentBufferProviderBasic> provider =
|
||||
new PersistentBufferProviderBasic(dt);
|
||||
new PersistentBufferProviderBasic(dt, aMemoryCounter);
|
||||
|
||||
return provider.forget();
|
||||
}
|
||||
@ -86,7 +95,8 @@ PersistentBufferProviderBasic::Create(gfx::IntSize aSize, gfx::SurfaceFormat aFo
|
||||
already_AddRefed<PersistentBufferProviderShared>
|
||||
PersistentBufferProviderShared::Create(gfx::IntSize aSize,
|
||||
gfx::SurfaceFormat aFormat,
|
||||
CompositableForwarder* aFwd)
|
||||
CompositableForwarder* aFwd,
|
||||
int64_t* aMemoryCounter)
|
||||
{
|
||||
if (!aFwd || !aFwd->IPCOpen()) {
|
||||
return nullptr;
|
||||
@ -104,23 +114,27 @@ PersistentBufferProviderShared::Create(gfx::IntSize aSize,
|
||||
}
|
||||
|
||||
RefPtr<PersistentBufferProviderShared> provider =
|
||||
new PersistentBufferProviderShared(aSize, aFormat, aFwd, texture);
|
||||
new PersistentBufferProviderShared(aSize, aFormat, aFwd, texture, aMemoryCounter);
|
||||
|
||||
return provider.forget();
|
||||
}
|
||||
|
||||
PersistentBufferProviderShared::PersistentBufferProviderShared(gfx::IntSize aSize,
|
||||
gfx::SurfaceFormat aFormat,
|
||||
CompositableForwarder* aFwd,
|
||||
RefPtr<TextureClient>& aTexture)
|
||||
RefPtr<TextureClient>& aTexture,
|
||||
int64_t* aMemoryCounter)
|
||||
|
||||
: mSize(aSize)
|
||||
, mFormat(aFormat)
|
||||
, mFwd(aFwd)
|
||||
, mFront(Nothing())
|
||||
, mMemoryCounter(aMemoryCounter)
|
||||
{
|
||||
if (mTextures.append(aTexture)) {
|
||||
mBack = Some<uint32_t>(0);
|
||||
}
|
||||
OnAllocation();
|
||||
MOZ_COUNT_CTOR(PersistentBufferProviderShared);
|
||||
}
|
||||
|
||||
@ -293,6 +307,7 @@ PersistentBufferProviderShared::BorrowDrawTarget(const gfx::IntRect& aPersistedR
|
||||
|
||||
MOZ_ASSERT(newTexture);
|
||||
if (newTexture) {
|
||||
OnAllocation();
|
||||
if (mTextures.append(newTexture)) {
|
||||
tex = newTexture;
|
||||
mBack = Some<uint32_t>(mTextures.length() - 1);
|
||||
@ -405,12 +420,17 @@ PersistentBufferProviderShared::NotifyInactive()
|
||||
RefPtr<TextureClient> front = GetTexture(mFront);
|
||||
RefPtr<TextureClient> back = GetTexture(mBack);
|
||||
|
||||
for (unsigned i = 0; i < mTextures.length(); ++i) {
|
||||
OnDeallocation();
|
||||
}
|
||||
|
||||
// Clear all textures (except the front and back ones that we just kept).
|
||||
mTextures.clear();
|
||||
|
||||
if (back) {
|
||||
if (mTextures.append(back)) {
|
||||
mBack = Some<uint32_t>(0);
|
||||
OnAllocation();
|
||||
}
|
||||
if (front == back) {
|
||||
mFront = mBack;
|
||||
@ -420,6 +440,7 @@ PersistentBufferProviderShared::NotifyInactive()
|
||||
if (front && front != back) {
|
||||
if (mTextures.append(front)) {
|
||||
mFront = Some<uint32_t>(mTextures.length() - 1);
|
||||
OnAllocation();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -436,10 +457,29 @@ PersistentBufferProviderShared::Destroy()
|
||||
MOZ_ASSERT(false);
|
||||
texture->Unlock();
|
||||
}
|
||||
if (texture) {
|
||||
OnDeallocation();
|
||||
}
|
||||
}
|
||||
|
||||
mTextures.clear();
|
||||
}
|
||||
|
||||
void
|
||||
PersistentBufferProviderShared::OnAllocation()
|
||||
{
|
||||
if (mMemoryCounter) {
|
||||
*mMemoryCounter += mSize.width * mSize.height * gfx::BytesPerPixel(mFormat);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
PersistentBufferProviderShared::OnDeallocation()
|
||||
{
|
||||
if (mMemoryCounter) {
|
||||
*mMemoryCounter -= mSize.width * mSize.height * gfx::BytesPerPixel(mFormat);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace layers
|
||||
} // namespace mozilla
|
@ -82,9 +82,10 @@ public:
|
||||
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(PersistentBufferProviderBasic, override)
|
||||
|
||||
static already_AddRefed<PersistentBufferProviderBasic>
|
||||
Create(gfx::IntSize aSize, gfx::SurfaceFormat aFormat, gfx::BackendType aBackend);
|
||||
Create(gfx::IntSize aSize, gfx::SurfaceFormat aFormat, gfx::BackendType aBackend,
|
||||
int64_t* aMemoryCounter);
|
||||
|
||||
explicit PersistentBufferProviderBasic(gfx::DrawTarget* aTarget);
|
||||
explicit PersistentBufferProviderBasic(gfx::DrawTarget* aTarget, int64_t* aMemoryCounter = nullptr);
|
||||
|
||||
virtual LayersBackend GetType() override { return LayersBackend::LAYERS_BASIC; }
|
||||
|
||||
@ -102,6 +103,7 @@ private:
|
||||
|
||||
RefPtr<gfx::DrawTarget> mDrawTarget;
|
||||
RefPtr<gfx::SourceSurface> mSnapshot;
|
||||
int64_t* mMemoryCounter;
|
||||
};
|
||||
|
||||
|
||||
@ -117,7 +119,8 @@ public:
|
||||
|
||||
static already_AddRefed<PersistentBufferProviderShared>
|
||||
Create(gfx::IntSize aSize, gfx::SurfaceFormat aFormat,
|
||||
CompositableForwarder* aFwd);
|
||||
CompositableForwarder* aFwd,
|
||||
int64_t* aMemoryCounter);
|
||||
|
||||
virtual LayersBackend GetType() override { return LayersBackend::LAYERS_CLIENT; }
|
||||
|
||||
@ -141,10 +144,14 @@ public:
|
||||
protected:
|
||||
PersistentBufferProviderShared(gfx::IntSize aSize, gfx::SurfaceFormat aFormat,
|
||||
CompositableForwarder* aFwd,
|
||||
RefPtr<TextureClient>& aTexture);
|
||||
RefPtr<TextureClient>& aTexture,
|
||||
int64_t* aMemoryCounter);
|
||||
|
||||
~PersistentBufferProviderShared();
|
||||
|
||||
void OnAllocation();
|
||||
void OnDeallocation();
|
||||
|
||||
TextureClient* GetTexture(Maybe<uint32_t> aIndex);
|
||||
bool CheckIndex(uint32_t aIndex) { return aIndex < mTextures.length(); }
|
||||
|
||||
@ -161,6 +168,7 @@ protected:
|
||||
|
||||
RefPtr<gfx::DrawTarget> mDrawTarget;
|
||||
RefPtr<gfx::SourceSurface > mSnapshot;
|
||||
int64_t* mMemoryCounter;
|
||||
};
|
||||
|
||||
struct AutoReturnSnapshot
|
||||
|
@ -840,7 +840,8 @@ ClientLayerManager::DependsOnStaleDevice() const
|
||||
|
||||
already_AddRefed<PersistentBufferProvider>
|
||||
ClientLayerManager::CreatePersistentBufferProvider(const gfx::IntSize& aSize,
|
||||
gfx::SurfaceFormat aFormat)
|
||||
gfx::SurfaceFormat aFormat,
|
||||
int64_t* aMemoryCounter)
|
||||
{
|
||||
// Don't use a shared buffer provider if compositing is considered "not cheap"
|
||||
// because the canvas will most likely be flattened into a thebes layer instead
|
||||
@ -849,13 +850,13 @@ ClientLayerManager::CreatePersistentBufferProvider(const gfx::IntSize& aSize,
|
||||
if (IsCompositingCheap() &&
|
||||
gfxPrefs::PersistentBufferProviderSharedEnabled()) {
|
||||
RefPtr<PersistentBufferProvider> provider
|
||||
= PersistentBufferProviderShared::Create(aSize, aFormat, AsShadowForwarder());
|
||||
= PersistentBufferProviderShared::Create(aSize, aFormat, AsShadowForwarder(), aMemoryCounter);
|
||||
if (provider) {
|
||||
return provider.forget();
|
||||
}
|
||||
}
|
||||
|
||||
return LayerManager::CreatePersistentBufferProvider(aSize, aFormat);
|
||||
return LayerManager::CreatePersistentBufferProvider(aSize, aFormat, aMemoryCounter);
|
||||
}
|
||||
|
||||
|
||||
|
@ -231,7 +231,8 @@ public:
|
||||
void RemoveDidCompositeObserver(DidCompositeObserver* aObserver);
|
||||
|
||||
virtual already_AddRefed<PersistentBufferProvider>
|
||||
CreatePersistentBufferProvider(const gfx::IntSize& aSize, gfx::SurfaceFormat aFormat) override;
|
||||
CreatePersistentBufferProvider(const gfx::IntSize& aSize, gfx::SurfaceFormat aFormat,
|
||||
int64_t* aMemoryCounter) override;
|
||||
|
||||
protected:
|
||||
enum TransactionPhase {
|
||||
|
@ -85,6 +85,11 @@ public:
|
||||
|
||||
uint64_t GetSerial() const { return mSerial; }
|
||||
|
||||
virtual bool RecvDestroySync() override {
|
||||
DestroyIfNeeded();
|
||||
return true;
|
||||
}
|
||||
|
||||
HostIPCAllocator* mSurfaceAllocator;
|
||||
RefPtr<TextureHost> mTextureHost;
|
||||
// mSerial is unique in TextureClient's process.
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include "mozilla/layers/TextureClientPool.h"// for TextureClientPool
|
||||
#include "mozilla/gfx/gfxVars.h"
|
||||
#include "mozilla/gfx/GPUProcessManager.h"
|
||||
#include "mozilla/gfx/Logging.h"
|
||||
#include "mozilla/mozalloc.h" // for operator new, etc
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsDebug.h" // for NS_RUNTIMEABORT
|
||||
@ -1068,7 +1069,9 @@ CompositorBridgeChild::DeallocPAPZCTreeManagerChild(PAPZCTreeManagerChild* aActo
|
||||
void
|
||||
CompositorBridgeChild::ProcessingError(Result aCode, const char* aReason)
|
||||
{
|
||||
MOZ_RELEASE_ASSERT(aCode == MsgDropped, "Processing error in CompositorBridgeChild");
|
||||
if (aCode != MsgDropped) {
|
||||
gfxDevCrash(gfx::LogReason::ProcessingError) << "Processing error in CompositorBridgeChild: " << int(aCode);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace layers
|
||||
|
@ -136,27 +136,6 @@ struct CompositableTransaction
|
||||
mSwapRequired = true;
|
||||
}
|
||||
|
||||
void FallbackDestroyActors()
|
||||
{
|
||||
for (auto& actor : mDestroyedActors) {
|
||||
switch (actor.type()) {
|
||||
case OpDestroy::TPTextureChild: {
|
||||
DebugOnly<bool> ok = TextureClient::DestroyFallback(actor.get_PTextureChild());
|
||||
MOZ_ASSERT(ok);
|
||||
break;
|
||||
}
|
||||
case OpDestroy::TPCompositableChild: {
|
||||
DebugOnly<bool> ok = actor.get_PCompositableChild()->SendDestroySync();
|
||||
MOZ_ASSERT(ok);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
MOZ_CRASH("GFX: IBC Fallback destroy actors");
|
||||
}
|
||||
}
|
||||
mDestroyedActors.Clear();
|
||||
}
|
||||
|
||||
OpVector mOperations;
|
||||
OpDestroyVector mDestroyedActors;
|
||||
bool mSwapRequired;
|
||||
@ -395,13 +374,6 @@ static StaticMutex sImageBridgeSingletonLock;
|
||||
static StaticRefPtr<ImageBridgeChild> sImageBridgeChildSingleton;
|
||||
static Thread *sImageBridgeChildThread = nullptr;
|
||||
|
||||
void
|
||||
ImageBridgeChild::FallbackDestroyActors() {
|
||||
if (mTxn && !mTxn->mDestroyedActors.IsEmpty()) {
|
||||
mTxn->FallbackDestroyActors();
|
||||
}
|
||||
}
|
||||
|
||||
// Helper that creates a monitor and a "done" flag, then enters the monitor.
|
||||
// This can go away when we switch ImageBridge to an XPCOM thread.
|
||||
class MOZ_STACK_CLASS SynchronousTask
|
||||
@ -478,7 +450,6 @@ ImageBridgeChild::ShutdownStep1(SynchronousTask* aTask)
|
||||
client->Destroy();
|
||||
}
|
||||
}
|
||||
FallbackDestroyActors();
|
||||
|
||||
SendWillClose();
|
||||
MarkShutDown();
|
||||
@ -856,7 +827,6 @@ ImageBridgeChild::EndTransaction()
|
||||
if (mTxn->mSwapRequired) {
|
||||
if (!SendUpdate(cset, mTxn->mDestroyedActors, GetFwdTransactionId(), &replies)) {
|
||||
NS_WARNING("could not send async texture transaction");
|
||||
mTxn->FallbackDestroyActors();
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
@ -864,7 +834,6 @@ ImageBridgeChild::EndTransaction()
|
||||
// assumes that aReplies is empty (DEBUG assertion)
|
||||
if (!SendUpdateNoSwap(cset, mTxn->mDestroyedActors, GetFwdTransactionId())) {
|
||||
NS_WARNING("could not send async texture transaction (no swap)");
|
||||
mTxn->FallbackDestroyActors();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -383,7 +383,6 @@ protected:
|
||||
void ShutdownStep1(SynchronousTask* aTask);
|
||||
void ShutdownStep2(SynchronousTask* aTask);
|
||||
void MarkShutDown();
|
||||
void FallbackDestroyActors();
|
||||
|
||||
void ActorDestroy(ActorDestroyReason aWhy) override;
|
||||
void DeallocPImageBridgeChild() override;
|
||||
|
@ -168,6 +168,8 @@ ImageBridgeParent::RecvUpdate(EditArray&& aEdits, OpDestroyArray&& aToDestroy,
|
||||
const uint64_t& aFwdTransactionId,
|
||||
EditReplyArray* aReply)
|
||||
{
|
||||
// This ensures that destroy operations are always processed. It is not safe
|
||||
// to early-return from RecvUpdate without doing so.
|
||||
AutoImageBridgeParentAsyncMessageSender autoAsyncMessageSender(this, &aToDestroy);
|
||||
UpdateFwdTransactionId(aFwdTransactionId);
|
||||
|
||||
|
@ -270,6 +270,8 @@ LayerTransactionParent::RecvUpdate(InfallibleTArray<Edit>&& cset,
|
||||
return true;
|
||||
}
|
||||
|
||||
// This ensures that destroy operations are always processed. It is not safe
|
||||
// to early-return from RecvUpdate without doing so.
|
||||
AutoLayerTransactionParentAsyncMessageSender autoAsyncMessageSender(this, &aToDestroy);
|
||||
EditReplyVector replyv;
|
||||
|
||||
|
@ -22,11 +22,6 @@ parent:
|
||||
* Asynchronously tell the compositor side to remove the texture.
|
||||
*/
|
||||
async Destroy();
|
||||
|
||||
/**
|
||||
* Never used (needed for ParentActor).
|
||||
*/
|
||||
async DestroySync();
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
@ -160,27 +160,6 @@ public:
|
||||
|
||||
bool Opened() const { return mOpen; }
|
||||
|
||||
void FallbackDestroyActors()
|
||||
{
|
||||
for (auto& actor : mDestroyedActors) {
|
||||
switch (actor.type()) {
|
||||
case OpDestroy::TPTextureChild: {
|
||||
DebugOnly<bool> ok = TextureClient::DestroyFallback(actor.get_PTextureChild());
|
||||
MOZ_ASSERT(ok);
|
||||
break;
|
||||
}
|
||||
case OpDestroy::TPCompositableChild: {
|
||||
DebugOnly<bool> ok = actor.get_PCompositableChild()->SendDestroySync();
|
||||
MOZ_ASSERT(ok);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
MOZ_CRASH("GFX: SL Fallback destroy actors");
|
||||
}
|
||||
}
|
||||
mDestroyedActors.Clear();
|
||||
}
|
||||
|
||||
EditVector mCset;
|
||||
EditVector mPaints;
|
||||
OpDestroyVector mDestroyedActors;
|
||||
@ -226,9 +205,6 @@ ShadowLayerForwarder::ShadowLayerForwarder(ClientLayerManager* aClientLayerManag
|
||||
ShadowLayerForwarder::~ShadowLayerForwarder()
|
||||
{
|
||||
MOZ_ASSERT(mTxn->Finished(), "unfinished transaction?");
|
||||
if (!mTxn->mDestroyedActors.IsEmpty()) {
|
||||
mTxn->FallbackDestroyActors();
|
||||
}
|
||||
delete mTxn;
|
||||
if (mShadowManager) {
|
||||
mShadowManager->SetForwarder(nullptr);
|
||||
@ -769,7 +745,6 @@ ShadowLayerForwarder::EndTransaction(InfallibleTArray<EditReply>* aReplies,
|
||||
aPaintSequenceNumber, aIsRepeatTransaction,
|
||||
aTransactionStart, mPaintSyncId, aReplies)) {
|
||||
MOZ_LAYERS_LOG(("[LayersForwarder] WARNING: sending transaction failed!"));
|
||||
mTxn->FallbackDestroyActors();
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
@ -786,7 +761,6 @@ ShadowLayerForwarder::EndTransaction(InfallibleTArray<EditReply>* aReplies,
|
||||
aPaintSequenceNumber, aIsRepeatTransaction,
|
||||
aTransactionStart, mPaintSyncId)) {
|
||||
MOZ_LAYERS_LOG(("[LayersForwarder] WARNING: sending transaction failed!"));
|
||||
mTxn->FallbackDestroyActors();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -1173,6 +1173,7 @@ RasterImage::Decode(const IntSize& aSize,
|
||||
|
||||
// Make sure DecoderFactory was able to create a decoder successfully.
|
||||
if (!task) {
|
||||
DoError();
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
@ -1227,6 +1228,7 @@ RasterImage::RecoverFromInvalidFrames(const IntSize& aSize, uint32_t aFlags)
|
||||
// Animated images require some special handling, because we normally require
|
||||
// that they never be discarded.
|
||||
if (mAnimationState) {
|
||||
mAnimationState->SetDoneDecoding(false);
|
||||
Decode(mSize, aFlags | FLAG_SYNC_DECODE, PlaybackType::eAnimated);
|
||||
ResetAnimation();
|
||||
return;
|
||||
|
@ -11556,16 +11556,12 @@ CodeGenerator::visitAssertRangeF(LAssertRangeF* ins)
|
||||
{
|
||||
FloatRegister input = ToFloatRegister(ins->input());
|
||||
FloatRegister temp = ToFloatRegister(ins->temp());
|
||||
FloatRegister dest = input;
|
||||
if (hasMultiAlias())
|
||||
dest = ToFloatRegister(ins->armtemp());
|
||||
FloatRegister temp2 = ToFloatRegister(ins->temp2());
|
||||
|
||||
const Range* r = ins->range();
|
||||
|
||||
masm.convertFloat32ToDouble(input, dest);
|
||||
emitAssertRangeD(r, dest, temp);
|
||||
if (dest == input)
|
||||
masm.convertDoubleToFloat32(input, input);
|
||||
masm.convertFloat32ToDouble(input, temp);
|
||||
emitAssertRangeD(r, temp, temp2);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -3772,11 +3772,10 @@ LIRGenerator::visitAssertRange(MAssertRange* ins)
|
||||
lir = new(alloc()) LAssertRangeD(useRegister(input), tempDouble());
|
||||
break;
|
||||
|
||||
case MIRType::Float32: {
|
||||
LDefinition armtemp = hasMultiAlias() ? tempDouble() : LDefinition::BogusTemp();
|
||||
lir = new(alloc()) LAssertRangeF(useRegister(input), tempDouble(), armtemp);
|
||||
case MIRType::Float32:
|
||||
lir = new(alloc()) LAssertRangeF(useRegister(input), tempDouble(), tempDouble());
|
||||
break;
|
||||
}
|
||||
|
||||
case MIRType::Value:
|
||||
lir = new(alloc()) LAssertRangeV(useBox(input), tempToUnbox(), tempDouble(), tempDouble());
|
||||
break;
|
||||
|
@ -8546,22 +8546,21 @@ class LAssertRangeF : public LInstructionHelper<0, 1, 2>
|
||||
{
|
||||
public:
|
||||
LIR_HEADER(AssertRangeF)
|
||||
LAssertRangeF(const LAllocation& input, const LDefinition& temp, const LDefinition& armtemp) {
|
||||
LAssertRangeF(const LAllocation& input, const LDefinition& temp, const LDefinition& temp2) {
|
||||
setOperand(0, input);
|
||||
setTemp(0, temp);
|
||||
setTemp(1, armtemp);
|
||||
}
|
||||
const LDefinition* armtemp() {
|
||||
return getTemp(1);
|
||||
setTemp(1, temp2);
|
||||
}
|
||||
|
||||
const LAllocation* input() {
|
||||
return getOperand(0);
|
||||
}
|
||||
|
||||
const LDefinition* temp() {
|
||||
return getTemp(0);
|
||||
}
|
||||
const LDefinition* temp2() {
|
||||
return getTemp(1);
|
||||
}
|
||||
|
||||
MAssertRange* mir() {
|
||||
return mir_->toAssertRange();
|
||||
|
@ -482,6 +482,9 @@ elif CONFIG['JS_CODEGEN_ARM']:
|
||||
UNIFIED_SOURCES += [
|
||||
'jit/arm/Simulator-arm.cpp'
|
||||
]
|
||||
# Configuration used only for testing.
|
||||
if CONFIG['OS_ARCH'] == 'Linux':
|
||||
CXXFLAGS += [ '-msse2', '-mfpmath=sse' ]
|
||||
elif CONFIG['OS_ARCH'] == 'Darwin':
|
||||
SOURCES += [
|
||||
'jit/arm/llvm-compiler-rt/arm/aeabi_idivmod.S',
|
||||
|
@ -4392,8 +4392,8 @@ nsFlexContainerFrame::ReflowFlexItem(nsPresContext* aPresContext,
|
||||
/* virtual */ nscoord
|
||||
nsFlexContainerFrame::GetMinISize(nsRenderingContext* aRenderingContext)
|
||||
{
|
||||
nscoord minWidth = 0;
|
||||
DISPLAY_MIN_WIDTH(this, minWidth);
|
||||
nscoord minISize = 0;
|
||||
DISPLAY_MIN_WIDTH(this, minISize);
|
||||
|
||||
RenumberList();
|
||||
|
||||
@ -4401,28 +4401,29 @@ nsFlexContainerFrame::GetMinISize(nsRenderingContext* aRenderingContext)
|
||||
const FlexboxAxisTracker axisTracker(this, GetWritingMode());
|
||||
|
||||
for (nsIFrame* childFrame : mFrames) {
|
||||
nscoord childMinWidth =
|
||||
nscoord childMinISize =
|
||||
nsLayoutUtils::IntrinsicForContainer(aRenderingContext, childFrame,
|
||||
nsLayoutUtils::MIN_ISIZE);
|
||||
// For a horizontal single-line flex container, the intrinsic min width is
|
||||
// the sum of its items' min widths.
|
||||
// For a vertical flex container, or for a multi-line horizontal flex
|
||||
// container, the intrinsic min width is the max of its items' min widths.
|
||||
if (axisTracker.IsMainAxisHorizontal() &&
|
||||
// For a horizontal single-line flex container, the intrinsic min
|
||||
// isize is the sum of its items' min isizes.
|
||||
// For a column-oriented flex container, or for a multi-line row-
|
||||
// oriented flex container, the intrinsic min isize is the max of
|
||||
// its items' min isizes.
|
||||
if (axisTracker.IsRowOriented() &&
|
||||
NS_STYLE_FLEX_WRAP_NOWRAP == stylePos->mFlexWrap) {
|
||||
minWidth += childMinWidth;
|
||||
minISize += childMinISize;
|
||||
} else {
|
||||
minWidth = std::max(minWidth, childMinWidth);
|
||||
minISize = std::max(minISize, childMinISize);
|
||||
}
|
||||
}
|
||||
return minWidth;
|
||||
return minISize;
|
||||
}
|
||||
|
||||
/* virtual */ nscoord
|
||||
nsFlexContainerFrame::GetPrefISize(nsRenderingContext* aRenderingContext)
|
||||
{
|
||||
nscoord prefWidth = 0;
|
||||
DISPLAY_PREF_WIDTH(this, prefWidth);
|
||||
nscoord prefISize = 0;
|
||||
DISPLAY_PREF_WIDTH(this, prefISize);
|
||||
|
||||
RenumberList();
|
||||
|
||||
@ -4434,14 +4435,14 @@ nsFlexContainerFrame::GetPrefISize(nsRenderingContext* aRenderingContext)
|
||||
const FlexboxAxisTracker axisTracker(this, GetWritingMode());
|
||||
|
||||
for (nsIFrame* childFrame : mFrames) {
|
||||
nscoord childPrefWidth =
|
||||
nscoord childPrefISize =
|
||||
nsLayoutUtils::IntrinsicForContainer(aRenderingContext, childFrame,
|
||||
nsLayoutUtils::PREF_ISIZE);
|
||||
if (axisTracker.IsMainAxisHorizontal()) {
|
||||
prefWidth += childPrefWidth;
|
||||
if (axisTracker.IsRowOriented()) {
|
||||
prefISize += childPrefISize;
|
||||
} else {
|
||||
prefWidth = std::max(prefWidth, childPrefWidth);
|
||||
prefISize = std::max(prefISize, childPrefISize);
|
||||
}
|
||||
}
|
||||
return prefWidth;
|
||||
return prefISize;
|
||||
}
|
||||
|
@ -2142,16 +2142,6 @@ JsepSessionImpl::SetupDefaultCodecs()
|
||||
|
||||
// Supported video codecs.
|
||||
// Note: order here implies priority for building offers!
|
||||
JsepVideoCodecDescription* vp9 = new JsepVideoCodecDescription(
|
||||
"121",
|
||||
"VP9",
|
||||
90000
|
||||
);
|
||||
// Defaults for mandatory params
|
||||
vp9->mConstraints.maxFs = 12288; // Enough for 2048x1536
|
||||
vp9->mConstraints.maxFps = 60;
|
||||
mSupportedCodecs.values.push_back(vp9);
|
||||
|
||||
JsepVideoCodecDescription* vp8 = new JsepVideoCodecDescription(
|
||||
"120",
|
||||
"VP8",
|
||||
@ -2162,6 +2152,16 @@ JsepSessionImpl::SetupDefaultCodecs()
|
||||
vp8->mConstraints.maxFps = 60;
|
||||
mSupportedCodecs.values.push_back(vp8);
|
||||
|
||||
JsepVideoCodecDescription* vp9 = new JsepVideoCodecDescription(
|
||||
"121",
|
||||
"VP9",
|
||||
90000
|
||||
);
|
||||
// Defaults for mandatory params
|
||||
vp9->mConstraints.maxFs = 12288; // Enough for 2048x1536
|
||||
vp9->mConstraints.maxFps = 60;
|
||||
mSupportedCodecs.values.push_back(vp9);
|
||||
|
||||
JsepVideoCodecDescription* h264_1 = new JsepVideoCodecDescription(
|
||||
"126",
|
||||
"H264",
|
||||
|
@ -2743,8 +2743,8 @@ TEST_F(JsepSessionTest, ValidateOfferedCodecParams)
|
||||
ASSERT_EQ(SdpDirectionAttribute::kSendrecv, video_attrs.GetDirection());
|
||||
|
||||
ASSERT_EQ(6U, video_section.GetFormats().size());
|
||||
ASSERT_EQ("121", video_section.GetFormats()[0]);
|
||||
ASSERT_EQ("120", video_section.GetFormats()[1]);
|
||||
ASSERT_EQ("120", video_section.GetFormats()[0]);
|
||||
ASSERT_EQ("121", video_section.GetFormats()[1]);
|
||||
ASSERT_EQ("126", video_section.GetFormats()[2]);
|
||||
ASSERT_EQ("97", video_section.GetFormats()[3]);
|
||||
ASSERT_EQ("122", video_section.GetFormats()[4]);
|
||||
@ -2839,8 +2839,8 @@ TEST_F(JsepSessionTest, ValidateOfferedCodecParams)
|
||||
auto& parsed_red_params =
|
||||
*static_cast<const SdpFmtpAttributeList::RedParameters*>(red_params);
|
||||
ASSERT_EQ(5U, parsed_red_params.encodings.size());
|
||||
ASSERT_EQ(121, parsed_red_params.encodings[0]);
|
||||
ASSERT_EQ(120, parsed_red_params.encodings[1]);
|
||||
ASSERT_EQ(120, parsed_red_params.encodings[0]);
|
||||
ASSERT_EQ(121, parsed_red_params.encodings[1]);
|
||||
ASSERT_EQ(126, parsed_red_params.encodings[2]);
|
||||
ASSERT_EQ(97, parsed_red_params.encodings[3]);
|
||||
ASSERT_EQ(123, parsed_red_params.encodings[4]);
|
||||
@ -2904,24 +2904,26 @@ TEST_F(JsepSessionTest, ValidateAnsweredCodecParams)
|
||||
// TODO(bug 1099351): Once fixed, this stuff will need to be updated.
|
||||
ASSERT_EQ(1U, video_section.GetFormats().size());
|
||||
// ASSERT_EQ(3U, video_section.GetFormats().size());
|
||||
ASSERT_EQ("121", video_section.GetFormats()[0]);
|
||||
// ASSERT_EQ("126", video_section.GetFormats()[1]);
|
||||
// ASSERT_EQ("97", video_section.GetFormats()[2]);
|
||||
ASSERT_EQ("120", video_section.GetFormats()[0]);
|
||||
// ASSERT_EQ("121", video_section.GetFormats()[1]);
|
||||
// ASSERT_EQ("126", video_section.GetFormats()[2]);
|
||||
// ASSERT_EQ("97", video_section.GetFormats()[3]);
|
||||
|
||||
// Validate rtpmap
|
||||
ASSERT_TRUE(video_attrs.HasAttribute(SdpAttribute::kRtpmapAttribute));
|
||||
auto& rtpmaps = video_attrs.GetRtpmap();
|
||||
ASSERT_TRUE(rtpmaps.HasEntry("121"));
|
||||
ASSERT_TRUE(rtpmaps.HasEntry("120"));
|
||||
//ASSERT_TRUE(rtpmaps.HasEntry("121"));
|
||||
// ASSERT_TRUE(rtpmaps.HasEntry("126"));
|
||||
// ASSERT_TRUE(rtpmaps.HasEntry("97"));
|
||||
|
||||
//auto& vp8_entry = rtpmaps.GetEntry("120");
|
||||
auto& vp9_entry = rtpmaps.GetEntry("121");
|
||||
auto& vp8_entry = rtpmaps.GetEntry("120");
|
||||
//auto& vp9_entry = rtpmaps.GetEntry("121");
|
||||
// auto& h264_1_entry = rtpmaps.GetEntry("126");
|
||||
// auto& h264_0_entry = rtpmaps.GetEntry("97");
|
||||
|
||||
//ASSERT_EQ("VP8", vp8_entry.name);
|
||||
ASSERT_EQ("VP9", vp9_entry.name);
|
||||
ASSERT_EQ("VP8", vp8_entry.name);
|
||||
//ASSERT_EQ("VP9", vp9_entry.name);
|
||||
// ASSERT_EQ("H264", h264_1_entry.name);
|
||||
// ASSERT_EQ("H264", h264_0_entry.name);
|
||||
|
||||
@ -2932,17 +2934,17 @@ TEST_F(JsepSessionTest, ValidateAnsweredCodecParams)
|
||||
ASSERT_EQ(1U, fmtps.size());
|
||||
// ASSERT_EQ(3U, fmtps.size());
|
||||
|
||||
// VP9
|
||||
ASSERT_EQ("121", fmtps[0].format);
|
||||
// VP8
|
||||
ASSERT_EQ("120", fmtps[0].format);
|
||||
ASSERT_TRUE(!!fmtps[0].parameters);
|
||||
ASSERT_EQ(SdpRtpmapAttributeList::kVP9, fmtps[0].parameters->codec_type);
|
||||
ASSERT_EQ(SdpRtpmapAttributeList::kVP8, fmtps[0].parameters->codec_type);
|
||||
|
||||
auto& parsed_vp9_params =
|
||||
auto& parsed_vp8_params =
|
||||
*static_cast<const SdpFmtpAttributeList::VP8Parameters*>(
|
||||
fmtps[0].parameters.get());
|
||||
|
||||
ASSERT_EQ((uint32_t)12288, parsed_vp9_params.max_fs);
|
||||
ASSERT_EQ((uint32_t)60, parsed_vp9_params.max_fr);
|
||||
ASSERT_EQ((uint32_t)12288, parsed_vp8_params.max_fs);
|
||||
ASSERT_EQ((uint32_t)60, parsed_vp8_params.max_fr);
|
||||
|
||||
|
||||
SetLocalAnswer(answer);
|
||||
|
@ -4165,9 +4165,11 @@ TEST_P(SignalingTest, ValidateMultipleVideoCodecsInOffer)
|
||||
std::string offer = a1_->offer();
|
||||
|
||||
#ifdef H264_P0_SUPPORTED
|
||||
ASSERT_NE(offer.find("UDP/TLS/RTP/SAVPF 120 126 97"), std::string::npos);
|
||||
ASSERT_NE(offer.find("UDP/TLS/RTP/SAVPF 120 126 97") ||
|
||||
offer.find("UDP/TLS/RTP/SAVPF 120 121 126 97"), std::string::npos);
|
||||
#else
|
||||
ASSERT_NE(offer.find("UDP/TLS/RTP/SAVPF 120 126"), std::string::npos);
|
||||
ASSERT_NE(offer.find("UDP/TLS/RTP/SAVPF 120 126") ||
|
||||
offer.find("UDP/TLS/RTP/SAVPF 120 121 126"), std::string::npos);
|
||||
#endif
|
||||
ASSERT_NE(offer.find("a=rtpmap:120 VP8/90000"), std::string::npos);
|
||||
ASSERT_NE(offer.find("a=rtpmap:126 H264/90000"), std::string::npos);
|
||||
@ -4200,8 +4202,15 @@ TEST_P(SignalingTest, RemoveVP8FromOfferWithP1First)
|
||||
// Remove VP8 from offer
|
||||
std::string offer = a1_->offer();
|
||||
match = offer.find("UDP/TLS/RTP/SAVPF 120");
|
||||
if (match != std::string::npos) {
|
||||
offer.replace(match, strlen("UDP/TLS/RTP/SAVPF 120"), "UDP/TLS/RTP/SAVPF");
|
||||
}
|
||||
match = offer.find("UDP/TLS/RTP/SAVPF 121");
|
||||
if (match != std::string::npos) {
|
||||
offer.replace(match, strlen("UDP/TLS/RTP/SAVPF 121"), "UDP/TLS/RTP/SAVPF");
|
||||
}
|
||||
match = offer.find("UDP/TLS/RTP/SAVPF 126");
|
||||
ASSERT_NE(std::string::npos, match);
|
||||
offer.replace(match, strlen("UDP/TLS/RTP/SAVPF 120"), "UDP/TLS/RTP/SAVPF");
|
||||
|
||||
match = offer.find("profile-level-id");
|
||||
ASSERT_NE(std::string::npos, match);
|
||||
|
@ -664,11 +664,11 @@ void VP9EncoderImpl::PopulateCodecSpecific(CodecSpecificInfo* codec_specific,
|
||||
svc_internal_.svc_params.scaling_factor_num[i] /
|
||||
svc_internal_.svc_params.scaling_factor_den[i];
|
||||
}
|
||||
if (!vp9_info->flexible_mode) {
|
||||
vp9_info->gof.CopyGofInfoVP9(gof_);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (!vp9_info->flexible_mode) {
|
||||
vp9_info->gof.CopyGofInfoVP9(gof_);
|
||||
}
|
||||
}
|
||||
|
||||
int VP9EncoderImpl::GetEncodedLayerFrame(const vpx_codec_cx_pkt* pkt) {
|
||||
|
@ -695,15 +695,15 @@ var PromptUtils = {
|
||||
|
||||
let text;
|
||||
if (isProxy) {
|
||||
text = this.bundle.formatStringFromName("EnterLoginForProxy2", [realm, displayHost], 2);
|
||||
text = this.bundle.formatStringFromName("EnterLoginForProxy3", [realm, displayHost], 2);
|
||||
} else if (isPassOnly) {
|
||||
text = this.bundle.formatStringFromName("EnterPasswordFor", [username, displayHost], 2);
|
||||
} else if (isCrossOrig) {
|
||||
text = this.bundle.formatStringFromName("EnterUserPasswordForCrossOrigin", [displayHost], 1);
|
||||
text = this.bundle.formatStringFromName("EnterUserPasswordForCrossOrigin2", [displayHost], 1);
|
||||
} else if (!realm) {
|
||||
text = this.bundle.formatStringFromName("EnterUserPasswordFor2", [displayHost], 1);
|
||||
} else {
|
||||
text = this.bundle.formatStringFromName("EnterLoginForRealm2", [realm, displayHost], 2);
|
||||
text = this.bundle.formatStringFromName("EnterLoginForRealm3", [realm, displayHost], 2);
|
||||
}
|
||||
|
||||
return text;
|
||||
|
@ -205,7 +205,7 @@ pref("dom.keyboardevent.dispatch_during_composition", false);
|
||||
// Whether the UndoManager API is enabled
|
||||
pref("dom.undo_manager.enabled", false);
|
||||
|
||||
// Whether URL,nsLocation,Link::GetHash should be percent encoded
|
||||
// Whether URL,Location,Link::GetHash should be percent encoded
|
||||
// in setter and percent decoded in getter (old behaviour = true)
|
||||
pref("dom.url.encode_decode_hash", true);
|
||||
// Whether ::GetHash should do percent decoding (old behaviour = true)
|
||||
@ -452,6 +452,7 @@ pref("media.navigator.video.h264.level", 31); // 0x42E01f - level 3.1
|
||||
pref("media.navigator.video.h264.max_br", 0);
|
||||
pref("media.navigator.video.h264.max_mbps", 0);
|
||||
pref("media.peerconnection.video.h264_enabled", false);
|
||||
pref("media.peerconnection.video.vp9_enabled", true);
|
||||
pref("media.getusermedia.aec", 1);
|
||||
pref("media.getusermedia.browser.enabled", true);
|
||||
#endif
|
||||
@ -1099,7 +1100,7 @@ pref("print.print_edge_right", 0);
|
||||
pref("print.print_edge_bottom", 0);
|
||||
|
||||
// Print via the parent process. This is only used when e10s is enabled.
|
||||
#if defined(XP_WIN)
|
||||
#if defined(XP_WIN) || defined(XP_MACOSX)
|
||||
pref("print.print_via_parent", true);
|
||||
#else
|
||||
pref("print.print_via_parent", false);
|
||||
|
@ -9,6 +9,7 @@ from __future__ import absolute_import, print_function, unicode_literals
|
||||
import json
|
||||
import logging
|
||||
import requests
|
||||
import yaml
|
||||
|
||||
from .create import create_tasks
|
||||
from .decision import write_artifact
|
||||
@ -33,6 +34,7 @@ def taskgraph_action(options):
|
||||
decision_task_id = parameters['decision_id']
|
||||
# read in the full graph for reference
|
||||
full_task_json = get_artifact(decision_task_id, "public/full-task-graph.json")
|
||||
decision_params = get_artifact(decision_task_id, "public/parameters.yml")
|
||||
all_tasks, full_task_graph = TaskGraph.from_json(full_task_json, options['root'])
|
||||
|
||||
target_tasks = set(parameters['task_labels'].split(','))
|
||||
@ -46,6 +48,7 @@ def taskgraph_action(options):
|
||||
# We don't want to optimize target tasks since they have been requested by user
|
||||
# Hence we put `target_tasks under` `do_not_optimize`
|
||||
optimized_graph, label_to_taskid = optimize_task_graph(target_task_graph=target_task_graph,
|
||||
params=decision_params,
|
||||
do_not_optimize=target_tasks,
|
||||
existing_tasks=existing_tasks)
|
||||
|
||||
@ -72,5 +75,8 @@ def get_action_parameters(options):
|
||||
def get_artifact(task_id, path):
|
||||
url = TASKCLUSTER_QUEUE_URL + task_id + "/artifacts/" + path
|
||||
resp = requests.get(url=url)
|
||||
artifact = json.loads(resp.text)
|
||||
if path.endswith('.json'):
|
||||
artifact = json.loads(resp.text)
|
||||
elif path.endswith('.yml'):
|
||||
artifact = yaml.load(resp.text)
|
||||
return artifact
|
||||
|
@ -52,7 +52,6 @@ skip-if = os == "linux"
|
||||
[browser_context_menu.js]
|
||||
skip-if = e10s
|
||||
[browser_context_menu_iframe.js]
|
||||
skip-if = e10s
|
||||
[browser_passwordmgr_contextmenu.js]
|
||||
subsuite = clipboard
|
||||
[browser_passwordmgr_fields.js]
|
||||
|
@ -81,7 +81,7 @@ runInParent(() => {
|
||||
|
||||
add_task(function* test_iframe() {
|
||||
state = {
|
||||
msg : "http://mochi.test:8888 is requesting your username and password.\n\nThe site says: “mochitest”",
|
||||
msg : "http://mochi.test:8888 is requesting your username and password. The site says: “mochitest”",
|
||||
title : "Authentication Required",
|
||||
textValue : "mochiuser1",
|
||||
passValue : "mochipass1",
|
||||
@ -110,7 +110,7 @@ add_task(function* test_iframe() {
|
||||
iframe.contentDocument);
|
||||
|
||||
state = {
|
||||
msg : "http://mochi.test:8888 is requesting your username and password.\n\nThe site says: “mochitest2”",
|
||||
msg : "http://mochi.test:8888 is requesting your username and password. The site says: “mochitest2”",
|
||||
title : "Authentication Required",
|
||||
textValue : "mochiuser2",
|
||||
passValue : "mochipass2",
|
||||
@ -151,7 +151,7 @@ add_task(function* test_iframe() {
|
||||
// expected password (to trigger an auth prompt, and change-password
|
||||
// popup notification).
|
||||
state = {
|
||||
msg : "http://mochi.test:8888 is requesting your username and password.\n\nThe site says: “mochitest”",
|
||||
msg : "http://mochi.test:8888 is requesting your username and password. The site says: “mochitest”",
|
||||
title : "Authentication Required",
|
||||
textValue : "mochiuser1",
|
||||
passValue : "mochipass1",
|
||||
@ -183,7 +183,7 @@ add_task(function* test_iframe() {
|
||||
// to (but have an existing saved login for, so that we'll trigger
|
||||
// a change-password popup notification.
|
||||
state = {
|
||||
msg : "http://mochi.test:8888 is requesting your username and password.\n\nThe site says: “mochitest3”",
|
||||
msg : "http://mochi.test:8888 is requesting your username and password. The site says: “mochitest3”",
|
||||
title : "Authentication Required",
|
||||
textValue : "mochiuser3",
|
||||
passValue : "mochipass3-old",
|
||||
@ -229,7 +229,7 @@ add_task(function* test_iframe() {
|
||||
});
|
||||
|
||||
state = {
|
||||
msg : "http://mochi.test:8888 is requesting your username and password.\n\nThe site says: “mochitest3”",
|
||||
msg : "http://mochi.test:8888 is requesting your username and password. The site says: “mochitest3”",
|
||||
title : "Authentication Required",
|
||||
textValue : "",
|
||||
passValue : "",
|
||||
@ -263,7 +263,7 @@ add_task(function* test_iframe() {
|
||||
|
||||
add_task(function* test_schemeUpgrade() {
|
||||
let state = {
|
||||
msg : "https://example.com is requesting your username and password.\n\n" +
|
||||
msg : "https://example.com is requesting your username and password. " +
|
||||
"WARNING: Your password will not be sent to the website you are currently visiting!",
|
||||
title : "Authentication Required",
|
||||
textValue : "httpUser",
|
||||
@ -296,7 +296,7 @@ add_task(function* test_schemeUpgrade() {
|
||||
|
||||
add_task(function* test_schemeDowngrade() {
|
||||
let state = {
|
||||
msg : "http://example.com is requesting your username and password.\n\n" +
|
||||
msg : "http://example.com is requesting your username and password. " +
|
||||
"WARNING: Your password will not be sent to the website you are currently visiting!",
|
||||
title : "Authentication Required",
|
||||
textValue : "", // empty because we shouldn't downgrade
|
||||
@ -327,7 +327,7 @@ add_task(function* test_schemeDowngrade() {
|
||||
|
||||
add_task(function* test_schemeUpgrade_dedupe() {
|
||||
let state = {
|
||||
msg : "https://example.org is requesting your username and password.\n\n" +
|
||||
msg : "https://example.org is requesting your username and password. " +
|
||||
"WARNING: Your password will not be sent to the website you are currently visiting!",
|
||||
title : "Authentication Required",
|
||||
textValue : "dedupeUser",
|
||||
|
@ -125,7 +125,7 @@ let prompter2 = new PrompterProxy(prompterParent);
|
||||
|
||||
add_task(function* test_accept() {
|
||||
state = {
|
||||
msg : "http://example.com is requesting your username and password.\n\nThe site says: “some realm”",
|
||||
msg : "http://example.com is requesting your username and password. The site says: “some realm”",
|
||||
title : "Authentication Required",
|
||||
textValue : "inuser",
|
||||
passValue : "inpass",
|
||||
@ -162,7 +162,7 @@ add_task(function* test_accept() {
|
||||
|
||||
add_task(function* test_cancel() {
|
||||
state = {
|
||||
msg : "http://example.com is requesting your username and password.\n\nThe site says: “some realm”",
|
||||
msg : "http://example.com is requesting your username and password. The site says: “some realm”",
|
||||
title : "Authentication Required",
|
||||
textValue : "outuser",
|
||||
passValue : "outpass",
|
||||
@ -189,7 +189,7 @@ add_task(function* test_cancel() {
|
||||
add_task(function* test_pwonly() {
|
||||
// test filling in password-only login
|
||||
state = {
|
||||
msg : "http://example.com is requesting your username and password.\n\nThe site says: “http://example.com”",
|
||||
msg : "http://example.com is requesting your username and password. The site says: “http://example.com”",
|
||||
title : "Authentication Required",
|
||||
textValue : "",
|
||||
passValue : "examplepass",
|
||||
@ -223,7 +223,7 @@ add_task(function* test_multipleExisting() {
|
||||
// test filling in existing login (undetermined from multiple selection)
|
||||
// user2name/user2pass would also be valid to fill here.
|
||||
state = {
|
||||
msg : "http://example2.com is requesting your username and password.\n\nThe site says: “http://example2.com”",
|
||||
msg : "http://example2.com is requesting your username and password. The site says: “http://example2.com”",
|
||||
title : "Authentication Required",
|
||||
textValue : "user1name",
|
||||
passValue : "user1pass",
|
||||
@ -257,7 +257,7 @@ add_task(function* test_multipleExisting2() {
|
||||
// test filling in existing login (undetermined --> user1)
|
||||
// user2name/user2pass would also be valid to fill here.
|
||||
state = {
|
||||
msg : "http://example2.com is requesting your username and password.\n\nThe site says: “http://example2.com”",
|
||||
msg : "http://example2.com is requesting your username and password. The site says: “http://example2.com”",
|
||||
title : "Authentication Required",
|
||||
textValue : "user1name",
|
||||
passValue : "user1pass",
|
||||
@ -294,7 +294,7 @@ add_task(function* test_multipleExisting3() {
|
||||
// test filling in existing login (undetermined --> user2)
|
||||
// user2name/user2pass would also be valid to fill here.
|
||||
state = {
|
||||
msg : "http://example2.com is requesting your username and password.\n\nThe site says: “http://example2.com”",
|
||||
msg : "http://example2.com is requesting your username and password. The site says: “http://example2.com”",
|
||||
title : "Authentication Required",
|
||||
textValue : "user1name",
|
||||
passValue : "user1pass",
|
||||
@ -331,7 +331,7 @@ add_task(function* test_changingMultiple() {
|
||||
// test changing a password (undetermined --> user2 w/ newpass)
|
||||
// user2name/user2pass would also be valid to fill here.
|
||||
state = {
|
||||
msg : "http://example2.com is requesting your username and password.\n\nThe site says: “http://example2.com”",
|
||||
msg : "http://example2.com is requesting your username and password. The site says: “http://example2.com”",
|
||||
title : "Authentication Required",
|
||||
textValue : "user1name",
|
||||
passValue : "user1pass",
|
||||
@ -368,7 +368,7 @@ add_task(function* test_changingMultiple2() {
|
||||
// test changing a password (undetermined --> user2 w/ origpass)
|
||||
// user2name/user2pass would also be valid to fill here.
|
||||
state = {
|
||||
msg : "http://example2.com is requesting your username and password.\n\nThe site says: “http://example2.com”",
|
||||
msg : "http://example2.com is requesting your username and password. The site says: “http://example2.com”",
|
||||
title : "Authentication Required",
|
||||
textValue : "user1name",
|
||||
passValue : "user1pass",
|
||||
|
@ -142,7 +142,7 @@ add_task(function* setup() {
|
||||
add_task(function* test_noAutologin() {
|
||||
// test proxy login (default = no autologin), make sure it prompts.
|
||||
state = {
|
||||
msg : "The proxy moz-proxy://127.0.0.1:8888 is requesting a username and password.\n\nThe site says: “Proxy Realm”",
|
||||
msg : "The proxy moz-proxy://127.0.0.1:8888 is requesting a username and password. The site says: “Proxy Realm”",
|
||||
title : "Authentication Required",
|
||||
textValue : "proxuser",
|
||||
passValue : "proxpass",
|
||||
@ -200,7 +200,7 @@ add_task(function* test_autologin() {
|
||||
add_task(function* test_autologin_incorrect() {
|
||||
// test proxy login (with autologin), ensure it prompts after a failed auth.
|
||||
state = {
|
||||
msg : "The proxy moz-proxy://127.0.0.1:8888 is requesting a username and password.\n\nThe site says: “Proxy Realm”",
|
||||
msg : "The proxy moz-proxy://127.0.0.1:8888 is requesting a username and password. The site says: “Proxy Realm”",
|
||||
title : "Authentication Required",
|
||||
textValue : "proxuser",
|
||||
passValue : "proxpass",
|
||||
|
@ -273,15 +273,15 @@ var PromptUtilsTemp = {
|
||||
|
||||
let text;
|
||||
if (isProxy) {
|
||||
text = PromptUtils.getLocalizedString("EnterLoginForProxy2", [realm, displayHost]);
|
||||
text = PromptUtils.getLocalizedString("EnterLoginForProxy3", [realm, displayHost]);
|
||||
} else if (isPassOnly) {
|
||||
text = PromptUtils.getLocalizedString("EnterPasswordFor", [username, displayHost]);
|
||||
} else if (isCrossOrig) {
|
||||
text = PromptUtils.getLocalizedString("EnterUserPasswordForCrossOrigin", [displayHost]);
|
||||
text = PromptUtils.getLocalizedString("EnterUserPasswordForCrossOrigin2", [displayHost]);
|
||||
} else if (!realm) {
|
||||
text = PromptUtils.getLocalizedString("EnterUserPasswordFor2", [displayHost]);
|
||||
} else {
|
||||
text = PromptUtils.getLocalizedString("EnterLoginForRealm2", [realm, displayHost]);
|
||||
text = PromptUtils.getLocalizedString("EnterLoginForRealm3", [realm, displayHost]);
|
||||
}
|
||||
|
||||
return text;
|
||||
|
@ -1020,7 +1020,7 @@ function* runTests() {
|
||||
// (promptAuth is only accessible from the prompt service)
|
||||
info("Starting test: promptAuth with long realm");
|
||||
state = {
|
||||
msg : 'http://example.com is requesting your username and password.\n\nThe site ' +
|
||||
msg : 'http://example.com is requesting your username and password. The site ' +
|
||||
'says: \u201cabcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi ' +
|
||||
'abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi ' +
|
||||
'abcdefghi \u2026\u201d',
|
||||
@ -1073,7 +1073,7 @@ function* runTests() {
|
||||
realm : ""
|
||||
}
|
||||
state = {
|
||||
msg : 'http://example.com is requesting your username and password.\n\n' +
|
||||
msg : 'http://example.com is requesting your username and password. ' +
|
||||
'WARNING: Your password will not be sent to the website you are currently visiting!',
|
||||
title : "TestTitle",
|
||||
iconClass : "authentication-icon question-icon",
|
||||
@ -1116,7 +1116,7 @@ function* runTests() {
|
||||
realm : "Something!!!"
|
||||
}
|
||||
state = {
|
||||
msg : 'http://example.com is requesting your username and password.\n\n' +
|
||||
msg : 'http://example.com is requesting your username and password. ' +
|
||||
'WARNING: Your password will not be sent to the website you are currently visiting!',
|
||||
title : "TestTitle",
|
||||
iconClass : "authentication-icon question-icon",
|
||||
|
@ -119,7 +119,7 @@ add_task(function* runTestAuth()
|
||||
|
||||
state = {
|
||||
msg : "http://mochi.test:8888 is requesting your username " +
|
||||
"and password.\n\nThe site says: “mochitest”",
|
||||
"and password. The site says: “mochitest”",
|
||||
title : "Authentication Required",
|
||||
textValue : "",
|
||||
passValue : "",
|
||||
@ -155,7 +155,7 @@ add_task(function* runTestAuth()
|
||||
// Force parent to not look for tab-modal prompts, as they're not used for auth prompts.
|
||||
isTabModal =false;
|
||||
state = {
|
||||
msg : "http://example.com is requesting your username and password.\n\n" +
|
||||
msg : "http://example.com is requesting your username and password. " +
|
||||
"WARNING: Your password will not be sent to the website you are currently visiting!",
|
||||
title : "Authentication Required",
|
||||
textValue : "",
|
||||
|
@ -20,13 +20,13 @@ ScriptDlgGenericHeading=[JavaScript Application]
|
||||
ScriptDlgHeading=The page at %S says:
|
||||
ScriptDialogLabel=Prevent this page from creating additional dialogs
|
||||
ScriptDialogPreventTitle=Confirm Dialog Preference
|
||||
# LOCALIZATION NOTE (EnterLoginForRealm2, EnterLoginForProxy2):
|
||||
# LOCALIZATION NOTE (EnterLoginForRealm3, EnterLoginForProxy3):
|
||||
# %1 is an untrusted string provided by a remote server. It could try to
|
||||
# take advantage of sentence structure in order to mislead the user (see
|
||||
# bug 244273). %1 should be integrated into the translated sentences as
|
||||
# little as possible. %2 is the url of the site being accessed.
|
||||
EnterLoginForRealm2=%2$S is requesting your username and password.\n\nThe site says: “%1$S”
|
||||
EnterLoginForProxy2=The proxy %2$S is requesting a username and password.\n\nThe site says: “%1$S”
|
||||
EnterLoginForRealm3=%2$S is requesting your username and password. The site says: “%1$S”
|
||||
EnterLoginForProxy3=The proxy %2$S is requesting a username and password. The site says: “%1$S”
|
||||
EnterUserPasswordFor2=%1$S is requesting your username and password.
|
||||
EnterUserPasswordForCrossOrigin=%1$S is requesting your username and password.\n\nWARNING: Your password will not be sent to the website you are currently visiting!
|
||||
EnterUserPasswordForCrossOrigin2=%1$S is requesting your username and password. WARNING: Your password will not be sent to the website you are currently visiting!
|
||||
EnterPasswordFor=Enter password for %1$S on %2$S
|
||||
|
Loading…
Reference in New Issue
Block a user