stylo: -moz-math-variant needs to override font-weight and font-style

RESOLVED FIXED

Status

()

Core
CSS Parsing and Computation
RESOLVED FIXED
6 months ago
6 months ago

People

(Reporter: bz, Unassigned)

Tracking

(Blocks: 2 bugs)

53 Branch
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

nsRuleNode::SetFont has:

  if (aFont->mMathVariant != NS_MATHML_MATHVARIANT_NONE) {
    // -moz-math-variant overrides font-style
    aFont->mFont.style = NS_FONT_STYLE_NORMAL;
  } else {
    // normal font-style computation
  }

and

  if (aFont->mMathVariant != NS_MATHML_MATHVARIANT_NONE) {
    // -moz-math-variant overrides font-weight
    aFont->mFont.weight = NS_FONT_WEIGHT_NORMAL;
  } else if (eCSSUnit_Enumerated == weightValue->GetUnit()) {
    // normal font-weight computation
  }

but we don't seem to have a servo equivalent.  This is causing the layout/reftests/mathml/mathvariant-3.html test failure.
I guess we either need to put -moz-math-variant in the "computed early" properties that hang off the Context via its StyleBuilder, or we need to do some sort of after-the-fact fixup, right?
This feels like an after the fact fixup. Emilio added a framework for these
Created attachment 8870936 [details] [diff] [review]
Patch using early properties, just for later reference
https://github.com/servo/servo/pull/17026 will fix using fixup.
https://hg.mozilla.org/integration/autoland/rev/93c49ebdbc5554d2eaeaf56e6926a218b78994fe
Status: NEW → RESOLVED
Last Resolved: 6 months ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.