[Webkit-unassigned] [Bug 103335] [CSS Grid Layout] Support all specified breadth size

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Nov 29 17:39:38 PST 2012


https://bugs.webkit.org/show_bug.cgi?id=103335





--- Comment #6 from Julien Chaffraix <jchaffraix at webkit.org>  2012-11-29 17:41:55 PST ---
(From update of attachment 176754)
View in context: https://bugs.webkit.org/attachment.cgi?id=176754&action=review

Btw, if you sync past r135965, you can use fast/css-grid-layout/percent-grid-item-in-percent-grid-track.html and fast/css-grid-layout/percent-grid-item-in-percent-grid-track-in-percent-grid.html to assess if you are on the right track. They should be passing after this change and only require RenderGrid::computedUsedBreadthOfGridTracks to be properly implemented!

> LayoutTests/fast/css-grid-layout/grid-columns-rows-get-set.html:11
> +    font: 10px Ahem;

I don't see why you need to set the font size here, could you clarify why it's needed outside the 'em' resolution?

> LayoutTests/fast/css-grid-layout/resources/grid-columns-rows-get-set.js:30
> +var gridWithCalcComplexElement = document.getElementById("gridWithCalcComplexElement");
> +shouldBe("getComputedStyle(gridWithCalcComplexElement, '').getPropertyValue('-webkit-grid-columns')", "'150px'");
> +shouldBe("getComputedStyle(gridWithCalcComplexElement, '').getPropertyValue('-webkit-grid-rows')", "'75px'");

These results are wrong AFAICT, you only get the fixed part of your calc expression.

The easiest way to properly check the percent resolution is to have a container with a fixed height and width as that avoids any circular dependency when resolving percent (for 'height', it can mean that we just interpret it as being 'auto', see http://www.w3.org/TR/CSS21/visudet.html#the-height-property).

If you put a containing block of 800 * 600px (which matches the size of DRT's viewport) and if you force all the values to be absolute, you should expect:
* column = 450px (50% of 800 + 150)
* row = 465px (65% * 600 + 75)

> Source/WebCore/css/CSSComputedStyleDeclaration.cpp:993
> +    return zoomAdjustedPixelValue(valueForLength(trackLength, 0, renderView), style);

The reason you get the value without resolving the percentage properly above is that you pass '0' as maxValue, which is used to resolve percentage.

> Source/WebCore/rendering/RenderGrid.cpp:145
> +        if (trackStyles[i].isSpecified())
> +            track.m_usedBreadth = valueForLength(trackStyles[i], direction == ForColumns ? m_maxPreferredLogicalWidth : logicalHeight(), view());

This is wrong:
* percentages should be resolved against the logical width (logicalWidth()), not the maximum preferred logical widths. The former is your size as computed during this layout, the latter represents the maximum amount of space a renderer can take (e.g. for text, it would represent the layout with the longest possible lines (ie no extra breaks)).
* using logicalHeight() for the row resolution doesn't work for a good reason: your logical height is usually determined by your children. This means that you are probably using the previous layout's value (or just 0 if we reset it). That's why you have to infer it from your style using computeContentLogicalHeight().

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list