You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The culprit code is InlineFlow::compute_minimum_ascent_and_descent. It seems to mine the font metrics for minimum values even when there is no actual text (also, its comment claims that it works on a line-by-line basis, but it seems to give a result to the entire flow).
Firefox matches Servo's current behavior when a <!DOCTYPE html> declaration is added.
That's why I couldn't find anything in the base CSS spec to justify the behavior; it's in the Quirks Mode spec! That's also why I found tests that seemed to rely on the behavior that this issue reports as a bug; because the tests are running with DOCTYPEs!
All test cases appear to work the same as Chromium, at least, so this is probably fixed. Pic attached is the first test case, tested on Arch Linux x86_64, servo built against commit id 9d29017, compared against Firefox 141.0, Epiphany 48.5 and Chromium 138.0.7204.168 (ordered left to right).
Activity
jdm commentedon Apr 19, 2016
With an encapsulating div that forces a particular height it looks slightly better:


Firefox:
Servo:
notriddle commentedon Apr 28, 2016
Those "margins" are actually the space intended for the font's descenders. In both Chrome, these canvases are touching:
But these canvases have a "margin" between them:
In Servo, the space between them is identical.
notriddle commentedon Apr 28, 2016
The culprit code is
InlineFlow::compute_minimum_ascent_and_descent. It seems to mine the font metrics for minimum values even when there is no actual text (also, its comment claims that it works on a line-by-line basis, but it seems to give a result to the entire flow).notriddle commentedon May 4, 2016
Since #10691 landed, @jdm's original test case now looks like this:
Auto merge of #11275 - notriddle:canvas_no_descender, r=mbrubeck
Auto merge of #11275 - notriddle:canvas_no_descender, r=<try>
Auto merge of #11275 - notriddle:canvas_no_descender, r=<try>
notriddle commentedon Jun 18, 2016
Firefox matches Servo's current behavior when a
<!DOCTYPE html>declaration is added.That's why I couldn't find anything in the base CSS spec to justify the behavior; it's in the Quirks Mode spec! That's also why I found tests that seemed to rely on the behavior that this issue reports as a bug; because the tests are running with DOCTYPEs!
:headdesk:
notriddle commentedon Jun 18, 2016
dralley commentedon Apr 1, 2020
The original minimal reproducer still works -- didn't try the others.
lumiscosity commentedon Jul 25, 2025
All test cases appear to work the same as Chromium, at least, so this is probably fixed. Pic attached is the first test case, tested on Arch Linux x86_64, servo built against commit id 9d29017, compared against Firefox 141.0, Epiphany 48.5 and Chromium 138.0.7204.168 (ordered left to right).