Skip to content

Commit

Permalink
Test percentage resolution for lspace/voffset for mpadded (#25175)
Browse files Browse the repository at this point in the history
  • Loading branch information
rwlbuis committed Aug 21, 2020
1 parent 020658e commit 4b8d683
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions mathml/presentation-markup/mpadded/mpadded-003.html
Expand Up @@ -53,18 +53,34 @@
assert_approx_equals(shifts.voffset, 0, epsilon);

shifts = GetShifts(mpaddeds[2]);
assert_approx_equals(shifts.lspace, 0, epsilon, "positive lspace percentage");
assert_approx_equals(shifts.voffset, 0, epsilon);

shifts = GetShifts(mpaddeds[3]);
assert_approx_equals(shifts.lspace, 0, epsilon, "negative lspace percentage");
assert_approx_equals(shifts.voffset, 0, epsilon);

shifts = GetShifts(mpaddeds[4]);
assert_approx_equals(shifts.lspace, 0, epsilon);
assert_approx_equals(shifts.voffset, 10, epsilon, "positive voffset");

shifts = GetShifts(mpaddeds[3]);
shifts = GetShifts(mpaddeds[5]);
assert_approx_equals(shifts.lspace, 0, epsilon);
assert_approx_equals(shifts.voffset, -10, epsilon, "negative voffset");

shifts = GetShifts(mpaddeds[4]);
shifts = GetShifts(mpaddeds[6]);
assert_approx_equals(shifts.lspace, 0, epsilon);
assert_approx_equals(shifts.voffset, 0, epsilon, "positive voffset percentage");

shifts = GetShifts(mpaddeds[7]);
assert_approx_equals(shifts.lspace, 0, epsilon);
assert_approx_equals(shifts.voffset, 0, epsilon, "negative voffset percentage");

shifts = GetShifts(mpaddeds[8]);
assert_approx_equals(shifts.lspace, 5, epsilon);
assert_approx_equals(shifts.voffset, 10, epsilon);

shifts = GetShifts(mpaddeds[5]);
shifts = GetShifts(mpaddeds[9]);
assert_approx_equals(shifts.lspace, 5, epsilon);
assert_approx_equals(shifts.voffset, -10, epsilon);
}, "content is shifted by the specified lspace/voffset");
Expand Down Expand Up @@ -148,8 +164,12 @@
<math>
<mpadded lspace="5px" style="background: black"><mspace width="10px" depth="15px" height="20px" style="background: green; opacity: .5"/></mpadded>
<mpadded lspace="-5px" style="background: black"><mspace width="10px" depth="15px" height="20px" style="background: green; opacity: .5"/></mpadded>
<mpadded lspace="5%" style="background: black"><mspace width="10px" depth="15px" height="20px" style="background: green; opacity: .5"/></mpadded>
<mpadded lspace="-5%" style="background: black"><mspace width="10px" depth="15px" height="20px" style="background: green; opacity: .5"/></mpadded>
<mpadded voffset="10px" style="background: black"><mspace width="10px" depth="15px" height="20px" style="background: green; opacity: .5"/></mpadded>
<mpadded voffset="-10px" style="background: black"><mspace width="10px" depth="15px" height="20px" style="background: green; opacity: .5"/></mpadded>
<mpadded voffset="10%" style="background: black"><mspace width="10px" depth="15px" height="20px" style="background: green; opacity: .5"/></mpadded>
<mpadded voffset="-10%" style="background: black"><mspace width="10px" depth="15px" height="20px" style="background: green; opacity: .5"/></mpadded>
<mpadded lspace="5px" voffset="10px" style="background: black"><mspace width="10px" depth="15px" height="20px" style="background: green; opacity: .5"/></mpadded>
<mpadded lspace="5px" voffset="-10px" style="background: black"><mspace width="10px" depth="15px" height="20px" style="background: green; opacity: .5"/></mpadded>
</math>
Expand Down

0 comments on commit 4b8d683

Please sign in to comment.