diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index 48003e00d009..87705b4bffc4 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -4874,9 +4874,7 @@ nsDocShell::SetIsActive(bool aIsActive) { if (RefPtr doc = mScriptGlobal->GetExtantDoc()) { // Update orientation when the top-level browsing context becomes active. if (aIsActive) { - nsCOMPtr parent; - GetInProcessSameTypeParent(getter_AddRefs(parent)); - if (!parent) { + if (mBrowsingContext->IsTop()) { // We only care about the top-level browsing context. uint16_t orientation = OrientationLock(); ScreenOrientation::UpdateActiveOrientationLock(orientation);