From 6997c3326fc925d06ea8a7127bff837aa60f4327 Mon Sep 17 00:00:00 2001 From: Moonchild Date: Thu, 13 Jan 2022 18:51:05 +0000 Subject: [DOM] Stop treating XSLT meta refresh as a special snowflake thing. It's just not healthy. It'll get delusions of self-importance and go rogue. Next thing you know it'll start identifying as other elements. --- dom/xslt/xslt/txMozillaXMLOutput.cpp | 37 ------------------------------------ dom/xslt/xslt/txMozillaXMLOutput.h | 2 -- 2 files changed, 39 deletions(-) (limited to 'dom/xslt') diff --git a/dom/xslt/xslt/txMozillaXMLOutput.cpp b/dom/xslt/xslt/txMozillaXMLOutput.cpp index 21b3c228f..16163eca8 100644 --- a/dom/xslt/xslt/txMozillaXMLOutput.cpp +++ b/dom/xslt/xslt/txMozillaXMLOutput.cpp @@ -236,19 +236,6 @@ txMozillaXMLOutput::endDocument(nsresult aResult) } } - if (!mRefreshString.IsEmpty()) { - nsPIDOMWindowOuter* win = mDocument->GetWindow(); - if (win) { - nsCOMPtr refURI = - do_QueryInterface(win->GetDocShell()); - if (refURI) { - refURI->SetupRefreshURIFromHeader(mDocument->GetDocBaseURI(), - mDocument->NodePrincipal(), - mRefreshString); - } - } - } - if (mNotifier) { mNotifier->OnTransformEnd(); } @@ -744,35 +731,11 @@ txMozillaXMLOutput::endHTMLElement(nsIContent* aElement) mCurrentNodeStack.RemoveObjectAt(last); mTableState = static_cast (NS_PTR_TO_INT32(mTableStateStack.pop())); - - return NS_OK; - } - else if (mCreatingNewDocument && aElement->IsHTMLElement(nsGkAtoms::meta)) { - // handle HTTP-EQUIV data - nsAutoString httpEquiv; - aElement->GetAttr(kNameSpaceID_None, nsGkAtoms::httpEquiv, httpEquiv); - if (!httpEquiv.IsEmpty()) { - nsAutoString value; - aElement->GetAttr(kNameSpaceID_None, nsGkAtoms::content, value); - if (!value.IsEmpty()) { - nsContentUtils::ASCIIToLower(httpEquiv); - nsCOMPtr header = NS_Atomize(httpEquiv); - processHTTPEquiv(header, value); - } - } } return NS_OK; } -void txMozillaXMLOutput::processHTTPEquiv(nsIAtom* aHeader, const nsString& aValue) -{ - // For now we only handle "refresh". There's a longer list in - // HTMLContentSink::ProcessHeaderData - if (aHeader == nsGkAtoms::refresh) - LossyCopyUTF16toASCII(aValue, mRefreshString); -} - nsresult txMozillaXMLOutput::createResultDocument(const nsSubstring& aName, int32_t aNsID, nsIDOMDocument* aSourceDocument, diff --git a/dom/xslt/xslt/txMozillaXMLOutput.h b/dom/xslt/xslt/txMozillaXMLOutput.h index acdf9bd02..f58dbb118 100644 --- a/dom/xslt/xslt/txMozillaXMLOutput.h +++ b/dom/xslt/xslt/txMozillaXMLOutput.h @@ -80,7 +80,6 @@ private: nsresult createTxWrapper(); nsresult startHTMLElement(nsIContent* aElement, bool aXHTML); nsresult endHTMLElement(nsIContent* aElement); - void processHTTPEquiv(nsIAtom* aHeader, const nsString& aValue); nsresult createHTMLElement(nsIAtom* aName, nsIContent** aResult); @@ -105,7 +104,6 @@ private: RefPtr mNotifier; uint32_t mTreeDepth, mBadChildLevel; - nsCString mRefreshString; txStack mTableStateStack; enum TableState { -- cgit v1.2.3