Bug 667576. Handle visited colors correctly in MathML. r=dbaron

This commit is contained in:
Boris Zbarsky 2011-10-29 03:04:20 -04:00
parent 23c2e8cf88
commit dcc04dfdae
7 changed files with 70 additions and 4 deletions

View File

@ -2053,7 +2053,7 @@ nsMathMLChar::PaintForeground(nsPresContext* aPresContext,
}
// Set color ...
nscolor fgColor = styleContext->GetStyleColor()->mColor;
nscolor fgColor = styleContext->GetVisitedDependentColor(eCSSProperty_color);
if (aIsSelected) {
// get color to use for selection from the look&feel object
fgColor = LookAndFeel::GetColor(LookAndFeel::eColorID_TextSelectForeground,

View File

@ -516,7 +516,7 @@ void nsDisplayMathMLBar::Paint(nsDisplayListBuilder* aBuilder,
nsRenderingContext* aCtx)
{
// paint the bar with the current text color
aCtx->SetColor(mFrame->GetStyleColor()->mColor);
aCtx->SetColor(mFrame->GetVisitedDependentColor(eCSSProperty_color));
aCtx->FillRect(mRect + ToReferenceFrame());
}

View File

@ -759,7 +759,7 @@ void nsDisplayNotation::Paint(nsDisplayListBuilder* aBuilder,
gfxRect rect = presContext->AppUnitsToGfxUnits(mRect + ToReferenceFrame());
// paint the frame with the current text color
aCtx->SetColor(mFrame->GetStyleColor()->mColor);
aCtx->SetColor(mFrame->GetVisitedDependentColor(eCSSProperty_color));
// change line width to mThickness
gfxContext *gfxCtx = aCtx->ThebesContext();

View File

@ -575,7 +575,7 @@ void nsDisplayMathMLSlash::Paint(nsDisplayListBuilder* aBuilder,
gfxRect rect = presContext->AppUnitsToGfxUnits(mRect + ToReferenceFrame());
// paint with the current text color
aCtx->SetColor(mFrame->GetStyleColor()->mColor);
aCtx->SetColor(mFrame->GetVisitedDependentColor(eCSSProperty_color));
// draw the slash as a parallelogram
gfxContext *gfxCtx = aCtx->ThebesContext();

View File

@ -0,0 +1,32 @@
<!DOCTYPE HTML>
<html>
<head>
<style>
* { color: green; }
</style>
</head>
<body>
<math href="" display="block">
<mi>x</mi>
<mo>=</mo>
<mfrac>
<mrow>
<msqrt>
<mn>5</mn>
</msqrt>
</mrow>
<mrow>
<menclose
notation="radical circle roundedbox updiagonalstrike downdiagonalstrike">
<mn>2</mn>
</menclose>
</mrow>
</mfrac>
<mo>+</mo>
<mfrac bevelled="true">
<mn>2</mn>
<mn>3</mn>
</mfrac>
</math>
</body>
</html>

View File

@ -0,0 +1,33 @@
<!DOCTYPE HTML>
<html>
<head>
<style>
:link { color: red; }
:visited { color: green; }
</style>
</head>
<body>
<math href="" display="block">
<mi>x</mi>
<mo>=</mo>
<mfrac>
<mrow>
<msqrt>
<mn>5</mn>
</msqrt>
</mrow>
<mrow>
<menclose
notation="radical circle roundedbox updiagonalstrike downdiagonalstrike">
<mn>2</mn>
</menclose>
</mrow>
</mfrac>
<mo>+</mo>
<mfrac bevelled="true">
<mn>2</mn>
<mn>3</mn>
</mfrac>
</math>
</body>
</html>

View File

@ -80,6 +80,7 @@ var gTests = [
//"== first-line-1.html first-line-1-ref.html",
"== white-to-transparent-1.html white-to-transparent-1-ref.html",
"== link-root-1.xhtml link-root-1-ref.xhtml",
"== mathml-links.html mathml-links-ref.html",
];
// Maintain a reference count of how many things we're waiting for until