Bug 1520037 - Reuse 'BrowsingContext::TopLevelBrowsingContext()'. r=nika

GetTop() can simply wrap the result from TopLevelBrowsingContext().

Differential Revision: https://phabricator.services.mozilla.com/D16511

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Alastor Wu 2019-01-15 17:06:12 +00:00
Родитель 1558607307
Коммит 6b59e31c9d
1 изменённых файлов: 1 добавлений и 6 удалений

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

@ -424,12 +424,7 @@ void BrowsingContext::Blur(ErrorResult& aError) {
Nullable<WindowProxyHolder> BrowsingContext::GetTop(ErrorResult& aError) {
// We never return null or throw an error, but the implementation in
// nsGlobalWindow does and we need to use the same signature.
BrowsingContext* bc = this;
BrowsingContext* parent;
while ((parent = bc->mParent)) {
bc = parent;
}
return WindowProxyHolder(bc);
return WindowProxyHolder(TopLevelBrowsingContext());
}
void BrowsingContext::GetOpener(JSContext* aCx,