Bug 1187801 part 2 - Put clearing fullscreen state on element into an independent function. r=smaug

--HG--
extra : source : d461799695d7fe5325066d4134d0a57eac407627
This commit is contained in:
Xidorn Quan 2015-10-08 17:47:39 +11:00
Родитель 7ea7355828
Коммит 2d891027c2
1 изменённых файлов: 11 добавлений и 10 удалений

Просмотреть файл

@ -11354,6 +11354,15 @@ UpdateViewportScrollbarOverrideForFullscreen(nsIDocument* aDoc)
}
}
static void
ClearFullscreenStateOnElement(Element* aElement)
{
// Remove any VR state properties
aElement->DeleteProperty(nsGkAtoms::vr_state);
// Remove styles from existing top element.
EventStateManager::SetFullScreenState(aElement, false);
}
void
nsDocument::CleanupFullscreenState()
{
@ -11366,9 +11375,7 @@ nsDocument::CleanupFullscreenState()
// after bug 1195213.
for (nsWeakPtr& weakPtr : Reversed(mFullScreenStack)) {
if (nsCOMPtr<Element> element = do_QueryReferent(weakPtr)) {
// Remove any VR state properties
element->DeleteProperty(nsGkAtoms::vr_state);
EventStateManager::SetFullScreenState(element, false);
ClearFullscreenStateOnElement(element);
}
}
mFullScreenStack.Clear();
@ -11398,13 +11405,7 @@ nsDocument::FullScreenStackPop()
return;
}
Element* top = FullScreenStackTop();
// Remove any VR state properties
top->DeleteProperty(nsGkAtoms::vr_state);
// Remove styles from existing top element.
EventStateManager::SetFullScreenState(top, false);
ClearFullscreenStateOnElement(FullScreenStackTop());
// Remove top element. Note the remaining top element in the stack
// will not have full-screen style bits set, so we will need to restore