Bug 1696717 - Constify the dom fullscreen code a bit. r=hiro

Differential Revision: https://phabricator.services.mozilla.com/D107362
This commit is contained in:
Emilio Cobos Álvarez 2021-03-07 21:46:00 +00:00
parent 6283dfa76c
commit d5a1f6115c
4 changed files with 5 additions and 5 deletions

View File

@ -14175,7 +14175,7 @@ Element* Document::GetTopLayerTop() {
return element;
}
Element* Document::GetUnretargetedFullScreenElement() {
Element* Document::GetUnretargetedFullScreenElement() const {
for (const nsWeakPtr& weakPtr : Reversed(mTopLayer)) {
nsCOMPtr<Element> element(do_QueryReferent(weakPtr));
// Per spec, the fullscreen element is the topmost element in the documents

View File

@ -3395,8 +3395,8 @@ class Document : public nsINode,
Element* GetTopLayerTop();
// Return the fullscreen element in the top layer
Element* GetUnretargetedFullScreenElement();
bool Fullscreen() { return !!GetFullscreenElement(); }
Element* GetUnretargetedFullScreenElement() const;
bool Fullscreen() const { return !!GetUnretargetedFullScreenElement(); }
already_AddRefed<Promise> ExitFullscreen(ErrorResult&);
void ExitPointerLock() { PointerLockManager::Unlock(this); }
void GetFgColor(nsAString& aFgColor);

View File

@ -313,7 +313,7 @@ Element* DocumentOrShadowRoot::GetPointerLockElement() {
: nullptr;
}
Element* DocumentOrShadowRoot::GetFullscreenElement() {
Element* DocumentOrShadowRoot::GetFullscreenElement() const {
if (!AsNode().IsInComposedDoc()) {
return nullptr;
}

View File

@ -121,7 +121,7 @@ class DocumentOrShadowRoot {
~DocumentOrShadowRoot();
Element* GetPointerLockElement();
Element* GetFullscreenElement();
Element* GetFullscreenElement() const;
Element* ElementFromPoint(float aX, float aY);
nsINode* NodeFromPoint(float aX, float aY);