mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-05 22:05:40 +00:00
Bug 1556061 - Add IsTopContent and IsChrome helpers to BrowsingContext, r=farre
Differential Revision: https://phabricator.services.mozilla.com/D33332 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
de01a8cd7e
commit
aba7a5f8f3
@ -164,6 +164,9 @@ class BrowsingContext : public nsWrapperCache, public BrowsingContextBase {
|
||||
bool NameEquals(const nsAString& aName) { return mName.Equals(aName); }
|
||||
|
||||
bool IsContent() const { return mType == Type::Content; }
|
||||
bool IsChrome() const { return !IsContent(); }
|
||||
|
||||
bool IsTopContent() const { return IsContent() && !GetParent(); }
|
||||
|
||||
uint64_t Id() const { return mBrowsingContextId; }
|
||||
|
||||
|
@ -6030,7 +6030,7 @@ void Document::SetContainer(nsDocShell* aContainer) {
|
||||
|
||||
BrowsingContext* context = aContainer->GetBrowsingContext();
|
||||
if (context && context->IsContent()) {
|
||||
if (!context->GetParent()) {
|
||||
if (context->IsTopContent()) {
|
||||
SetIsTopLevelContentDocument(true);
|
||||
}
|
||||
SetIsContentDocument(true);
|
||||
|
@ -1921,8 +1921,8 @@ bool nsGlobalWindowInner::DialogsAreBeingAbused() {
|
||||
void nsGlobalWindowInner::FireFrameLoadEvent(bool aIsTrusted) {
|
||||
// If we're not in a content frame, or are at a BrowsingContext tree boundary,
|
||||
// such as the content-chrome boundary, don't fire the "load" event.
|
||||
if (!GetBrowsingContext()->GetParent() ||
|
||||
!GetBrowsingContext()->IsContent()) {
|
||||
if (GetBrowsingContext()->IsTopContent() ||
|
||||
GetBrowsingContext()->IsChrome()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user