Commit d6a364be authored by Peter Van der Beken's avatar Peter Van der Beken
Browse files

Bug 1749935 - Remove GetDTD. r=hsivonen

parent 470c69ad
Loading
Loading
Loading
Loading
+11 −15
Original line number Diff line number Diff line
@@ -199,11 +199,9 @@ txStylesheetSink::OnDataAvailable(nsIRequest* aRequest,
                                  nsIInputStream* aInputStream,
                                  uint64_t aOffset, uint32_t aCount) {
  if (!mCheckedForXML) {
    nsCOMPtr<nsIDTD> dtd;
    mParser->GetDTD(getter_AddRefs(dtd));
    if (dtd) {
      mCheckedForXML = true;
      if (!(dtd->GetType() & NS_IPARSER_FLAG_XML)) {
    Maybe<bool> isForXML = mParser->IsForParsingXML();
    mCheckedForXML = isForXML.isSome();
    if (mCheckedForXML && !isForXML.value()) {
      nsCOMPtr<nsIChannel> channel = do_QueryInterface(aRequest);
      nsAutoString spec;
      getSpec(channel, spec);
@@ -212,7 +210,6 @@ txStylesheetSink::OnDataAvailable(nsIRequest* aRequest,
      return NS_ERROR_XSLT_WRONG_MIME_TYPE;
    }
  }
  }

  return mListener->OnDataAvailable(aRequest, aInputStream, aOffset, aCount);
}
@@ -281,9 +278,8 @@ txStylesheetSink::OnStopRequest(nsIRequest* aRequest, nsresult aStatusCode) {
    //     nsIHTMLContentSink.
    result = NS_ERROR_XSLT_NETWORK_ERROR;
  } else if (!mCheckedForXML) {
    nsCOMPtr<nsIDTD> dtd;
    mParser->GetDTD(getter_AddRefs(dtd));
    if (dtd && !(dtd->GetType() & NS_IPARSER_FLAG_XML)) {
    Maybe<bool> isForXML = mParser->IsForParsingXML();
    if (isForXML.isSome() && !isForXML.value()) {
      result = NS_ERROR_XSLT_WRONG_MIME_TYPE;
    }
  }
+0 −6
Original line number Diff line number Diff line
@@ -112,12 +112,6 @@ nsresult nsHtml5Parser::GetChannel(nsIChannel** aChannel) {
  }
}

NS_IMETHODIMP
nsHtml5Parser::GetDTD(nsIDTD** aDTD) {
  *aDTD = nullptr;
  return NS_OK;
}

nsIStreamListener* nsHtml5Parser::GetStreamListener() {
  return mStreamListener;
}
+0 −5
Original line number Diff line number Diff line
@@ -75,11 +75,6 @@ class nsHtml5Parser final : public nsIParser, public nsSupportsWeakReference {
   */
  nsresult GetChannel(nsIChannel** aChannel);

  /**
   * Return |this| for backwards compat.
   */
  NS_IMETHOD GetDTD(nsIDTD** aDTD) override;

  /**
   * Get the stream parser for this parser
   */
+0 −3
Original line number Diff line number Diff line
@@ -42,6 +42,3 @@ void CNavDTD::DidBuildModel() {}

NS_IMETHODIMP_(void)
CNavDTD::Terminate() {}

NS_IMETHODIMP_(int32_t)
CNavDTD::GetType() { return NS_IPARSER_FLAG_HTML; }
+0 −3
Original line number Diff line number Diff line
@@ -1627,9 +1627,6 @@ nsExpatDriver::Terminate() {
  mInternalState = NS_ERROR_HTMLPARSER_STOPPARSING;
}

NS_IMETHODIMP_(int32_t)
nsExpatDriver::GetType() { return NS_IPARSER_FLAG_XML; }

/*************************** Unused methods **********************************/

void nsExpatDriver::MaybeStopParser(nsresult aState) {
Loading