зеркало из https://github.com/mozilla/gecko-dev.git
Ensure that text inputs, checkboxes and radios paint over inline element backgrounds that are behind them. Fix a few build warnings. b=107244 r=rods sr=waterson
This commit is contained in:
Родитель
8f2221a14c
Коммит
daeed9f51f
|
@ -413,17 +413,57 @@ nsFormControlFrame::Paint(nsIPresContext* aPresContext,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult rv = nsLeafFrame::Paint(aPresContext, aRenderingContext, aDirtyRect,
|
||||
aWhichLayer);
|
||||
nsresult rv = NS_OK;
|
||||
if (aWhichLayer == NS_FRAME_PAINT_LAYER_FOREGROUND) {
|
||||
rv = nsLeafFrame::Paint(aPresContext, aRenderingContext, aDirtyRect,
|
||||
NS_FRAME_PAINT_LAYER_BACKGROUND);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
// draw selection borders when appropriate
|
||||
rv = nsFrame::Paint(aPresContext, aRenderingContext, aDirtyRect,
|
||||
NS_FRAME_PAINT_LAYER_BACKGROUND);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
if (NS_FRAME_PAINT_LAYER_BACKGROUND == aWhichLayer)
|
||||
{
|
||||
nsRect rect(0, 0, mRect.width, mRect.height);
|
||||
PaintSpecialBorder(aPresContext,
|
||||
aRenderingContext,
|
||||
this,
|
||||
aDirtyRect,
|
||||
rect);
|
||||
rv = nsLeafFrame::Paint(aPresContext, aRenderingContext, aDirtyRect,
|
||||
NS_FRAME_PAINT_LAYER_FLOATERS);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
// draw selection borders when appropriate
|
||||
rv = nsFrame::Paint(aPresContext, aRenderingContext, aDirtyRect,
|
||||
NS_FRAME_PAINT_LAYER_FLOATERS);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
rv = nsLeafFrame::Paint(aPresContext, aRenderingContext, aDirtyRect,
|
||||
NS_FRAME_PAINT_LAYER_FOREGROUND);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
// draw selection borders when appropriate
|
||||
rv = nsFrame::Paint(aPresContext, aRenderingContext, aDirtyRect,
|
||||
NS_FRAME_PAINT_LAYER_FOREGROUND);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsFormControlFrame::GetFrameForPoint(nsIPresContext* aPresContext,
|
||||
const nsPoint& aPoint,
|
||||
nsFramePaintLayer aWhichLayer,
|
||||
nsIFrame** aFrame)
|
||||
{
|
||||
nsresult rv = NS_ERROR_FAILURE;
|
||||
if (aWhichLayer == NS_FRAME_PAINT_LAYER_FOREGROUND) {
|
||||
rv = nsLeafFrame::GetFrameForPoint(aPresContext, aPoint,
|
||||
NS_FRAME_PAINT_LAYER_FOREGROUND, aFrame);
|
||||
if (NS_SUCCEEDED(rv))
|
||||
return NS_OK;
|
||||
rv = nsLeafFrame::GetFrameForPoint(aPresContext, aPoint,
|
||||
NS_FRAME_PAINT_LAYER_FLOATERS, aFrame);
|
||||
if (NS_SUCCEEDED(rv))
|
||||
return NS_OK;
|
||||
rv = nsLeafFrame::GetFrameForPoint(aPresContext, aPoint,
|
||||
NS_FRAME_PAINT_LAYER_BACKGROUND, aFrame);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
@ -888,47 +928,6 @@ nsFormControlFrame::SetSuggestedSize(nscoord aWidth, nscoord aHeight)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// static
|
||||
nsresult nsFormControlFrame::PaintSpecialBorder(nsIPresContext* aPresContext,
|
||||
nsIRenderingContext& aRenderingContext,
|
||||
nsIFrame *aFrame,
|
||||
const nsRect& aDirtyRect,
|
||||
const nsRect& aRect)
|
||||
{
|
||||
NS_ASSERTION( aPresContext, "PresContext cannot be null");
|
||||
NS_ASSERTION( aFrame, "Frame cannot be null");
|
||||
|
||||
nsresult rv=NS_OK;
|
||||
#if 0
|
||||
if(aPresContext && aFrame){
|
||||
// first probe for the pseudo-style context for the frame
|
||||
|
||||
nsCOMPtr<nsIContent> content;
|
||||
aFrame->GetContent(getter_AddRefs(content));
|
||||
nsCOMPtr<nsIStyleContext> context;
|
||||
aFrame->GetStyleContext(getter_AddRefs(context));
|
||||
nsCOMPtr<nsIStyleContext> specialBorderStyle;
|
||||
|
||||
// style for the inner such as a dotted line (Windows)
|
||||
aPresContext->ProbePseudoStyleContextFor(content, nsHTMLAtoms::mozControlSpecialBorderPseudo, context,
|
||||
PR_FALSE,
|
||||
getter_AddRefs(specialBorderStyle));
|
||||
if (specialBorderStyle){
|
||||
// paint the border
|
||||
|
||||
const nsStyleBorder* border = (const nsStyleBorder*)specialBorderStyle ->GetStyleData(eStyleStruct_Border);
|
||||
nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, aFrame,
|
||||
aDirtyRect, aRect, *border, specialBorderStyle, 0);
|
||||
}
|
||||
|
||||
} else {
|
||||
rv = NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
#endif
|
||||
return rv;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsFormControlFrame::GetScreenHeight(nsIPresContext* aPresContext, nscoord& aHeight)
|
||||
{
|
||||
|
|
|
@ -117,6 +117,11 @@ public:
|
|||
nsFramePaintLayer aWhichLayer,
|
||||
PRUint32 aFlags = 0);
|
||||
|
||||
NS_IMETHOD GetFrameForPoint(nsIPresContext* aPresContext,
|
||||
const nsPoint& aPoint,
|
||||
nsFramePaintLayer aWhichLayer,
|
||||
nsIFrame** aFrame);
|
||||
|
||||
NS_IMETHOD SetInitialChildList(nsIPresContext* aPresContext,
|
||||
nsIAtom* aListName,
|
||||
nsIFrame* aChildList);
|
||||
|
@ -231,22 +236,6 @@ public:
|
|||
// AccessKey Helper function
|
||||
static nsresult RegUnRegAccessKey(nsIPresContext* aPresContext, nsIFrame * aFrame, PRBool aDoReg);
|
||||
|
||||
/**
|
||||
* Helper routine to allow controls to have focus border using pseudo-style rule
|
||||
* where focus has a border and non-focus does not. Call in Paint if you have the focus
|
||||
*
|
||||
* @param aPresContext
|
||||
* @param aRenderingContext
|
||||
* @param aFrame - the frame that we are painting
|
||||
* @param aDirtyRect - the dirty area
|
||||
* @param aRect - the area to paint within the dirty area
|
||||
*/
|
||||
static nsresult PaintSpecialBorder(nsIPresContext* aPresContext,
|
||||
nsIRenderingContext& aRenderingContext,
|
||||
nsIFrame *aFrame,
|
||||
const nsRect& aDirtyRect,
|
||||
const nsRect& aRect);
|
||||
|
||||
/**
|
||||
* Helper routine to that returns the height of the screen
|
||||
*
|
||||
|
|
|
@ -451,7 +451,6 @@ NS_IMETHODIMP nsGfxButtonControlFrame::GetAccessible(nsIAccessible** aAccessible
|
|||
nsCOMPtr<nsIAccessibilityService> accService = do_GetService("@mozilla.org/accessibilityService;1");
|
||||
|
||||
if (accService) {
|
||||
nsIAccessible* acc = nsnull;
|
||||
return accService->CreateHTMLButtonAccessible(NS_STATIC_CAST(nsIFrame*, this), aAccessible);
|
||||
}
|
||||
|
||||
|
|
|
@ -113,7 +113,6 @@ NS_IMETHODIMP nsGfxCheckboxControlFrame::GetAccessible(nsIAccessible** aAccessib
|
|||
nsCOMPtr<nsIAccessibilityService> accService = do_GetService("@mozilla.org/accessibilityService;1");
|
||||
|
||||
if (accService) {
|
||||
nsIAccessible* acc = nsnull;
|
||||
return accService->CreateHTMLCheckboxAccessible(NS_STATIC_CAST(nsIFrame*, this), aAccessible);
|
||||
}
|
||||
|
||||
|
@ -403,7 +402,7 @@ nsGfxCheckboxControlFrame::Paint(nsIPresContext* aPresContext,
|
|||
}
|
||||
|
||||
// Paint the background
|
||||
nsFormControlFrame::Paint(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer);
|
||||
nsresult rv = nsFormControlFrame::Paint(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer);
|
||||
if (NS_FRAME_PAINT_LAYER_FOREGROUND == aWhichLayer) {
|
||||
PRBool doDefaultPainting = PR_TRUE;
|
||||
// Paint the checkmark
|
||||
|
@ -436,9 +435,7 @@ nsGfxCheckboxControlFrame::Paint(nsIPresContext* aPresContext,
|
|||
PaintCheckBox(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer);
|
||||
}
|
||||
}
|
||||
|
||||
// Call to the base class to draw selection borders when appropriate
|
||||
return nsFrame::Paint(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer);
|
||||
return rv;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------
|
||||
|
|
|
@ -107,7 +107,6 @@ NS_IMETHODIMP nsGfxRadioControlFrame::GetAccessible(nsIAccessible** aAccessible)
|
|||
nsCOMPtr<nsIAccessibilityService> accService = do_GetService("@mozilla.org/accessibilityService;1");
|
||||
|
||||
if (accService) {
|
||||
nsIAccessible* acc = nsnull;
|
||||
return accService->CreateHTMLRadioButtonAccessible(NS_STATIC_CAST(nsIFrame*, this), aAccessible);
|
||||
}
|
||||
|
||||
|
@ -317,14 +316,12 @@ nsGfxRadioControlFrame::Paint(nsIPresContext* aPresContext,
|
|||
return NS_OK;
|
||||
}
|
||||
// Paint the background
|
||||
nsFormControlFrame::Paint(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer);
|
||||
nsresult rv = nsFormControlFrame::Paint(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer);
|
||||
|
||||
if (NS_FRAME_PAINT_LAYER_FOREGROUND == aWhichLayer) {
|
||||
PaintRadioButton(aPresContext, aRenderingContext, aDirtyRect);
|
||||
}
|
||||
|
||||
// Call to the base class to draw selection borders when appropriate
|
||||
return nsFrame::Paint(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer);
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -190,7 +190,6 @@ NS_IMETHODIMP nsHTMLButtonControlFrame::GetAccessible(nsIAccessible** aAccessibl
|
|||
nsCOMPtr<nsIAccessibilityService> accService = do_GetService("@mozilla.org/accessibilityService;1");
|
||||
|
||||
if (accService) {
|
||||
nsIAccessible* acc = nsnull;
|
||||
return accService->CreateHTML4ButtonAccessible(NS_STATIC_CAST(nsIFrame*, this), aAccessible);
|
||||
}
|
||||
|
||||
|
|
|
@ -237,7 +237,6 @@ NS_IMETHODIMP nsImageControlFrame::GetAccessible(nsIAccessible** aAccessible)
|
|||
nsCOMPtr<nsIAccessibilityService> accService = do_GetService("@mozilla.org/accessibilityService;1");
|
||||
|
||||
if (accService) {
|
||||
nsIAccessible* acc = nsnull;
|
||||
return accService->CreateHTML4ButtonAccessible(NS_STATIC_CAST(nsIFrame*, this), aAccessible);
|
||||
}
|
||||
|
||||
|
|
|
@ -810,7 +810,6 @@ NS_IMETHODIMP nsTextFrame::GetAccessible(nsIAccessible** aAccessible)
|
|||
nsCOMPtr<nsIAccessibilityService> accService = do_GetService("@mozilla.org/accessibilityService;1");
|
||||
|
||||
if (accService) {
|
||||
nsIAccessible* acc = nsnull;
|
||||
return accService->CreateHTMLTextAccessible(NS_STATIC_CAST(nsIFrame*, this), aAccessible);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -810,7 +810,6 @@ NS_IMETHODIMP nsTextFrame::GetAccessible(nsIAccessible** aAccessible)
|
|||
nsCOMPtr<nsIAccessibilityService> accService = do_GetService("@mozilla.org/accessibilityService;1");
|
||||
|
||||
if (accService) {
|
||||
nsIAccessible* acc = nsnull;
|
||||
return accService->CreateHTMLTextAccessible(NS_STATIC_CAST(nsIFrame*, this), aAccessible);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -413,17 +413,57 @@ nsFormControlFrame::Paint(nsIPresContext* aPresContext,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult rv = nsLeafFrame::Paint(aPresContext, aRenderingContext, aDirtyRect,
|
||||
aWhichLayer);
|
||||
nsresult rv = NS_OK;
|
||||
if (aWhichLayer == NS_FRAME_PAINT_LAYER_FOREGROUND) {
|
||||
rv = nsLeafFrame::Paint(aPresContext, aRenderingContext, aDirtyRect,
|
||||
NS_FRAME_PAINT_LAYER_BACKGROUND);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
// draw selection borders when appropriate
|
||||
rv = nsFrame::Paint(aPresContext, aRenderingContext, aDirtyRect,
|
||||
NS_FRAME_PAINT_LAYER_BACKGROUND);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
if (NS_FRAME_PAINT_LAYER_BACKGROUND == aWhichLayer)
|
||||
{
|
||||
nsRect rect(0, 0, mRect.width, mRect.height);
|
||||
PaintSpecialBorder(aPresContext,
|
||||
aRenderingContext,
|
||||
this,
|
||||
aDirtyRect,
|
||||
rect);
|
||||
rv = nsLeafFrame::Paint(aPresContext, aRenderingContext, aDirtyRect,
|
||||
NS_FRAME_PAINT_LAYER_FLOATERS);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
// draw selection borders when appropriate
|
||||
rv = nsFrame::Paint(aPresContext, aRenderingContext, aDirtyRect,
|
||||
NS_FRAME_PAINT_LAYER_FLOATERS);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
rv = nsLeafFrame::Paint(aPresContext, aRenderingContext, aDirtyRect,
|
||||
NS_FRAME_PAINT_LAYER_FOREGROUND);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
// draw selection borders when appropriate
|
||||
rv = nsFrame::Paint(aPresContext, aRenderingContext, aDirtyRect,
|
||||
NS_FRAME_PAINT_LAYER_FOREGROUND);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsFormControlFrame::GetFrameForPoint(nsIPresContext* aPresContext,
|
||||
const nsPoint& aPoint,
|
||||
nsFramePaintLayer aWhichLayer,
|
||||
nsIFrame** aFrame)
|
||||
{
|
||||
nsresult rv = NS_ERROR_FAILURE;
|
||||
if (aWhichLayer == NS_FRAME_PAINT_LAYER_FOREGROUND) {
|
||||
rv = nsLeafFrame::GetFrameForPoint(aPresContext, aPoint,
|
||||
NS_FRAME_PAINT_LAYER_FOREGROUND, aFrame);
|
||||
if (NS_SUCCEEDED(rv))
|
||||
return NS_OK;
|
||||
rv = nsLeafFrame::GetFrameForPoint(aPresContext, aPoint,
|
||||
NS_FRAME_PAINT_LAYER_FLOATERS, aFrame);
|
||||
if (NS_SUCCEEDED(rv))
|
||||
return NS_OK;
|
||||
rv = nsLeafFrame::GetFrameForPoint(aPresContext, aPoint,
|
||||
NS_FRAME_PAINT_LAYER_BACKGROUND, aFrame);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
@ -888,47 +928,6 @@ nsFormControlFrame::SetSuggestedSize(nscoord aWidth, nscoord aHeight)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// static
|
||||
nsresult nsFormControlFrame::PaintSpecialBorder(nsIPresContext* aPresContext,
|
||||
nsIRenderingContext& aRenderingContext,
|
||||
nsIFrame *aFrame,
|
||||
const nsRect& aDirtyRect,
|
||||
const nsRect& aRect)
|
||||
{
|
||||
NS_ASSERTION( aPresContext, "PresContext cannot be null");
|
||||
NS_ASSERTION( aFrame, "Frame cannot be null");
|
||||
|
||||
nsresult rv=NS_OK;
|
||||
#if 0
|
||||
if(aPresContext && aFrame){
|
||||
// first probe for the pseudo-style context for the frame
|
||||
|
||||
nsCOMPtr<nsIContent> content;
|
||||
aFrame->GetContent(getter_AddRefs(content));
|
||||
nsCOMPtr<nsIStyleContext> context;
|
||||
aFrame->GetStyleContext(getter_AddRefs(context));
|
||||
nsCOMPtr<nsIStyleContext> specialBorderStyle;
|
||||
|
||||
// style for the inner such as a dotted line (Windows)
|
||||
aPresContext->ProbePseudoStyleContextFor(content, nsHTMLAtoms::mozControlSpecialBorderPseudo, context,
|
||||
PR_FALSE,
|
||||
getter_AddRefs(specialBorderStyle));
|
||||
if (specialBorderStyle){
|
||||
// paint the border
|
||||
|
||||
const nsStyleBorder* border = (const nsStyleBorder*)specialBorderStyle ->GetStyleData(eStyleStruct_Border);
|
||||
nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, aFrame,
|
||||
aDirtyRect, aRect, *border, specialBorderStyle, 0);
|
||||
}
|
||||
|
||||
} else {
|
||||
rv = NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
#endif
|
||||
return rv;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsFormControlFrame::GetScreenHeight(nsIPresContext* aPresContext, nscoord& aHeight)
|
||||
{
|
||||
|
|
|
@ -117,6 +117,11 @@ public:
|
|||
nsFramePaintLayer aWhichLayer,
|
||||
PRUint32 aFlags = 0);
|
||||
|
||||
NS_IMETHOD GetFrameForPoint(nsIPresContext* aPresContext,
|
||||
const nsPoint& aPoint,
|
||||
nsFramePaintLayer aWhichLayer,
|
||||
nsIFrame** aFrame);
|
||||
|
||||
NS_IMETHOD SetInitialChildList(nsIPresContext* aPresContext,
|
||||
nsIAtom* aListName,
|
||||
nsIFrame* aChildList);
|
||||
|
@ -231,22 +236,6 @@ public:
|
|||
// AccessKey Helper function
|
||||
static nsresult RegUnRegAccessKey(nsIPresContext* aPresContext, nsIFrame * aFrame, PRBool aDoReg);
|
||||
|
||||
/**
|
||||
* Helper routine to allow controls to have focus border using pseudo-style rule
|
||||
* where focus has a border and non-focus does not. Call in Paint if you have the focus
|
||||
*
|
||||
* @param aPresContext
|
||||
* @param aRenderingContext
|
||||
* @param aFrame - the frame that we are painting
|
||||
* @param aDirtyRect - the dirty area
|
||||
* @param aRect - the area to paint within the dirty area
|
||||
*/
|
||||
static nsresult PaintSpecialBorder(nsIPresContext* aPresContext,
|
||||
nsIRenderingContext& aRenderingContext,
|
||||
nsIFrame *aFrame,
|
||||
const nsRect& aDirtyRect,
|
||||
const nsRect& aRect);
|
||||
|
||||
/**
|
||||
* Helper routine to that returns the height of the screen
|
||||
*
|
||||
|
|
|
@ -451,7 +451,6 @@ NS_IMETHODIMP nsGfxButtonControlFrame::GetAccessible(nsIAccessible** aAccessible
|
|||
nsCOMPtr<nsIAccessibilityService> accService = do_GetService("@mozilla.org/accessibilityService;1");
|
||||
|
||||
if (accService) {
|
||||
nsIAccessible* acc = nsnull;
|
||||
return accService->CreateHTMLButtonAccessible(NS_STATIC_CAST(nsIFrame*, this), aAccessible);
|
||||
}
|
||||
|
||||
|
|
|
@ -113,7 +113,6 @@ NS_IMETHODIMP nsGfxCheckboxControlFrame::GetAccessible(nsIAccessible** aAccessib
|
|||
nsCOMPtr<nsIAccessibilityService> accService = do_GetService("@mozilla.org/accessibilityService;1");
|
||||
|
||||
if (accService) {
|
||||
nsIAccessible* acc = nsnull;
|
||||
return accService->CreateHTMLCheckboxAccessible(NS_STATIC_CAST(nsIFrame*, this), aAccessible);
|
||||
}
|
||||
|
||||
|
@ -403,7 +402,7 @@ nsGfxCheckboxControlFrame::Paint(nsIPresContext* aPresContext,
|
|||
}
|
||||
|
||||
// Paint the background
|
||||
nsFormControlFrame::Paint(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer);
|
||||
nsresult rv = nsFormControlFrame::Paint(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer);
|
||||
if (NS_FRAME_PAINT_LAYER_FOREGROUND == aWhichLayer) {
|
||||
PRBool doDefaultPainting = PR_TRUE;
|
||||
// Paint the checkmark
|
||||
|
@ -436,9 +435,7 @@ nsGfxCheckboxControlFrame::Paint(nsIPresContext* aPresContext,
|
|||
PaintCheckBox(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer);
|
||||
}
|
||||
}
|
||||
|
||||
// Call to the base class to draw selection borders when appropriate
|
||||
return nsFrame::Paint(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer);
|
||||
return rv;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------
|
||||
|
|
|
@ -107,7 +107,6 @@ NS_IMETHODIMP nsGfxRadioControlFrame::GetAccessible(nsIAccessible** aAccessible)
|
|||
nsCOMPtr<nsIAccessibilityService> accService = do_GetService("@mozilla.org/accessibilityService;1");
|
||||
|
||||
if (accService) {
|
||||
nsIAccessible* acc = nsnull;
|
||||
return accService->CreateHTMLRadioButtonAccessible(NS_STATIC_CAST(nsIFrame*, this), aAccessible);
|
||||
}
|
||||
|
||||
|
@ -317,14 +316,12 @@ nsGfxRadioControlFrame::Paint(nsIPresContext* aPresContext,
|
|||
return NS_OK;
|
||||
}
|
||||
// Paint the background
|
||||
nsFormControlFrame::Paint(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer);
|
||||
nsresult rv = nsFormControlFrame::Paint(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer);
|
||||
|
||||
if (NS_FRAME_PAINT_LAYER_FOREGROUND == aWhichLayer) {
|
||||
PaintRadioButton(aPresContext, aRenderingContext, aDirtyRect);
|
||||
}
|
||||
|
||||
// Call to the base class to draw selection borders when appropriate
|
||||
return nsFrame::Paint(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer);
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1948,8 +1948,21 @@ nsGfxTextControlFrame2::SetInitialValue()
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
#define DIV_STRING "-moz-user-focus: none; border: 0px !important; padding: 0px; margin:0px; "
|
||||
#define DIV_STRING_SINGLELINE "-moz-user-focus: none; white-space : nowrap; overflow:auto; border: 0px !important; padding: 0px; margin:0px"
|
||||
#define DIV_STRING \
|
||||
"-moz-user-focus: none;" \
|
||||
"border: 0px !important;" \
|
||||
"padding: 0px;" \
|
||||
"margin: 0px;" \
|
||||
""
|
||||
|
||||
#define DIV_STRING_SINGLELINE \
|
||||
"-moz-user-focus: none;" \
|
||||
"white-space : nowrap;" \
|
||||
"overflow: auto;" \
|
||||
"border: 0px !important;" \
|
||||
"padding: 0px;" \
|
||||
"margin: 0px;" \
|
||||
""
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsGfxTextControlFrame2::CreateAnonymousContent(nsIPresContext* aPresContext,
|
||||
|
@ -2322,11 +2335,39 @@ nsGfxTextControlFrame2::Paint(nsIPresContext* aPresContext,
|
|||
if (NS_SUCCEEDED(IsVisibleForPainting(aPresContext, aRenderingContext, PR_TRUE, &isVisible)) && !isVisible) {
|
||||
return NS_OK;
|
||||
}
|
||||
nsresult rv = nsStackFrame::Paint(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer);
|
||||
nsresult rv = NS_OK;
|
||||
if (aWhichLayer == NS_FRAME_PAINT_LAYER_FOREGROUND) {
|
||||
rv = nsStackFrame::Paint(aPresContext, aRenderingContext, aDirtyRect, NS_FRAME_PAINT_LAYER_BACKGROUND);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
rv = nsStackFrame::Paint(aPresContext, aRenderingContext, aDirtyRect, NS_FRAME_PAINT_LAYER_FLOATERS);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
rv = nsStackFrame::Paint(aPresContext, aRenderingContext, aDirtyRect, NS_FRAME_PAINT_LAYER_FOREGROUND);
|
||||
}
|
||||
DO_GLOBAL_REFLOW_COUNT_DSP("nsGfxTextControlFrame2", &aRenderingContext);
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsGfxTextControlFrame2::GetFrameForPoint(nsIPresContext* aPresContext,
|
||||
const nsPoint& aPoint,
|
||||
nsFramePaintLayer aWhichLayer,
|
||||
nsIFrame** aFrame)
|
||||
{
|
||||
nsresult rv = NS_ERROR_FAILURE;
|
||||
if (aWhichLayer == NS_FRAME_PAINT_LAYER_FOREGROUND) {
|
||||
rv = nsStackFrame::GetFrameForPoint(aPresContext, aPoint,
|
||||
NS_FRAME_PAINT_LAYER_FOREGROUND, aFrame);
|
||||
if (NS_SUCCEEDED(rv))
|
||||
return NS_OK;
|
||||
rv = nsStackFrame::GetFrameForPoint(aPresContext, aPoint,
|
||||
NS_FRAME_PAINT_LAYER_FLOATERS, aFrame);
|
||||
if (NS_SUCCEEDED(rv))
|
||||
return NS_OK;
|
||||
rv = nsStackFrame::GetFrameForPoint(aPresContext, aPoint,
|
||||
NS_FRAME_PAINT_LAYER_BACKGROUND, aFrame);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsGfxTextControlFrame2::GetPrefSize(nsBoxLayoutState& aState, nsSize& aSize)
|
||||
|
|
|
@ -92,6 +92,11 @@ public:
|
|||
nsFramePaintLayer aWhichLayer,
|
||||
PRUint32 aFlags = 0);
|
||||
|
||||
NS_IMETHOD GetFrameForPoint(nsIPresContext* aPresContext,
|
||||
const nsPoint& aPoint,
|
||||
nsFramePaintLayer aWhichLayer,
|
||||
nsIFrame** aFrame);
|
||||
|
||||
NS_IMETHOD GetPrefSize(nsBoxLayoutState& aBoxLayoutState, nsSize& aSize);
|
||||
NS_IMETHOD GetMinSize(nsBoxLayoutState& aBoxLayoutState, nsSize& aSize);
|
||||
NS_IMETHOD GetMaxSize(nsBoxLayoutState& aBoxLayoutState, nsSize& aSize);
|
||||
|
|
|
@ -190,7 +190,6 @@ NS_IMETHODIMP nsHTMLButtonControlFrame::GetAccessible(nsIAccessible** aAccessibl
|
|||
nsCOMPtr<nsIAccessibilityService> accService = do_GetService("@mozilla.org/accessibilityService;1");
|
||||
|
||||
if (accService) {
|
||||
nsIAccessible* acc = nsnull;
|
||||
return accService->CreateHTML4ButtonAccessible(NS_STATIC_CAST(nsIFrame*, this), aAccessible);
|
||||
}
|
||||
|
||||
|
|
|
@ -237,7 +237,6 @@ NS_IMETHODIMP nsImageControlFrame::GetAccessible(nsIAccessible** aAccessible)
|
|||
nsCOMPtr<nsIAccessibilityService> accService = do_GetService("@mozilla.org/accessibilityService;1");
|
||||
|
||||
if (accService) {
|
||||
nsIAccessible* acc = nsnull;
|
||||
return accService->CreateHTML4ButtonAccessible(NS_STATIC_CAST(nsIFrame*, this), aAccessible);
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче