Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[css-grid] Fix resolution of percentage paddings and margins of grid items #10194

Merged
merged 1 commit into from Apr 2, 2018

Commits on Apr 2, 2018

  1. [css-grid] Fix resolution of percentage paddings and margins of grid …

    …items
    
    We were not resolving properly percentage paddings and margins
    for tracks that have something like minmax(auto, 100px).
    The reason was that while computing the minimum size of a grid item,
    the percentages were resolved against the inline size of the grid container.
    But for grid items we shouldn't never use the grid container size,
    but the grid area size, as that's their containing block.
    
    The patch modifies ContainingBlockLogicalWidthForContent() and
    ContainingBlockLogicalHeightForContent() in LayoutBox,
    so for grid items we return 0 if the area size hasn't been set yet.
    We never want to use the grid container's sizes in these cases.
    
    BUG=808758
    TEST=external/wpt/css/css-grid/grid-items/grid-items-percentage-margins-*
    TEST=external/wpt/css/css-grid/grid-items/grid-items-percentage-paddings-*
    
    Change-Id: Ib142e51aee1fe623d38688469b179f01f82eb07b
    Reviewed-on: https://chromium-review.googlesource.com/980756
    Reviewed-by: Javier Fernandez <jfernandez@igalia.com>
    Commit-Queue: Manuel Rego Casasnovas <rego@igalia.com>
    Cr-Commit-Position: refs/heads/master@{#547417}
    mrego authored and chromium-wpt-export-bot committed Apr 2, 2018
    Copy the full SHA
    687aa08 View commit details
    Browse the repository at this point in the history