Bug 110360

Summary: [New Multicolumn] Column gap is computed incorrectly
Product: WebKit Reporter: Dave Hyatt <hyatt>
Component: Layout and RenderingAssignee: Dave Hyatt <hyatt>
Status: RESOLVED FIXED    
Severity: Normal CC: eric, esprehn+autocc, ojan.autocc, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch simon.fraser: review+

Description Dave Hyatt 2013-02-20 11:29:09 PST
We need to go to the parent block to get the column gap, since the RenderMultiColumnSet doesn't hold that value. :)
Comment 1 Dave Hyatt 2013-02-20 11:32:02 PST
Created attachment 189346 [details]
Patch
Comment 2 Dave Hyatt 2013-02-20 11:33:49 PST
Created attachment 189347 [details]
Patch
Comment 3 Simon Fraser (smfr) 2013-02-20 11:41:17 PST
Comment on attachment 189347 [details]
Patch

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

> Source/WebCore/rendering/RenderMultiColumnSet.cpp:105
> +        return parentBlock->style()->fontDescription().computedPixelSize(); // "1em" is recommended as the normal gap setting. Matches <p> margins.

The comment makes me think that computedPixelSize() returns a value equivalent to 1em, which is confusing.

> Source/WebCore/rendering/RenderMultiColumnSet.cpp:106
> +    return static_cast<int>(parentBlock->style()->columnGap());

I think this should use clampToInteger() like roundedIntPoint() etc do. Weird that it's a float.
Comment 4 Dave Hyatt 2013-02-20 11:42:50 PST
(In reply to comment #3)
> (From update of attachment 189347 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=189347&action=review
> 
> > Source/WebCore/rendering/RenderMultiColumnSet.cpp:105
> > +        return parentBlock->style()->fontDescription().computedPixelSize(); // "1em" is recommended as the normal gap setting. Matches <p> margins.
> 
> The comment makes me think that computedPixelSize() returns a value equivalent to 1em, which is confusing.
> 
> > Source/WebCore/rendering/RenderMultiColumnSet.cpp:106
> > +    return static_cast<int>(parentBlock->style()->columnGap());
> 
> I think this should use clampToInteger() like roundedIntPoint() etc do. Weird that it's a float.

Let me try just removing the cast completely. Technically now that subpixel layout is turned on, there is no reason to force the gap to be an integer any longer.
Comment 5 Dave Hyatt 2013-02-20 12:01:40 PST
Fixed in r143484.