W3C home > Mailing lists > Public > www-style@w3.org > July 2013

Re: [css3-multicol] Tests with wide or excessively wide column-gap

From: Gérard Talbot <www-style@gtalbot.org>
Date: Tue, 30 Jul 2013 13:00:39 -0400
Message-ID: <fcda8ee3f90518dd0b11dc95c0795322.squirrel@ed-sh-cp3.entirelydigital.com>
To: "Morten Stenshorne" <mstensho@opera.com>
Cc: "HÃ¥kon Wium Lie" <howcome@opera.com>, "www-style mailing list" <www-style@w3.org>

Le Mar 30 juillet 2013 9:55, Morten Stenshorne a écrit :
> "Gérard Talbot" <www-style@gtalbot.org> writes:
>
>> Le Lun 29 juillet 2013 5:52, Morten Stenshorne a écrit :
>>> "Gérard Talbot" <www-style@gtalbot.org> writes:
>>>
>>>> [src]
>>>> http://test.csswg.org/source/contributors/opera/submitted/multicol/multicol-count-computed-001.xht
>>>>
>>>> [reftest]
>>>> http://test.csswg.org/source/contributors/opera/submitted/multicol/multicol-count-computed-ref.xht
>>>>
>>>> When width of column-gaps equal the available width of a multi-column
>>>> element, then used column-width of colum boxes should be 0px.
>>>>
>>>> (11)  if (column-width = auto) and (column-count != auto) then
>>>> (12)    N := column-count;
>>>> (13)    W := max(0, (available-width - ((N - 1) * column-gap)) / N);
>>>> (14)  exit;
>>>>
>>>>   used width == max(0, (12em - ((3 - 1) * 6em)) / 3);
>>>>   used width == max(0, (12em - (2 * 6em)) / 3);
>>>>   used width == max(0, (12em - 12em) / 3);
>>>>   used width == max(0, 0em / 3);
>>>>   used width == 0px
>>>>
>>>>
>>>> So, in this test, there should be 3 column boxes of each 0px wide.
>>>> Now,
>>>> §8.1 states:
>>>> "
>>>> Content in the normal flow that extends into column gaps (e.g., long
>>>> words
>>>> or images) is clipped in the middle of the column gap.
>>>> "
>>>> http://www.w3.org/TR/css3-multicol/#overflow-inside-multicol-elements
>>>>
>>>> So, I believe only the first 3 "x" of the <span id="pink"> should be
>>>> displayed. And only the first 3 "x" of the <span id="orange"> should
>>>> be
>>>> displayed.
>>>>
>>>> §8.2 states:
>>>> "
>>>> overflow outside multicol elements
>>>>
>>>> Content and column rules that extend outside column boxes at the edges
>>>> of
>>>> the multi-column element are clipped according to the
>>>> ‘overflow’
>>>> property.
>>>> "
>>>>
>>>> And so (since default, initial value of 'overflow' is 'visible'), the
>>>> 4
>>>> "x" of the <span id="purple"> should be displayed, with the first,
>>>> leftmost one overlapping the border-right. The 3 rightmost "x" of the
>>>> span
>>>> id="purple" should extend outside the multi-column element.
>>>>
>>>> The 2 blue column rules should be rendered too, with the left half
>>>> (0.75em) of the first column rule overlapping the 3rd pink "x"


To be precise, the left half of the first column rule should be overlapped
by the 4th pink "x" because "Column rules are painted in the inline
content layer, but below all inline content inside the multicol element."
http://dev.w3.org/csswg/css-multicol/#column-gaps-and-rules


>>>> and the
>>>> left half (0.75em) of the 2nd column rule overlapping the 3rd orange
>>>> "x".


The left half of the 2nd column rule should be overlapped by the 4th
orange "x".


>>>>
>>>> I believe the reftest is wrong.
>>>>
>>>> What am I missing?
>>>
>>> Looks like this test was written for an older version of the spec:
>>> http://www.w3.org/TR/2009/CR-css3-multicol-20091217/#pseudo-algorithm
>>
>>
>> I think there was a mistake at line 20 of that pseudo-algorithm
>> http://www.w3.org/TR/2009/CR-css3-multicol-20091217/#pseudo-algorithm
>>
>> (20)    elsif (column-gap >= available-width) then
>> (21)      N := 1;
>> (22)      W := available-width;
>>
>> should have been instead
>>
>> (20)    elsif ((column-count - 1) * column-gap >= available-width) then
>> (21)      N := 1;
>> (22)      W := available-width;
>
> No, I think it was right the way it was. The final else block would take
> care of cases where the gaps combined were wider than the multicol
> container. But all this is gone now, luckily.
>
>>> In this version there are 10 lines dedicated to "insane" column-gap
>>> values, but they are gone in the latest version of the spec.
>>
>> Okay. Well... this was precisely about my 2 tests and situation.
>
> Yes, those two tests were probably written precisely to test Presto's
> implementation of those 10 lines of pseudo-code. :)
>
>>> I'm pretty
>>> sure both the tests and the Presto implementation (the implementation
>>> was finished in February/March 2011, i.e. slightly older than the
>>> current spec) were done with the 2009 version of the spec in mind.
>>>
>>> This thread seems relevant:
>>> http://lists.w3.org/Archives/Public/www-style/2010Nov/0434.html
>>> Continues here:
>>> http://lists.w3.org/Archives/Public/www-style/2011Feb/0143.html
>>> Getting interesting here:
>>> http://lists.w3.org/Archives/Public/www-style/2011Feb/0399.html
>>>
>>
>> Such threads seem to be establishing an algorithm when/where the space
>> for
>> column-gapS will exceed available width
>> {((column-count - 1) * column-gap) > available-width}
>> ; in which case, the used column-count value will become smaller than
>> the
>> declared column-count value.
>> All this is interesting but the latest/current version of that
>> pseudo-algorithm is not mentioned anywhere now.
>> Not in
>> http://www.w3.org/TR/2011/CR-css3-multicol-20110412/
>>
>> Not in
>> http://dev.w3.org/csswg/css-multicol/#pseudo-algorithm
>> (Editor's Draft 22 July 2013)
>
> Those two versions of the pseudo-algorithm should give the exact same
> result in every case.


This is important info... because I was wondering which pseudo-algorithm
to use.


> At least that's the intention, as far as I
> know. It's only the 2009 version that's truly different.
>
> It's just much simpler now. If the gap widths are insane, you simply end
> up with zero-width columns.
>
> HÃ¥kon: The editor's draft seems to implicitly assume that at least one
> of column-count and column-width be non-auto. Shouldn't that be
> mentioned more explicitly?


The CR spec mentions this explicitly... although as a comment in the
pseudo-algorithm.


> Also, I think the indentation generally looks
> a bit weird.

The indentation seems to suggests that the global if .. else if .. else
block ends with line 8. Line 9 is outside that global if .. else if ..
else.

>
>> So, I can not review appropriately the
>>
>> /opera/submitted/multicol/multicol-count-computed-001.xht
>>
>> /opera/submitted/multicol/multicol-count-computed-002.xht
>
> They are now invalid and should be removed. We should still test what
> happens when the gaps are large, but I doubt those two tests are optimal
> for that purpose.

Morten, Thank you for your replies. I really appreciated this.

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 Tuesday, 30 July 2013 17:01:11 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:32 UTC