[css-grid] Implement the 'auto' min-sizing function

RESOLVED FIXED in Firefox 43

Status

()

defect
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: mats, Assigned: mats)

Tracking

Trunk
mozilla43
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox41 affected, firefox43 fixed)

Details

Attachments

(2 attachments, 3 obsolete attachments)

Assignee

Description

4 years ago
http://dev.w3.org/csswg/css-grid/#valdef-grid-template-columns-auto

This is an intrinsic size based on the 'min-width' (or 'min-height',
depending on the writing-mode of the child and if we're calculating
for a row or column track).
Assignee

Updated

4 years ago
Blocks: 1151212
Assignee

Comment 2

4 years ago
I suspect this is controversial, but I don't see any another solution
since for Grid we need metrics not just depending on the container's
WM but also if we're calculating for a column or row.
Assignee

Updated

4 years ago
Attachment #8622125 - Flags: review?(jfkthame)
Assignee

Comment 3

4 years ago
The function is "#if 0" for now to avoid the "unused function" compilation
warning.  I'll strip that off when we start using it (in bug 1151212).

No tests yet, that will also come in bug 1151212.

(This is the last part)
Attachment #8622126 - Flags: review?(jfkthame)
Comment on attachment 8622124 [details] [diff] [review]
part 1 - Introduce nsLayoutUtils::MinISizeContributionForWM which calculates an intrinsic isize contribution from aFrame's 'min-width' property (or 'min-height' depending on aWM) and the corresponding

Review of attachment 8622124 [details] [diff] [review]:
-----------------------------------------------------------------

::: layout/base/nsLayoutUtils.cpp
@@ +4684,5 @@
>    return IntrinsicForWM(wm, aRenderingContext, aFrame, aType, aFlags);
>  }
>  
>  /* static */ nscoord
> +nsLayoutUtils::MinISizeContributionForWM(WritingMode         aWM,

See bug 1174450 comment 22; I suggest MinISizeContributionForAxis here, taking a PhysicalAxis value (eAxisVertical or eAxisHorizontal), as this is the only aspect of the writing mode we actually need.
Comment on attachment 8622126 [details] [diff] [review]
part 3 - [css-grid] Implement the 'auto' min-sizing function for Grid

Review of attachment 8622126 [details] [diff] [review]:
-----------------------------------------------------------------

::: layout/generic/nsGridContainerFrame.cpp
@@ +1253,5 @@
> +        nsLayoutUtils::IntrinsicISizeType aConstraint)
> +{
> +  WritingMode wm((aDimension == nsGridContainerFrame::eColDimension) ==
> +                 aCBWM.IsVertical());
> +  return nsLayoutUtils::MinISizeContributionForWM(wm, aRC, aChild, aConstraint);

This will then be something like

  PhysicalAxis axis =
    (aDimension == nsGridContainerFrame::eColDimension) == aCBWM.IsVertical()
    ? eAxisVertical : eAxisHorizontal;
  return nsLayoutUtils::MinISizeContributionForAxis(axis, ....);

with no need for the synthetic writing mode constructor.
Assignee

Comment 7

4 years ago
Attachment #8622125 - Attachment is obsolete: true
Attachment #8622126 - Attachment is obsolete: true
Attachment #8622125 - Flags: review?(jfkthame)
Attachment #8622126 - Flags: review?(jfkthame)
Attachment #8622673 - Flags: review?(jfkthame)
Attachment #8622672 - Flags: review?(jfkthame) → review+
Attachment #8622673 - Flags: review?(jfkthame) → review+
https://hg.mozilla.org/mozilla-central/rev/e0d3670a4209
https://hg.mozilla.org/mozilla-central/rev/526a90883787
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla43
You need to log in before you can comment on or make changes to this bug.