diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index 18eade05593c..415e85234276 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -455,6 +455,23 @@ NS_IMETHODIMP nsDocShell::SetParentURIContentListener(nsIURIContentListener* return mContentListener->SetParentContentListener(aParent); } +NS_IMETHODIMP nsDocShell::GetDocumentCharsetInfo(nsIDocumentCharsetInfo** + aDocumentCharsetInfo) +{ + NS_ENSURE_ARG_POINTER(aDocumentCharsetInfo); + + *aDocumentCharsetInfo = mDocumentCharsetInfo; + NS_IF_ADDREF(*aDocumentCharsetInfo); + return NS_OK; +} + +NS_IMETHODIMP nsDocShell::SetDocumentCharsetInfo(nsIDocumentCharsetInfo* + aDocumentCharsetInfo) +{ + mDocumentCharsetInfo = aDocumentCharsetInfo; + return NS_OK; +} + NS_IMETHODIMP nsDocShell::GetAllowPlugins(PRBool* aAllowPlugins) { NS_ENSURE_ARG_POINTER(aAllowPlugins); @@ -2287,7 +2304,7 @@ NS_IMETHODIMP nsDocShell::CreateFixupURI(const PRUnichar* aStringURI, // if no scheme (protocol) is found, assume http. if((colon=uriString.FindChar(':') == -1) ||// no colon at all ((fSlash > -1) && (colon > fSlash)) ||// the only colon comes after the first slash - ((colon < uriString.Length()-1) && // the first char after the first colon is a digit (i.e. a port) + ((colon < (((PRInt32)uriString.Length())-1)) && // the first char after the first colon is a digit (i.e. a port) ((port=uriString.CharAt(colon+1)) <= '9') && (port > '0'))) { // find host name diff --git a/docshell/base/nsDocShell.h b/docshell/base/nsDocShell.h index 7fb67b8a3979..48644a41c0a3 100644 --- a/docshell/base/nsDocShell.h +++ b/docshell/base/nsDocShell.h @@ -55,6 +55,7 @@ #include "nsDSWebProgressListener.h" // Interfaces Needed +#include "nsIDocumentCharsetInfo.h" #include "nsISupportsArray.h" #include "nsISHistory.h" #include "nsIWebNavigation.h" @@ -211,6 +212,7 @@ protected: nsDSWebProgressListener* mWebProgressListener; nsDocShellInitInfo* mInitInfo; nsCOMPtr mContentViewer; + nsCOMPtr mDocumentCharsetInfo; nsCOMPtr mDeviceContext; nsCOMPtrmDocLoader; nsCOMPtr mDocLoaderObserver; diff --git a/docshell/base/nsIDocShell.idl b/docshell/base/nsIDocShell.idl index 9f6070e28d0d..461ab50a6598 100644 --- a/docshell/base/nsIDocShell.idl +++ b/docshell/base/nsIDocShell.idl @@ -43,6 +43,7 @@ interface nsIChromeEventHandler; interface nsIDocumentLoaderObserver; interface nsIDocShellLoadInfo; +interface nsIDocumentCharsetInfo; [scriptable, uuid(69E5DE00-7B8B-11d3-AF61-00A024FFC08C)] interface nsIDocShell : nsISupports @@ -121,6 +122,12 @@ interface nsIDocShell : nsISupports */ attribute nsIURIContentListener parentURIContentListener; + /* + The document charset info. This is used by a load to determine priorities for + charset detection etc. + */ + attribute nsIDocumentCharsetInfo documentCharsetInfo; + /* Attribute stating if it should allow plugins or not. */