New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Split mpadded-002.html first paragraph #24603
Conversation
</math> | ||
</p> | ||
<p> | ||
<span id="baseline" style="display: inline-block; width: 30px; height: 5px; background: blue"></span> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems wrong to have two elements with "baseline" id, shouldn't the JS part be updated too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, good catch! Fixed.
Due to lack of line-breaking, on narrow pages the first math element will be positioned below the baseline reference. A lot of test frameworks use narrow widths for testing and calculations will fail, therefore split the first math element in half, giving a higher chance for the test framework to pass this test.
@@ -59,7 +59,7 @@ | |||
for (var i = 0; i <= 2; i++) { | |||
var mpadded = getBox("mpadded" + i); | |||
assert_approx_equals(mpadded.width, 25*(1+i%3), epsilon, "width" + i); | |||
assert_approx_equals(getBox("baseline").bottom - mpadded.top, 25*(1+(i+1)%3), epsilon, "height" + i); | |||
assert_approx_equals(getBox("baseline2").bottom - mpadded.top, 25*(1+(i+1)%3), epsilon, "height" + i); | |||
assert_approx_equals(mpadded.bottom - getBox("baseline").bottom, 25*(1+(i+2)%3), epsilon, "depth" + i); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mmh this one is still baseline? (I didn't read the test again, but please check carefully)
Due to lack of line-breaking, on narrow pages the first math
element will be positioned below the baseline reference. A lot
of test frameworks use narrow widths for testing and calculations
will fail, therefore split the first math element in half, giving
a higher chance for the test framework to pass this test.