diff --git a/mozilla/layout/xul/base/src/nsProgressMeterFrame.cpp b/mozilla/layout/xul/base/src/nsProgressMeterFrame.cpp index cabe9217f89..6ab395f702e 100644 --- a/mozilla/layout/xul/base/src/nsProgressMeterFrame.cpp +++ b/mozilla/layout/xul/base/src/nsProgressMeterFrame.cpp @@ -728,6 +728,40 @@ nsProgressMeterFrame::Redraw(nsIPresContext* aPresContext) Invalidate(rect, PR_TRUE); } + +NS_IMETHODIMP +nsProgressMeterFrame::GetAdditionalStyleContext(PRInt32 aIndex, + nsIStyleContext** aStyleContext) const +{ + NS_PRECONDITION(nsnull != aStyleContext, "null OUT parameter pointer"); + if (aIndex < 0) { + return NS_ERROR_INVALID_ARG; + } + *aStyleContext = nsnull; + switch (aIndex) { + case NS_PROGRESS_METER_STRIPE_CONTEXT_INDEX: + *aStyleContext = mBarStyle; + NS_ADDREF(*aStyleContext); + break; + } + return NS_OK; +} + +NS_IMETHODIMP +nsProgressMeterFrame::SetAdditionalStyleContext(PRInt32 aIndex, + nsIStyleContext* aStyleContext) +{ + if (aIndex < 0) { + return NS_ERROR_INVALID_ARG; + } + switch (aIndex) { + case NS_PROGRESS_METER_STRIPE_CONTEXT_INDEX: + mBarStyle = aStyleContext; + break; + } + return NS_OK; +} + // // RefreshStyleContext // diff --git a/mozilla/layout/xul/base/src/nsProgressMeterFrame.h b/mozilla/layout/xul/base/src/nsProgressMeterFrame.h index b3b3a232bb9..e618640ef62 100644 --- a/mozilla/layout/xul/base/src/nsProgressMeterFrame.h +++ b/mozilla/layout/xul/base/src/nsProgressMeterFrame.h @@ -51,6 +51,8 @@ class nsIPresContext; class nsIStyleContext; +#define NS_PROGRESS_METER_STRIPE_CONTEXT_INDEX 1 + class nsProgressMeterFrame : public nsLeafFrame { public: @@ -77,6 +79,10 @@ public: nsIAtom* aAttribute, PRInt32 aHint); + NS_IMETHOD GetAdditionalStyleContext(PRInt32 aIndex, + nsIStyleContext** aStyleContext) const; + NS_IMETHOD SetAdditionalStyleContext(PRInt32 aIndex, + nsIStyleContext* aStyleContext); NS_IMETHOD ReResolveStyleContext ( nsIPresContext* aPresContext, nsIStyleContext* aParentContext, PRInt32 aParentChange, diff --git a/mozilla/layout/xul/base/src/nsTitledButtonFrame.cpp b/mozilla/layout/xul/base/src/nsTitledButtonFrame.cpp index 6aa12819cfb..e1200f9cdc6 100644 --- a/mozilla/layout/xul/base/src/nsTitledButtonFrame.cpp +++ b/mozilla/layout/xul/base/src/nsTitledButtonFrame.cpp @@ -1172,6 +1172,20 @@ nsTitledButtonFrame :: CheckStateToString ( CheckState inState, nsString& outSta } // CheckStateToString +NS_IMETHODIMP +nsTitledButtonFrame::GetAdditionalStyleContext(PRInt32 aIndex, + nsIStyleContext** aStyleContext) const +{ + return mRenderer.GetStyleContext(aIndex, aStyleContext); +} + +NS_IMETHODIMP +nsTitledButtonFrame::SetAdditionalStyleContext(PRInt32 aIndex, + nsIStyleContext* aStyleContext) +{ + return mRenderer.SetStyleContext(aIndex, aStyleContext); +} + // // ReResolveStyleContext // diff --git a/mozilla/layout/xul/base/src/nsTitledButtonFrame.h b/mozilla/layout/xul/base/src/nsTitledButtonFrame.h index d55db249758..578824bd12c 100644 --- a/mozilla/layout/xul/base/src/nsTitledButtonFrame.h +++ b/mozilla/layout/xul/base/src/nsTitledButtonFrame.h @@ -51,6 +51,10 @@ public: nsIAtom* aAttribute, PRInt32 aHint); + NS_IMETHOD GetAdditionalStyleContext(PRInt32 aIndex, + nsIStyleContext** aStyleContext) const; + NS_IMETHOD SetAdditionalStyleContext(PRInt32 aIndex, + nsIStyleContext* aStyleContext); NS_IMETHOD ReResolveStyleContext ( nsIPresContext* aPresContext, nsIStyleContext* aParentContext, PRInt32 aParentChange, diff --git a/mozilla/layout/xul/base/src/nsToolboxFrame.cpp b/mozilla/layout/xul/base/src/nsToolboxFrame.cpp index 12a74a4f134..2eba6b8b34f 100644 --- a/mozilla/layout/xul/base/src/nsToolboxFrame.cpp +++ b/mozilla/layout/xul/base/src/nsToolboxFrame.cpp @@ -164,6 +164,46 @@ nsToolboxFrame :: RefreshStyleContext(nsIPresContext* aPresContext, } // RefreshStyleContext +NS_IMETHODIMP +nsToolboxFrame::GetAdditionalStyleContext(PRInt32 aIndex, + nsIStyleContext** aStyleContext) const +{ + NS_PRECONDITION(nsnull != aStyleContext, "null OUT parameter pointer"); + if (aIndex < 0) { + return NS_ERROR_INVALID_ARG; + } + *aStyleContext = nsnull; + switch (aIndex) { + case NS_TOOLBOX_GRIPPY_NORMAL_CONTEXT_INDEX: + *aStyleContext = mGrippyNormalStyle; + NS_ADDREF(*aStyleContext); + break; + case NS_TOOLBOX_GRIPPY_ROLLOVER_CONTEXT_INDEX: + *aStyleContext = mGrippyRolloverStyle; + NS_ADDREF(*aStyleContext); + break; + } + return NS_OK; +} + +NS_IMETHODIMP +nsToolboxFrame::SetAdditionalStyleContext(PRInt32 aIndex, + nsIStyleContext* aStyleContext) +{ + if (aIndex < 0) { + return NS_ERROR_INVALID_ARG; + } + switch (aIndex) { + case NS_TOOLBOX_GRIPPY_NORMAL_CONTEXT_INDEX: + mGrippyNormalStyle = aStyleContext; + break; + case NS_TOOLBOX_GRIPPY_ROLLOVER_CONTEXT_INDEX: + mGrippyRolloverStyle = aStyleContext; + break; + } + return NS_OK; +} + // // ReResolveStyleContext // diff --git a/mozilla/layout/xul/base/src/nsToolboxFrame.h b/mozilla/layout/xul/base/src/nsToolboxFrame.h index a5df092ab48..39bd89bacd9 100644 --- a/mozilla/layout/xul/base/src/nsToolboxFrame.h +++ b/mozilla/layout/xul/base/src/nsToolboxFrame.h @@ -47,6 +47,8 @@ #include "nsCOMPtr.h" #include "nsBoxFrame.h" +#define NS_TOOLBOX_GRIPPY_NORMAL_CONTEXT_INDEX 0 +#define NS_TOOLBOX_GRIPPY_ROLLOVER_CONTEXT_INDEX 1 class nsToolboxFrame : public nsBoxFrame { @@ -75,6 +77,10 @@ public: nsIStyleContext* aContext, nsIFrame* aPrevInFlow); + NS_IMETHOD GetAdditionalStyleContext(PRInt32 aIndex, + nsIStyleContext** aStyleContext) const; + NS_IMETHOD SetAdditionalStyleContext(PRInt32 aIndex, + nsIStyleContext* aStyleContext); NS_IMETHOD ReResolveStyleContext ( nsIPresContext* aPresContext, nsIStyleContext* aParentContext, PRInt32 aParentChange,