diff --git a/dom/base/nsINode.h b/dom/base/nsINode.h index f8b318687e62..4643275eb351 100644 --- a/dom/base/nsINode.h +++ b/dom/base/nsINode.h @@ -597,15 +597,13 @@ class nsINode : public mozilla::dom::EventTarget { * * For all other cases OwnerDoc and GetOwnerDocument behave identically. */ - Document* OwnerDoc() const MOZ_NONNULL_RETURN { - return mNodeInfo->GetDocument(); - } + Document* OwnerDoc() const { return mNodeInfo->GetDocument(); } /** * Return the "owner document" of this node as an nsINode*. Implemented * in Document.h. */ - inline nsINode* OwnerDocAsNode() const MOZ_NONNULL_RETURN; + inline nsINode* OwnerDocAsNode() const; /** * Returns true if the content has an ancestor that is a document. diff --git a/dom/html/HTMLMediaElement.cpp b/dom/html/HTMLMediaElement.cpp index 93c352459ac3..d0aee56067ae 100644 --- a/dom/html/HTMLMediaElement.cpp +++ b/dom/html/HTMLMediaElement.cpp @@ -2175,7 +2175,7 @@ void HTMLMediaElement::Load() { HasAttr(kNameSpaceID_None, nsGkAtoms::autoplay), AutoplayPolicy::IsAllowedToPlay(*this), OwnerDoc(), DocumentOrigin(OwnerDoc()).get(), - OwnerDoc()->HasBeenUserGestureActivated(), mMuted, + OwnerDoc() ? OwnerDoc()->HasBeenUserGestureActivated() : 0, mMuted, mVolume)); if (mIsRunningLoadMethod) { diff --git a/dom/plugins/base/nsPluginInstanceOwner.cpp b/dom/plugins/base/nsPluginInstanceOwner.cpp index b1130f9de832..b46e9ab4f038 100644 --- a/dom/plugins/base/nsPluginInstanceOwner.cpp +++ b/dom/plugins/base/nsPluginInstanceOwner.cpp @@ -3163,7 +3163,7 @@ void nsPluginInstanceOwner::SetFrame(nsPluginFrame* aFrame) { // If we already have a frame that is changing or going away... if (mPluginFrame) { - if (content && content->OwnerDoc()->GetWindow()) { + if (content && content->OwnerDoc() && content->OwnerDoc()->GetWindow()) { nsCOMPtr windowRoot = content->OwnerDoc()->GetWindow()->GetTopWindowRoot(); if (windowRoot) {