W3C home > Mailing lists > Public > www-style@w3.org > June 2009

RE: [css3-multicol] Pseudo-algorithm feedback

From: Sylvain Galineau <sylvaing@microsoft.com>
Date: Wed, 3 Jun 2009 06:33:55 -0700
To: "www-style@w3.org" <www-style@w3.org>
Message-ID: <DBCD4020258D924A9887739500CF8E599CD7F4A13B@NA-EXMSG-C125.redmond.corp.microsoft.com>
The following copy of the pseudo-algorithm summarizes the changes proposes in http://lists.w3.org/Archives/Public/www-style/2009Jun/0009.html. 

The lines that need updating are asterisked; the comment describes the suggested change.

(1)   if ((column-width = auto) and (column-count = auto)) or
(2)      ((available-width = unknown) and (column-count = auto)) then
(3)     exit; /* no columns */
(4)   fi
(5)
(6)   if (available-width = unknown) and (column-count != auto) and (column-width != auto) then
(7)     N := column-count;
(8)     W := column-width;
(9)     exit;
(10)  fi
(11)
(12)  if (available-width = unknown) then
(13)    available-width := shrink-to-fit;
(14)  fi
(15)
(16)  if (column-width = auto) then
(17)    if ((column-count - 1) * column-gap < available-width) then
(18)      N := column-count;
(19)      W := (available-width - ((N - 1) * column-gap))/N;
(20)    elsif (column-gap >= available-width) then
(21)      N := 1;
(22)      W := available-width; 
(23)    else
(24)      N := floor(available-width/column-gap);
(25)      W := (available-width - ((N - 1) * column-gap))/N;
(26)    fi
(27)  elsif (column-count = auto) then
(28)    if (column-width >= available-width) then
(29)      N := 1
(30)*     W := column-width; 		// should be W := available-width
(31)    else
(32)      N := floor((available-width + column-gap) / (column-width + column-gap));
(33)      W := ((available-width + column-gap) / N) - column-gap;
(34)    fi
(35)* elsif ((column-count * column-width) + ((column-count - 1 ) * column-gap) <= available-width) then     // condition should be if (... = available_width)
(36)    N := column-count;
(37)    W := column-width;
(38)  elsif (column-width >= available-width) then
(40)    N := 1
(41)*   W := column-width;	// should be W := available-width
(42)  else
(43)    N := floor((available-width + column-gap) / (column-width + column-gap));
(44)    W := ((available-width + column-gap) / N) - column-gap;
(45)  fi
Received on Wednesday, 3 June 2009 13:34:39 GMT

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