Bug 57981

Summary: Update the CSS3 column width and count algorithm to match the spec.
Product: WebKit Reporter: Dave Hyatt <hyatt>
Component: Layout and RenderingAssignee: Dave Hyatt <hyatt>
Severity: Normal CC: dglazkov, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.5   
Description Flags
Patch simon.fraser: review+

Description Dave Hyatt 2011-04-06 14:07:44 PDT
Update the CSS3 column width and count algorithm to match the spec.   I honestly have no idea what the differences are.  None of our tests change results.  I just want the code to match the pseudo-algorithm in the latest draft.
Comment 1 Dave Hyatt 2011-04-06 14:09:15 PDT
Created attachment 88508 [details]
Comment 2 Simon Fraser (smfr) 2011-04-06 14:13:20 PDT
Comment on attachment 88508 [details]

View in context: https://bugs.webkit.org/attachment.cgi?id=88508&action=review

> Source/WebCore/rendering/RenderBlock.cpp:4215
> +        desiredColumnCount = max(1, (int)((float)(availWidth + colGap) / (colWidth + colGap)));

To avoid the (int) cast you could use max<int>().

> Source/WebCore/rendering/RenderBlock.cpp:4218
> +        desiredColumnCount = min(colCount, (int)((float)(availWidth + colGap) / (colWidth + colGap)));

Comment 3 Dave Hyatt 2011-04-06 14:23:06 PDT
Fixed in r83099.
Comment 4 WebKit Review Bot 2011-04-06 14:26:08 PDT
Attachment 88508 [details] did not build on chromium:
Build output: http://queues.webkit.org/results/8348315