Commit 04970715 authored by Manuel Rego Casasnovas's avatar Manuel Rego Casasnovas Committed by Commit Bot

[css-grid] Add use counter for percentage rows and indefinite height

CSSWG resolved back in January 2017 about how percentage rows
in a grid container with indefinite height work, to make them symmetric
to what happens for columns. Which has been ratified in the last
F2F meeting at TPAC 2017.
All this has been discussed in the following issue:
https://github.com/w3c/csswg-drafts/issues/1921

No browser is doing that right now, so it'd be nice to gather some data
about the usage of this before changing the implementation.
For that reason this patch adds a new use counter to check
when this change will have impact on real websites.

Change-Id: I61b82957d2bfe53912fd3e53a6bd41a6491a67be
Reviewed-on: https://chromium-review.googlesource.com/796855Reviewed-by: default avatarChristian Biesinger <cbiesinger@chromium.org>
Commit-Queue: Manuel Rego Casasnovas <rego@igalia.com>
Cr-Commit-Position: refs/heads/master@{#520213}
parent db71ad94
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include "core/layout/GridTrackSizingAlgorithm.h" #include "core/layout/GridTrackSizingAlgorithm.h"
#include "core/frame/UseCounter.h"
#include "core/layout/Grid.h" #include "core/layout/Grid.h"
#include "core/layout/GridLayoutUtils.h" #include "core/layout/GridLayoutUtils.h"
#include "core/layout/LayoutGrid.h" #include "core/layout/LayoutGrid.h"
...@@ -739,6 +740,14 @@ void GridTrackSizingAlgorithm::InitializeTrackSizes() { ...@@ -739,6 +740,14 @@ void GridTrackSizingAlgorithm::InitializeTrackSizes() {
flexible_sized_tracks_index_.push_back(i); flexible_sized_tracks_index_.push_back(i);
if (track_size.HasAutoMaxTrackBreadth() && !track_size.IsFitContent()) if (track_size.HasAutoMaxTrackBreadth() && !track_size.IsFitContent())
auto_sized_tracks_for_stretch_index_.push_back(i); auto_sized_tracks_for_stretch_index_.push_back(i);
if (direction_ == kForRows &&
!layout_grid_->CachedHasDefiniteLogicalHeight() &&
(track_size.MinTrackBreadth().HasPercentage() ||
track_size.MaxTrackBreadth().HasPercentage())) {
UseCounter::Count(layout_grid_->GetDocument(),
WebFeature::kGridRowTrackPercentIndefiniteHeight);
}
} }
} }
......
...@@ -1766,6 +1766,7 @@ enum WebFeature { ...@@ -1766,6 +1766,7 @@ enum WebFeature {
kHTMLAnchorElementDownloadInSandboxWithUserGesture = 2245, kHTMLAnchorElementDownloadInSandboxWithUserGesture = 2245,
kHTMLAnchorElementDownloadInSandboxWithoutUserGesture = 2246, kHTMLAnchorElementDownloadInSandboxWithoutUserGesture = 2246,
kWindowOpenRealmMismatch = 2247, kWindowOpenRealmMismatch = 2247,
kGridRowTrackPercentIndefiniteHeight = 2248,
// Add new features immediately above this line. Don't change assigned // Add new features immediately above this line. Don't change assigned
// numbers of any item, and don't reuse removed slots. // numbers of any item, and don't reuse removed slots.
......
...@@ -17059,6 +17059,7 @@ Called by update_net_error_codes.py.--> ...@@ -17059,6 +17059,7 @@ Called by update_net_error_codes.py.-->
<int value="2246" <int value="2246"
label="HTMLAnchorElementDownloadInSandboxWithoutUserGesture"/> label="HTMLAnchorElementDownloadInSandboxWithoutUserGesture"/>
<int value="2247" label="WindowOpenRealmMismatch"/> <int value="2247" label="WindowOpenRealmMismatch"/>
<int value="2248" label="GridRowTrackPercentIndefiniteHeight"/>
</enum> </enum>
<enum name="FeedbackSource"> <enum name="FeedbackSource">
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment