Bug 1216049 part 1 - Remove the use of Element::IsFullScreenAncestor() in Element::UnbindFromTree(). r=smaug

Since UnbindFromTree() would eventually be called synchronously for
every element unbound, we don't have to check whether the root of
unbound elements is a fullscreen ancestor.

MozReview-Commit-ID: F6mxNsVZ2yl

--HG--
extra : source : ed575daf8d8907ad9b45040423b176d32b9c0a08
This commit is contained in:
Xidorn Quan 2016-06-30 09:24:41 +10:00
Родитель b9106558db
Коммит 227146d238
1 изменённых файлов: 10 добавлений и 11 удалений

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

@ -1733,18 +1733,17 @@ Element::UnbindFromTree(bool aDeep, bool aNullParent)
if (HasPointerLock()) {
nsIDocument::UnlockPointer();
}
if (mState.HasState(NS_EVENT_STATE_FULL_SCREEN)) {
// The element being removed is an ancestor of the full-screen element,
// exit full-screen state.
nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
NS_LITERAL_CSTRING("DOM"), OwnerDoc(),
nsContentUtils::eDOM_PROPERTIES,
"RemovedFullscreenElement");
// Fully exit full-screen.
nsIDocument::ExitFullscreenInDocTree(OwnerDoc());
}
if (aNullParent) {
if (IsFullScreenAncestor()) {
// The element being removed is an ancestor of the full-screen element,
// exit full-screen state.
nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
NS_LITERAL_CSTRING("DOM"), OwnerDoc(),
nsContentUtils::eDOM_PROPERTIES,
"RemovedFullscreenElement");
// Fully exit full-screen.
nsIDocument::ExitFullscreenInDocTree(OwnerDoc());
}
if (GetParent() && GetParent()->IsInUncomposedDoc()) {
// Update the editable descendant count in the ancestors before we
// lose the reference to the parent.