diff --git a/intl/chardet/src/nsMetaCharsetObserver.cpp b/intl/chardet/src/nsMetaCharsetObserver.cpp index 8e195c5412a..80e921a094d 100644 --- a/intl/chardet/src/nsMetaCharsetObserver.cpp +++ b/intl/chardet/src/nsMetaCharsetObserver.cpp @@ -176,6 +176,8 @@ NS_IMETHODIMP nsMetaCharsetObserver::Notify( nsresult res = NS_OK; PRUint32 i; + char command[256]; + command[0]='\0'; // Only process if we get the HTTP-EQUIV=Content-Type in meta // We totaly need 4 attributes @@ -183,6 +185,7 @@ NS_IMETHODIMP nsMetaCharsetObserver::Notify( // CONTENT // currentCharset - pseudo attribute fake by parser // currentCharsetSource - pseudo attribute fake by parser + // X_COMMAND - pseudo attribute fake by parser if((numOfAttributes >= 4) && (0 == nsCRT::strcasecmp(nameArray[0], "HTTP-EQUIV")) && @@ -206,6 +209,9 @@ NS_IMETHODIMP nsMetaCharsetObserver::Notify( } else if(0==nsCRT::strcmp(nameArray[i], "charsetSource")) { bGotCharsetSource = PR_TRUE; charsetSourceStr = valueArray[i]; + } else if(0==nsCRT::strcmp(nameArray[i], "X_COMMAND")) { + nsAutoString tmp(valueArray[i]); + tmp.ToCString(command, 256); } } @@ -269,7 +275,8 @@ NS_IMETHODIMP nsMetaCharsetObserver::Notify( { const char* charsetInCStr = preferred.ToNewCString(); if(nsnull != charsetInCStr) { - res = NotifyWebShell(aDocumentID, charsetInCStr, kCharsetFromMetaTag ); + res = NotifyWebShell(aDocumentID, charsetInCStr, kCharsetFromMetaTag , + command[0]?command:nsnull); delete [] (char*)charsetInCStr; return res; } diff --git a/intl/chardet/src/nsObserverBase.cpp b/intl/chardet/src/nsObserverBase.cpp index a9cc70a1e20..39c1fa52a9b 100644 --- a/intl/chardet/src/nsObserverBase.cpp +++ b/intl/chardet/src/nsObserverBase.cpp @@ -32,7 +32,8 @@ static NS_DEFINE_IID(kIWebShellServicesIID, NS_IWEB_SHELL_SERVICES_IID); //------------------------------------------------------------------------- NS_IMETHODIMP nsObserverBase::NotifyWebShell( - PRUint32 aDocumentID, const char* charset, nsCharsetSource source) + PRUint32 aDocumentID, const char* charset, nsCharsetSource source, + const char* aCmd) { nsresult res = NS_OK; nsresult rv = NS_OK; @@ -75,7 +76,7 @@ NS_IMETHODIMP nsObserverBase::NotifyWebShell( goto done; } - if(NS_FAILED(rv = wss->ReloadDocument(charset, source))) { + if(NS_FAILED(rv = wss->ReloadDocument(charset, source, aCmd))) { rv = wss->SetRendering(PR_TRUE); // turn on the rendering so at least we will see something. goto done; } diff --git a/intl/chardet/src/nsObserverBase.h b/intl/chardet/src/nsObserverBase.h index 40d336568f6..902365df060 100644 --- a/intl/chardet/src/nsObserverBase.h +++ b/intl/chardet/src/nsObserverBase.h @@ -42,7 +42,10 @@ public: */ protected: - NS_IMETHOD NotifyWebShell(PRUint32 aDocumentID, const char* charset, nsCharsetSource source); + NS_IMETHOD NotifyWebShell(PRUint32 aDocumentID, + const char* charset, + nsCharsetSource source, + const char* aCmd = nsnull); };