Bug 1606528 - part 1: Implement BrowsingContext::IsTop(). r=kmag

This is a frequent pattern.

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Tetsuharu OHZEKI 2020-01-06 19:13:05 +00:00
parent b380a4a808
commit 02e6ecc1ca

View File

@ -221,6 +221,8 @@ class BrowsingContext : public nsISupports,
bool IsContent() const { return mType == Type::Content; }
bool IsChrome() const { return !IsContent(); }
bool IsTop() const { return !GetParent(); }
bool IsTopContent() const { return IsContent() && !GetParent(); }
bool IsContentSubframe() const { return IsContent() && GetParent(); }