mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 760102 - Authorize web applications to use fullscreen by default. r=cpearce
This commit is contained in:
parent
407767521d
commit
714578e283
@ -8991,6 +8991,7 @@ nsDocument::RequestFullScreen(Element* aElement, bool aWasCallerChrome)
|
||||
// to the document's principal's host, if it has one.
|
||||
if (!mIsApprovedForFullscreen) {
|
||||
mIsApprovedForFullscreen =
|
||||
GetWindow()->IsPartOfApp() ||
|
||||
nsContentUtils::IsSitePermAllow(NodePrincipal(), "fullscreen");
|
||||
}
|
||||
|
||||
|
@ -4762,6 +4762,11 @@ nsGenericElement::MozRequestPointerLock()
|
||||
static const char*
|
||||
GetFullScreenError(nsIDocument* aDoc)
|
||||
{
|
||||
nsCOMPtr<nsPIDOMWindow> win = aDoc->GetWindow();
|
||||
if (win && win->IsPartOfApp()) {
|
||||
return nsnull;
|
||||
}
|
||||
|
||||
if (!nsContentUtils::IsRequestFullScreenAllowed()) {
|
||||
return "FullScreenDeniedNotInputDriven";
|
||||
}
|
||||
|
@ -340,6 +340,7 @@ public:
|
||||
virtual NS_HIDDEN_(bool) DispatchCustomEvent(const char *aEventName);
|
||||
virtual NS_HIDDEN_(void) RefreshCompartmentPrincipal();
|
||||
virtual NS_HIDDEN_(nsresult) SetFullScreenInternal(bool aIsFullScreen, bool aRequireTrust);
|
||||
virtual NS_HIDDEN_(bool) IsPartOfApp();
|
||||
|
||||
// nsIDOMStorageIndexedDB
|
||||
NS_DECL_NSIDOMSTORAGEINDEXEDDB
|
||||
@ -545,13 +546,6 @@ public:
|
||||
void AddEventTargetObject(nsDOMEventTargetHelper* aObject);
|
||||
void RemoveEventTargetObject(nsDOMEventTargetHelper* aObject);
|
||||
|
||||
/**
|
||||
* Returns if the window is part of an application.
|
||||
* It will check for the window app state and its parents until a window has
|
||||
* an app state different from |TriState_Unknown|.
|
||||
*/
|
||||
bool IsPartOfApp();
|
||||
|
||||
protected:
|
||||
friend class HashchangeCallback;
|
||||
friend class nsBarProp;
|
||||
|
@ -592,6 +592,13 @@ public:
|
||||
*/
|
||||
virtual void RefreshCompartmentPrincipal() = 0;
|
||||
|
||||
/**
|
||||
* Returns if the window is part of an application.
|
||||
* It will check for the window app state and its parents until a window has
|
||||
* an app state different from |TriState_Unknown|.
|
||||
*/
|
||||
virtual bool IsPartOfApp() = 0;
|
||||
|
||||
protected:
|
||||
// The nsPIDOMWindow constructor. The aOuterWindow argument should
|
||||
// be null if and only if the created window itself is an outer
|
||||
|
Loading…
Reference in New Issue
Block a user