W3C home > Mailing lists > Public > www-style@w3.org > February 2012

[CSS21] section 10.8.1: when line-height is equal to or less than content area (font-size)

From: Gérard Talbot <www-style@gtalbot.org>
Date: Wed, 22 Feb 2012 21:44:36 -0500
Message-ID: <f6ec0ee9d6b9cf4767b18c09dfd4c41c.squirrel@ed-sh-cp3.entirelydigital.com>
To: "W3C www-style mailing list" <www-style@w3.org>
Hello,

{
Although margins, borders, and padding of non-replaced elements do not
enter into the line box calculation, they are still rendered around inline
boxes. This means that if the height specified by 'line-height' is less
than the content height of contained boxes, backgrounds and colors of
padding and borders may "bleed" into adjoining line boxes. User agents
should render the boxes in document order. This will cause the borders on
subsequent lines to paint over the borders and text of previous lines.
}
http://www.w3.org/TR/CSS21/visudet.html#line-height

The above is not thorough and, IMO, is not precise. The "may" of "may
bleed" seems inappropriate, incorrect, definitely hesitant when it should
not. I do not understand the recourse of the "may" in the sentence.

I believe it should be saying instead that:

{(...)
if the height specified by 'line-height' is *equal to* the content height
of contained boxes, then backgrounds and colors of padding and borders, if
any, *will* "bleed" into adjoining line boxes.
If the height specified by 'line-height' is *less than* the content height
of contained boxes, then background-color of content area *will* "bleed"
into adjoining line boxes.
}

4 tests support such editorial changes:

http://test.csswg.org/suites/css2.1/nightly-unstable/html4/border-padding-bleed-001.htm

http://test.csswg.org/suites/css2.1/nightly-unstable/html4/border-padding-bleed-002.htm

http://test.csswg.org/suites/css2.1/nightly-unstable/html4/border-padding-bleed-003.htm

http://www.gtalbot.org/BrowserBugsSection/css21testsuite/font-size-vs-smaller-line-height.html
(using normal serif font; we could have created the same test with the
Ahem font).


Glyphs in a smaller line box bleed out of their line box and they overlap
*over* the previous line box (they overlap *under* following line box).
None of this is actually written in the current spec.


regards, Gérard
-- 
CSS 2.1 Test suite RC6, March 23rd 2011
http://test.csswg.org/suites/css2.1/20110323/html4/toc.html

Contributions to CSS 2.1 test suite
http://www.gtalbot.org/BrowserBugsSection/css21testsuite/

Web authors' contributions to CSS 2.1 test suite
http://www.gtalbot.org/BrowserBugsSection/css21testsuite/web-authors-contributions-css21-testsuite.html
Received on Thursday, 23 February 2012 02:45:09 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:51 GMT