Bug 1216049 part 2 - Remove Element::IsFullScreenAncestor() and replace its trivial callsites. r?smaug
MozReview-Commit-ID: F46GXziXTIR
--- a/dom/base/Element.h
+++ b/dom/base/Element.h
@@ -188,25 +188,16 @@ public:
void UpdateState(bool aNotify);
/**
* Method to update mState with link state information. This does not notify.
*/
void UpdateLinkState(EventStates aState);
/**
- * Returns true if this element is either a full-screen element or an
- * ancestor of the full-screen element.
- */
- bool IsFullScreenAncestor() const {
- return mState.HasAtLeastOneOfStates(NS_EVENT_STATE_FULL_SCREEN_ANCESTOR |
- NS_EVENT_STATE_FULL_SCREEN);
- }
-
- /**
* The style state of this element. This is the real state of the element
* with any style locks applied for pseudo-class inspecting.
*/
EventStates StyleState() const
{
if (!HasLockedStyleStates()) {
return mState;
}
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -11647,17 +11647,17 @@ nsDocument::FullScreenStackPop()
mFullScreenStack.RemoveElementAt(last);
// Pop from the stack null elements (references to elements which have
// been GC'd since they were added to the stack) and elements which are
// no longer in this document.
while (!mFullScreenStack.IsEmpty()) {
Element* element = FullScreenStackTop();
if (!element || !element->IsInUncomposedDoc() || element->OwnerDoc() != this) {
- NS_ASSERTION(!element->IsFullScreenAncestor(),
+ NS_ASSERTION(!element->State().HasState(NS_EVENT_STATE_FULL_SCREEN),
"Should have already removed full-screen styles");
uint32_t last = mFullScreenStack.Length() - 1;
mFullScreenStack.RemoveElementAt(last);
} else {
// The top element of the stack is now an in-doc element. Return here.
break;
}
}
@@ -12209,17 +12209,17 @@ nsDocument::GetMozFullScreenElement(nsID
return NS_OK;
}
Element*
nsDocument::GetFullscreenElement()
{
Element* element = FullScreenStackTop();
NS_ASSERTION(!element ||
- element->IsFullScreenAncestor(),
+ element->State().HasState(NS_EVENT_STATE_FULL_SCREEN),
"Fullscreen element should have fullscreen styles applied");
return element;
}
NS_IMETHODIMP
nsDocument::GetMozFullScreen(bool *aFullScreen)
{
*aFullScreen = Fullscreen();