Commit 34b6c94a authored by Norisz Fay's avatar Norisz Fay
Browse files

Backed out changeset 6fa00ccfe7e0 (bug 1816287) for causing bustages on...

Backed out changeset 6fa00ccfe7e0 (bug 1816287) for causing bustages on LocationBase.cpp CLOSED TREE
parent 052ecb6f
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
@@ -10186,7 +10186,11 @@ nsresult nsDocShell::DoURILoad(nsDocShellLoadState* aLoadState,

    if (StaticPrefs::dom_block_external_protocol_in_iframes()) {
      // Only allow URLs able to return data in iframes.
      if (nsContentUtils::IsExternalProtocol(aLoadState->URI())) {
      bool doesNotReturnData = false;
      NS_URIChainHasFlags(aLoadState->URI(),
                          nsIProtocolHandler::URI_DOES_NOT_RETURN_DATA,
                          &doesNotReturnData);
      if (doesNotReturnData) {
        // The context to check user-interaction with for the purposes of
        // popup-blocking.
        //
@@ -12847,11 +12851,6 @@ nsresult nsDocShell::OnLinkClick(
    return NS_OK;
  }

  Document* ownerDoc = aContent->OwnerDoc();
  if (nsContentUtils::IsExternalProtocol(aURI)) {
    ownerDoc->EnsureNotEnteringAndExitFullscreen();
  }

  bool noOpenerImplied = false;
  nsAutoString target(aTargetSpec);
  if (aFileName.IsVoid() &&
+0 −7
Original line number Diff line number Diff line
@@ -3959,13 +3959,6 @@ nsresult Document::InitFeaturePolicy(nsIChannel* aChannel) {
  return NS_OK;
}
void Document::EnsureNotEnteringAndExitFullscreen() {
  Document::ClearPendingFullscreenRequests(this);
  if (GetFullscreenElement()) {
    Document::AsyncExitFullscreen(this);
  }
}
void Document::SetReferrerInfo(nsIReferrerInfo* aReferrerInfo) {
  mReferrerInfo = aReferrerInfo;
  mCachedReferrerInfoForInternalCSSAndSVGResources = nullptr;
+0 −2
Original line number Diff line number Diff line
@@ -1549,8 +1549,6 @@ class Document : public nsINode,
  void InitFeaturePolicy();
  nsresult InitFeaturePolicy(nsIChannel* aChannel);

  void EnsureNotEnteringAndExitFullscreen();

 protected:
  friend class nsUnblockOnloadEvent;

+0 −5
Original line number Diff line number Diff line
@@ -175,11 +175,6 @@ void LocationBase::SetURI(nsIURI* aURI, nsIPrincipal& aSubjectPrincipal,
    }
    aRv.Throw(rv);
  }

  Document* doc = bc->GetDocument();
  if (doc && nsContentUtils::IsExternalProtocol(aURI)) {
    doc->EnsureNotEnteringAndExitFullscreen();
  }
}

void LocationBase::SetHref(const nsAString& aHref,
+0 −7
Original line number Diff line number Diff line
@@ -957,13 +957,6 @@ mozilla::EventClassID nsContentUtils::GetEventClassIDFromMessage(
  }
}

bool nsContentUtils::IsExternalProtocol(nsIURI* aURI) {
  bool doesNotReturnData = false;
  nsresult rv = NS_URIChainHasFlags(
      aURI, nsIProtocolHandler::URI_DOES_NOT_RETURN_DATA, &doesNotReturnData);
  return NS_SUCCEEDED(rv) && doesNotReturnData;
}

static nsAtom* GetEventTypeFromMessage(EventMessage aEventMessage) {
  switch (aEventMessage) {
#define MESSAGE_TO_EVENT(name_, message_, type_, struct_) \
Loading