Fix strict mode text-decoration when one line of the inline contains no text. b=210016,210012 r+sr=bzbarsky

This commit is contained in:
dbaron%dbaron.org 2003-06-20 01:42:32 +00:00
parent a1bc56e855
commit 3daaacd191
2 changed files with 26 additions and 4 deletions

View File

@ -147,7 +147,7 @@ nsHTMLContainerFrame::PaintDecorationsAndChildren(
}
static PRBool
HasTextFrameDescendant(nsIPresContext* aPresContext, nsIFrame* parent);
HasTextFrameDescendantOrInFlow(nsIPresContext* aPresContext, nsIFrame* aFrame);
void
nsHTMLContainerFrame::GetTextDecorations(nsIPresContext* aPresContext,
@ -220,7 +220,7 @@ nsHTMLContainerFrame::GetTextDecorations(nsIPresContext* aPresContext,
if (aDecorations) {
// If this frame contains no text, we're required to ignore this property
if (!HasTextFrameDescendant(aPresContext, this)) {
if (!HasTextFrameDescendantOrInFlow(aPresContext, this)) {
aDecorations = NS_STYLE_TEXT_DECORATION_NONE;
}
}
@ -259,6 +259,17 @@ HasTextFrameDescendant(nsIPresContext* aPresContext, nsIFrame* aParent)
return PR_FALSE;
}
static PRBool
HasTextFrameDescendantOrInFlow(nsIPresContext* aPresContext, nsIFrame* aFrame)
{
for (nsIFrame *f = aFrame->GetFirstInFlow(); f; f->GetNextInFlow(&f)) {
if (HasTextFrameDescendant(aPresContext, f))
return PR_TRUE;
}
return PR_FALSE;
}
/*virtual*/ void
nsHTMLContainerFrame::PaintTextDecorationLines(
nsIRenderingContext& aRenderingContext,

View File

@ -147,7 +147,7 @@ nsHTMLContainerFrame::PaintDecorationsAndChildren(
}
static PRBool
HasTextFrameDescendant(nsIPresContext* aPresContext, nsIFrame* parent);
HasTextFrameDescendantOrInFlow(nsIPresContext* aPresContext, nsIFrame* aFrame);
void
nsHTMLContainerFrame::GetTextDecorations(nsIPresContext* aPresContext,
@ -220,7 +220,7 @@ nsHTMLContainerFrame::GetTextDecorations(nsIPresContext* aPresContext,
if (aDecorations) {
// If this frame contains no text, we're required to ignore this property
if (!HasTextFrameDescendant(aPresContext, this)) {
if (!HasTextFrameDescendantOrInFlow(aPresContext, this)) {
aDecorations = NS_STYLE_TEXT_DECORATION_NONE;
}
}
@ -259,6 +259,17 @@ HasTextFrameDescendant(nsIPresContext* aPresContext, nsIFrame* aParent)
return PR_FALSE;
}
static PRBool
HasTextFrameDescendantOrInFlow(nsIPresContext* aPresContext, nsIFrame* aFrame)
{
for (nsIFrame *f = aFrame->GetFirstInFlow(); f; f->GetNextInFlow(&f)) {
if (HasTextFrameDescendant(aPresContext, f))
return PR_TRUE;
}
return PR_FALSE;
}
/*virtual*/ void
nsHTMLContainerFrame::PaintTextDecorationLines(
nsIRenderingContext& aRenderingContext,