зеркало из https://github.com/mozilla/pjs.git
Bug 757296 - Replace windows line endings with unix line endings in nsDocument.cpp. r=line-endings
This commit is contained in:
Родитель
2949b453e4
Коммит
e5c4486408
|
@ -8774,10 +8774,10 @@ LogFullScreenDenied(bool aLogFailure, const char* aMessage, nsIDocument* aDoc)
|
|||
nsresult
|
||||
nsDocument::AddFullscreenApprovedObserver()
|
||||
{
|
||||
nsCOMPtr<nsIObserverService> os = mozilla::services::GetObserverService();
|
||||
nsCOMPtr<nsIObserverService> os = mozilla::services::GetObserverService();
|
||||
NS_ENSURE_TRUE(os, NS_ERROR_FAILURE);
|
||||
|
||||
nsresult res = os->AddObserver(this, "fullscreen-approved", true);
|
||||
|
||||
nsresult res = os->AddObserver(this, "fullscreen-approved", true);
|
||||
NS_ENSURE_SUCCESS(res, res);
|
||||
|
||||
return NS_OK;
|
||||
|
@ -8786,9 +8786,9 @@ nsDocument::AddFullscreenApprovedObserver()
|
|||
nsresult
|
||||
nsDocument::RemoveFullscreenApprovedObserver()
|
||||
{
|
||||
nsCOMPtr<nsIObserverService> os = mozilla::services::GetObserverService();
|
||||
nsCOMPtr<nsIObserverService> os = mozilla::services::GetObserverService();
|
||||
NS_ENSURE_TRUE(os, NS_ERROR_FAILURE);
|
||||
|
||||
|
||||
nsresult res = os->RemoveObserver(this, "fullscreen-approved");
|
||||
NS_ENSURE_SUCCESS(res, res);
|
||||
|
||||
|
@ -8810,7 +8810,7 @@ nsDocument::CleanupFullscreenState()
|
|||
mFullScreenStack.Clear();
|
||||
}
|
||||
SetApprovedForFullscreen(false);
|
||||
RemoveFullscreenApprovedObserver();
|
||||
RemoveFullscreenApprovedObserver();
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -9272,16 +9272,16 @@ private:
|
|||
// reference; the nsIEventTarget to which this is dispatched holds the only
|
||||
// owning reference to this instance. This reference is valid between
|
||||
// an instance being created, and its Run() method being called.
|
||||
static nsAsyncPointerLockRequest* sInstance;
|
||||
|
||||
// Element and document which reqested pointer lock.
|
||||
static nsAsyncPointerLockRequest* sInstance;
|
||||
|
||||
// Element and document which reqested pointer lock.
|
||||
nsCOMPtr<Element> mElement;
|
||||
nsCOMPtr<nsIDocument> mDocument;
|
||||
};
|
||||
|
||||
nsAsyncPointerLockRequest* nsAsyncPointerLockRequest::sInstance = nsnull;
|
||||
nsAsyncPointerLockRequest* nsAsyncPointerLockRequest::sInstance = nsnull;
|
||||
nsWeakPtr nsDocument::sPendingPointerLockDoc;
|
||||
nsWeakPtr nsDocument::sPendingPointerLockElement;
|
||||
nsWeakPtr nsDocument::sPendingPointerLockElement;
|
||||
|
||||
/* static */
|
||||
void
|
||||
|
@ -9289,26 +9289,26 @@ nsDocument::ClearPendingPointerLockRequest(bool aDispatchErrorEvents)
|
|||
{
|
||||
nsAsyncPointerLockRequest::Cancel();
|
||||
|
||||
if (!sPendingPointerLockDoc) {
|
||||
// No pending request.
|
||||
return;
|
||||
}
|
||||
nsCOMPtr<nsIDocument> doc(do_QueryReferent(sPendingPointerLockDoc));
|
||||
if (aDispatchErrorEvents) {
|
||||
DispatchPointerLockError(doc);
|
||||
}
|
||||
nsCOMPtr<Element> element(do_QueryReferent(sPendingPointerLockElement));
|
||||
#ifdef DEBUG
|
||||
if (!sPendingPointerLockDoc) {
|
||||
// No pending request.
|
||||
return;
|
||||
}
|
||||
nsCOMPtr<nsIDocument> doc(do_QueryReferent(sPendingPointerLockDoc));
|
||||
if (aDispatchErrorEvents) {
|
||||
DispatchPointerLockError(doc);
|
||||
}
|
||||
nsCOMPtr<Element> element(do_QueryReferent(sPendingPointerLockElement));
|
||||
#ifdef DEBUG
|
||||
nsCOMPtr<Element> pointerLockedElement =
|
||||
do_QueryReferent(nsEventStateManager::sPointerLockedElement);
|
||||
NS_ASSERTION(pointerLockedElement != element,
|
||||
"We shouldn't be clearing pointer locked flag on pointer locked element!");
|
||||
#endif
|
||||
if (element) {
|
||||
element->ClearPointerLock();
|
||||
}
|
||||
sPendingPointerLockDoc = nsnull;
|
||||
sPendingPointerLockElement = nsnull;
|
||||
do_QueryReferent(nsEventStateManager::sPointerLockedElement);
|
||||
NS_ASSERTION(pointerLockedElement != element,
|
||||
"We shouldn't be clearing pointer locked flag on pointer locked element!");
|
||||
#endif
|
||||
if (element) {
|
||||
element->ClearPointerLock();
|
||||
}
|
||||
sPendingPointerLockDoc = nsnull;
|
||||
sPendingPointerLockElement = nsnull;
|
||||
}
|
||||
|
||||
/* static */
|
||||
|
@ -9318,27 +9318,27 @@ nsDocument::SetPendingPointerLockRequest(Element* aElement)
|
|||
// If there's an existing pending pointer lock request, deny it.
|
||||
ClearPendingPointerLockRequest(true);
|
||||
|
||||
NS_ENSURE_TRUE(aElement != nsnull, NS_ERROR_FAILURE);
|
||||
|
||||
sPendingPointerLockDoc = do_GetWeakReference(aElement->OwnerDoc());
|
||||
sPendingPointerLockElement = do_GetWeakReference(aElement);
|
||||
|
||||
// Set the pointer lock flag, so that if the element is removed from
|
||||
// its document we know to cancel the pending request.
|
||||
aElement->SetPointerLock();
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
NS_ENSURE_TRUE(aElement != nsnull, NS_ERROR_FAILURE);
|
||||
|
||||
void
|
||||
nsDocument::SetApprovedForFullscreen(bool aIsApproved)
|
||||
{
|
||||
mIsApprovedForFullscreen = aIsApproved;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsDocument::Observe(nsISupports *aSubject,
|
||||
const char *aTopic,
|
||||
sPendingPointerLockDoc = do_GetWeakReference(aElement->OwnerDoc());
|
||||
sPendingPointerLockElement = do_GetWeakReference(aElement);
|
||||
|
||||
// Set the pointer lock flag, so that if the element is removed from
|
||||
// its document we know to cancel the pending request.
|
||||
aElement->SetPointerLock();
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
nsDocument::SetApprovedForFullscreen(bool aIsApproved)
|
||||
{
|
||||
mIsApprovedForFullscreen = aIsApproved;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsDocument::Observe(nsISupports *aSubject,
|
||||
const char *aTopic,
|
||||
const PRUnichar *aData)
|
||||
{
|
||||
if (strcmp("fullscreen-approved", aTopic) == 0) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче