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:
Xidorn Quan 2016-02-17 08:47:11 +08:00
parent 6d91654914
commit 49647faf41
4 changed files with 3 additions and 22 deletions

View File

@ -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()
{

View File

@ -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,

View File

@ -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();

View File

@ -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();