Added an attribute for holding the charset info to be used during a load.

This commit is contained in:
tbogard%aol.net 2000-04-12 00:07:04 +00:00
parent 77f8a8b6ac
commit fea7ec5577
3 changed files with 27 additions and 1 deletions

View File

@ -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

View File

@ -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<nsIContentViewer> mContentViewer;
nsCOMPtr<nsIDocumentCharsetInfo> mDocumentCharsetInfo;
nsCOMPtr<nsIDeviceContext> mDeviceContext;
nsCOMPtr<nsIDocumentLoader>mDocLoader;
nsCOMPtr<nsIDocumentLoaderObserver> mDocLoaderObserver;

View File

@ -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.
*/