Web shells now know about their enclosed chrome shell.

This commit is contained in:
hyatt%netscape.com 1999-05-27 21:05:27 +00:00
Родитель d2c9f8ec14
Коммит 22f73eb107
3 изменённых файлов: 54 добавлений и 16 удалений

Просмотреть файл

@ -180,15 +180,10 @@ public:
NS_IMETHOD FindChildWithName(const PRUnichar* aName,
nsIWebShell*& aResult);
/**
* Set the type of the webshell to be content or chrome.
*/
NS_IMETHOD SetWebShellType(nsWebShellType aWebShellType);
/**
* Get the type of the webshell. Indicates whether the webshell is content or chrome.
*/
NS_IMETHOD GetWebShellType(nsWebShellType& aWebShellType);
NS_IMETHOD GetWebShellType(nsWebShellType& aWebShellType);
NS_IMETHOD GetContainingChromeShell(nsIWebShell** aResult);
NS_IMETHOD SetContainingChromeShell(nsIWebShell* aChromeShell);
NS_IMETHOD GetMarginWidth (PRInt32& aWidth);
NS_IMETHOD SetMarginWidth (PRInt32 aWidth);
@ -400,6 +395,7 @@ protected:
nsVoidArray mRefreshments;
nsWebShellType mWebShellType;
nsIWebShell* mChromeShell; // Weak reference.
void ReleaseChildren();
void DestroyChildren();
@ -531,6 +527,8 @@ nsWebShell::nsWebShell()
InitFrameData(PR_TRUE);
mIsFrame = PR_FALSE;
mWebShellType = nsWebShellContent;
mChromeShell = nsnull;
// XXX we should get such mDefaultCharacterSet from pref laster...
mDefaultCharacterSet = "ISO-8859-1";
mProcessedEndDocumentLoad = PR_FALSE;
@ -1361,6 +1359,22 @@ nsWebShell::SetWebShellType(nsWebShellType aWebShellType)
return NS_OK;
}
NS_IMETHODIMP
nsWebShell::GetContainingChromeShell(nsIWebShell** aResult)
{
NS_IF_ADDREF(mChromeShell);
*aResult = mChromeShell;
return NS_OK;
}
NS_IMETHODIMP
nsWebShell::SetContainingChromeShell(nsIWebShell* aChromeShell)
{
// Weak reference. Don't addref.
mChromeShell = aChromeShell;
return NS_OK;
}
NS_IMETHODIMP
nsWebShell::GetMarginWidth(PRInt32& aWidth)
{

Просмотреть файл

@ -307,6 +307,16 @@ public:
*/
NS_IMETHOD GetWebShellType(nsWebShellType& aWebShellType) = 0;
/**
* Get the nearest enclosing chrome shell.
*/
NS_IMETHOD GetContainingChromeShell(nsIWebShell** aResult) = 0;
/**
* Set the nearest enclosing chrome shell.
*/
NS_IMETHOD SetContainingChromeShell(nsIWebShell* aChromeShell) = 0;
//
// Document load api's
//

Просмотреть файл

@ -180,15 +180,10 @@ public:
NS_IMETHOD FindChildWithName(const PRUnichar* aName,
nsIWebShell*& aResult);
/**
* Set the type of the webshell to be content or chrome.
*/
NS_IMETHOD SetWebShellType(nsWebShellType aWebShellType);
/**
* Get the type of the webshell. Indicates whether the webshell is content or chrome.
*/
NS_IMETHOD GetWebShellType(nsWebShellType& aWebShellType);
NS_IMETHOD GetWebShellType(nsWebShellType& aWebShellType);
NS_IMETHOD GetContainingChromeShell(nsIWebShell** aResult);
NS_IMETHOD SetContainingChromeShell(nsIWebShell* aChromeShell);
NS_IMETHOD GetMarginWidth (PRInt32& aWidth);
NS_IMETHOD SetMarginWidth (PRInt32 aWidth);
@ -400,6 +395,7 @@ protected:
nsVoidArray mRefreshments;
nsWebShellType mWebShellType;
nsIWebShell* mChromeShell; // Weak reference.
void ReleaseChildren();
void DestroyChildren();
@ -531,6 +527,8 @@ nsWebShell::nsWebShell()
InitFrameData(PR_TRUE);
mIsFrame = PR_FALSE;
mWebShellType = nsWebShellContent;
mChromeShell = nsnull;
// XXX we should get such mDefaultCharacterSet from pref laster...
mDefaultCharacterSet = "ISO-8859-1";
mProcessedEndDocumentLoad = PR_FALSE;
@ -1361,6 +1359,22 @@ nsWebShell::SetWebShellType(nsWebShellType aWebShellType)
return NS_OK;
}
NS_IMETHODIMP
nsWebShell::GetContainingChromeShell(nsIWebShell** aResult)
{
NS_IF_ADDREF(mChromeShell);
*aResult = mChromeShell;
return NS_OK;
}
NS_IMETHODIMP
nsWebShell::SetContainingChromeShell(nsIWebShell* aChromeShell)
{
// Weak reference. Don't addref.
mChromeShell = aChromeShell;
return NS_OK;
}
NS_IMETHODIMP
nsWebShell::GetMarginWidth(PRInt32& aWidth)
{