mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 19:04:45 +00:00
Bug 743198 part 1 - Drop [Throws] of document.mozFullScreenElement. r=smaug
This method actually never throws. IsFullScreenDoc() simply checks whether GetFullScreenElement() returns nullptr, which means if that method returns true, the "!el" check would never fail. --HG-- extra : source : f32a1aeb6835fd4b4c47ef3abe6b9d7366ae4f07
This commit is contained in:
parent
6d91654914
commit
49647faf41
@ -11955,30 +11955,12 @@ nsDocument::ApplyFullscreen(const FullscreenRequest& aRequest)
|
||||
NS_IMETHODIMP
|
||||
nsDocument::GetMozFullScreenElement(nsIDOMElement **aFullScreenElement)
|
||||
{
|
||||
ErrorResult rv;
|
||||
Element* el = GetMozFullScreenElement(rv);
|
||||
if (rv.Failed()) {
|
||||
return rv.StealNSResult();
|
||||
}
|
||||
Element* el = GetMozFullScreenElement();
|
||||
nsCOMPtr<nsIDOMElement> retval = do_QueryInterface(el);
|
||||
retval.forget(aFullScreenElement);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
Element*
|
||||
nsDocument::GetMozFullScreenElement(ErrorResult& rv)
|
||||
{
|
||||
if (IsFullScreenDoc()) {
|
||||
// Must have a full-screen element while in full-screen mode.
|
||||
Element* el = GetFullScreenElement();
|
||||
if (!el) {
|
||||
rv.Throw(NS_ERROR_UNEXPECTED);
|
||||
}
|
||||
return el;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Element*
|
||||
nsDocument::GetFullScreenElement()
|
||||
{
|
||||
|
@ -1262,7 +1262,7 @@ public:
|
||||
|
||||
// DOM-exposed fullscreen API
|
||||
virtual bool MozFullScreenEnabled() override;
|
||||
virtual Element* GetMozFullScreenElement(mozilla::ErrorResult& rv) override;
|
||||
Element* GetMozFullScreenElement() override { return GetFullScreenElement(); }
|
||||
|
||||
void RequestPointerLock(Element* aElement) override;
|
||||
bool ShouldLockPointer(Element* aElement, Element* aCurrentLock,
|
||||
|
@ -2504,7 +2504,7 @@ public:
|
||||
nsIURI* GetDocumentURIObject() const;
|
||||
// Not const because all the full-screen goop is not const
|
||||
virtual bool MozFullScreenEnabled() = 0;
|
||||
virtual Element* GetMozFullScreenElement(mozilla::ErrorResult& rv) = 0;
|
||||
virtual Element* GetMozFullScreenElement() = 0;
|
||||
bool MozFullScreen()
|
||||
{
|
||||
return IsFullScreenDoc();
|
||||
|
@ -225,7 +225,6 @@ partial interface Document {
|
||||
// Note: Per spec the 'S' in these two is lowercase, but the "Moz"
|
||||
// versions hve it uppercase.
|
||||
readonly attribute boolean mozFullScreenEnabled;
|
||||
[Throws]
|
||||
readonly attribute Element? mozFullScreenElement;
|
||||
|
||||
//(Renamed?)void exitFullscreen();
|
||||
|
Loading…
Reference in New Issue
Block a user