diff --git a/docshell/base/nsWebShell.cpp b/docshell/base/nsWebShell.cpp index 01e098de2922..c687f1056d00 100644 --- a/docshell/base/nsWebShell.cpp +++ b/docshell/base/nsWebShell.cpp @@ -133,6 +133,11 @@ public: NS_IMETHOD SetTitle(const nsString& aTitle); NS_IMETHOD GetTitle(nsString& aResult); + NS_IMETHOD GetMarginWidth (PRInt32& aWidth); + NS_IMETHOD SetMarginWidth (PRInt32 aWidth); + NS_IMETHOD GetMarginHeight(PRInt32& aWidth); + NS_IMETHOD SetMarginHeight(PRInt32 aHeight); + // nsIWebShellContainer NS_IMETHOD WillLoadURL(nsIWebShell* aShell, const nsString& aURL); NS_IMETHOD BeginLoadURL(nsIWebShell* aShell, const nsString& aURL); @@ -192,6 +197,8 @@ protected: nsString mOverTarget; nsScrollPreference mScrollPref; + PRInt32 mMarginWidth; + PRInt32 mMarginHeight; void ReleaseChildren(); @@ -262,6 +269,8 @@ nsWebShell::nsWebShell() mScrollPref = nsScrollPreference_kAuto; mScriptGlobal = nsnull; mScriptContext = nsnull; + mMarginWidth = -1; + mMarginHeight = -1; } nsWebShell::~nsWebShell() @@ -776,6 +785,34 @@ nsWebShell::FindChildWithName(const nsString& aName, return NS_OK; } +NS_IMETHODIMP +nsWebShell::GetMarginWidth(PRInt32& aWidth) +{ + aWidth = mMarginWidth; + return NS_OK; +} + +NS_IMETHODIMP +nsWebShell::SetMarginWidth(PRInt32 aWidth) +{ + mMarginWidth = aWidth; + return NS_OK; +} + +NS_IMETHODIMP +nsWebShell::GetMarginHeight(PRInt32& aHeight) +{ + aHeight = mMarginHeight; + return NS_OK; +} + +NS_IMETHODIMP +nsWebShell::SetMarginHeight(PRInt32 aHeight) +{ + mMarginHeight = aHeight; + return NS_OK; +} + //---------------------------------------- // History methods diff --git a/layout/html/document/src/nsHTMLFrame.cpp b/layout/html/document/src/nsHTMLFrame.cpp index 439956f3ce8a..b7cd9a8b2bd2 100644 --- a/layout/html/document/src/nsHTMLFrame.cpp +++ b/layout/html/document/src/nsHTMLFrame.cpp @@ -198,10 +198,15 @@ public: PRBool IsInline() { return mInline; } virtual void SetAttribute(nsIAtom* aAttribute, const nsString& aValue); + PRInt32 GetMarginWidth(nsIPresContext* aPresContext); + PRInt32 GetMarginHeight(nsIPresContext* aPresContext); + protected: nsHTMLFrame(nsIAtom* aTag, PRBool aInline, nsIWebShell* aParentWebWidget); virtual ~nsHTMLFrame(); + PRInt32 GetMargin(nsIAtom* aType, nsIPresContext* aPresContext); + PRBool mInline; // true for