- From: Simon Pieters <simonp@opera.com>
- Date: Fri, 01 Mar 2013 16:39:11 +0100
- To: "Kang-Hao (Kenny) Lu" <kanghaol@oupeng.com>, "Alan Gresley" <alan@css-class.com>
- Cc: "W3C CSS Test Suite" <public-css-testsuite@w3.org>
On Fri, 23 Nov 2012 12:44:48 +0100, Alan Gresley <alan@css-class.com> wrote: > On 23/11/2012 9:07 PM, Kang-Hao (Kenny) Lu wrote: >> (12/11/23 17:25), Simon Pieters wrote: >>>> # span { padding:1px 0 } >>>> # <div id=test><span></span></div> >>>> # <div id=ref></div><div id=s_ref></div> >>>> >>>> This is a bit puzzling, in particular about "<div id=s_ref></div>". I >>>> think what this test runs into is this part of CSS 2.1 9.4.2: >>>> >>>> # Line boxes are created as needed to hold inline-level content >>>> # within an inline formatting context. Line boxes that contain no >>>> # text, no preserved white space, no inline elements with non-zero >>>> # margins, padding, or borders, and no other in-flow content (such >>>> as >>>> # images, inline blocks or inline tables), and do not end with a >>>> # preserved newline must be treated as zero-height line boxes for >>>> the >>>> # purposes of determining the positions of any elements inside of >>>> # them, and must be treated as not existing for any other purpose. >>>> >>>> While the condition "no inline elements with non-zero margins, >>>> padding, >>>> or borders" probably has quirks-mode difference too (and should be >>>> specced), if you are testing the current prose to see if the above >>>> <span> contributes to line height, I'd suggest the test be written in >>>> this way: >>>> >>>> | div { line-height: 0} span { padding:1px 0; line-height: normal } >>>> | <div id=test>x<span></span></div><div id=ref>x</div> >>>> | <div id=s_ref>x<span>x</span></div> >>>> >>>> The 'x' at the beginning ensures that the tests don't go into the >>>> "zero-height line boxes" situation. >>>> >>>> Ditto for all others. >>> >>> I think this is intentional. We could add tests with "x" in as well, >>> though, if that still makes the quirk kick in. >>> >>> Do you have a test case demonstrating quirks-mode differences in "no >>> inline elements with non-zero margins, padding, or borders"? >> >> (By the way, the CSS 2.1 propose here should really be "non-zero >> horizontal margins/paddings/borders/" as you have observed.) >> >> Well, your test case: >> >> # span { margin:0 1px } >> # <div id=test><span></span></div> >> # <div id=ref></div><div id=s_ref>x</div> >> >> shows that :) (whether non-zero margins matter only in standards mode). >> >> What I am saying here is that if you compare this test with >> >> | div { line-height: 0;} span { margin:0 1px; line-height: normal; } >> | <div id=test>x<span></span></div> >> | <div id=ref>x</div><div id=s_ref>x<span>x</span></div> >> >> you'll see that Firefox passes the former but not the latter. That is, >> the <span> in "<div id=test>x<span></span></div>" does contribute to >> line height (in a buggy way). This is probably an edgy bug Gecko has, >> but the point is that the result could be differnt. >> >> In other words, I guess the best option is to spec the quirk about >> "zero-height line boxes" and include both test cases. Please see https://www.w3.org/Bugs/Public/show_bug.cgi?id=20055 >> >> >> Cheers, >> Kenny > > So are there any links to any testcase? The spec http://quirks.spec.whatwg.org/ has links to tests in the margin. The discussion above is about http://w3c-test.org/quirks-mode/tests/js/line-height-calculation.html The tests are currently maintained at https://dvcs.w3.org/hg/quirks-mode -- Simon Pieters Opera Software
Received on Friday, 1 March 2013 15:40:07 UTC