Bug 669015 - Fix regressed text-shadow in XUL r=roc

This commit is contained in:
Michael Ventnor 2011-07-04 14:59:19 +10:00
parent 6c5e24387c
commit 94ab78043d
4 changed files with 17 additions and 9 deletions

View File

@ -0,0 +1,3 @@
<box xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<label style="margin: 0px 300px;" value="Shadow"/>
</box>

View File

@ -0,0 +1,3 @@
<box xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<label style="margin: 0px 300px; text-shadow: blue 4px 10px 2px" value="Shadow"/>
</box>

View File

@ -1649,4 +1649,5 @@ fails-if(layersGPUAccelerated&&cocoaWidget) == 654950-1.html 654950-1-ref.html #
== 658952.html 658952-ref.html
== 664127-1.xul 664127-1-ref.xul
== 660682-1.html 660682-1-ref.html
!= 669015-1.xul 669015-1-notref.xul
== 668319-1.xul about:blank

View File

@ -347,9 +347,9 @@ public:
virtual void DisableComponentAlpha() { mDisableSubpixelAA = PR_TRUE; }
void PaintTextWithOffset(nsRenderingContext* aCtx,
nsPoint aOffset,
const nscolor* aColor);
void PaintTextToContext(nsRenderingContext* aCtx,
nsPoint aOffset,
const nscolor* aColor);
PRPackedBool mDisableSubpixelAA;
};
@ -361,7 +361,7 @@ PaintTextShadowCallback(nsRenderingContext* aCtx,
void* aData)
{
reinterpret_cast<nsDisplayXULTextBox*>(aData)->
PaintTextWithOffset(aCtx, aShadowOffset, &aShadowColor);
PaintTextToContext(aCtx, aShadowOffset, &aShadowColor);
}
void
@ -372,20 +372,21 @@ nsDisplayXULTextBox::Paint(nsDisplayListBuilder* aBuilder,
mDisableSubpixelAA);
// Paint the text shadow before doing any foreground stuff
nsRect drawRect = static_cast<nsTextBoxFrame*>(mFrame)->mTextDrawRect;
nsRect drawRect = static_cast<nsTextBoxFrame*>(mFrame)->mTextDrawRect +
ToReferenceFrame();
nsLayoutUtils::PaintTextShadow(mFrame, aCtx,
drawRect, mVisibleRect,
mFrame->GetStyleColor()->mColor,
PaintTextShadowCallback,
(void*)this);
PaintTextWithOffset(aCtx, nsPoint(0, 0), nsnull);
PaintTextToContext(aCtx, nsPoint(0, 0), nsnull);
}
void
nsDisplayXULTextBox::PaintTextWithOffset(nsRenderingContext* aCtx,
nsPoint aOffset,
const nscolor* aColor)
nsDisplayXULTextBox::PaintTextToContext(nsRenderingContext* aCtx,
nsPoint aOffset,
const nscolor* aColor)
{
static_cast<nsTextBoxFrame*>(mFrame)->
PaintTitle(*aCtx, mVisibleRect, ToReferenceFrame() + aOffset, aColor);