Does such an add-on exist for Firefox?

Does such an add-on exist for Firefox?

Firebug can tell you this information: enable it, choose the HTML tab, choose the element you're interested in, then select the layout tab on the right. It shows a diagram quite similar to your artwork above :-)
the best addon I can think of is CSSViewer, there is also firebug or web developer toolbar.
you can see more addons in this top 50 list