Commit 39c41c20 authored by Ian Kilpatrick's avatar Ian Kilpatrick Committed by Commit Bot

blink: Find out how often a scrollable element has inline-end padding

As above. This adds two use-counters to give us web compat data for:
https://github.com/w3c/csswg-drafts/issues/129

The use counters will trigger if we have non-zero inline-end padding,
and we have block-level children (inline children already account for
padding), and are either "overflow: scroll" or "overflow: auto".

Change-Id: Idcee6d7aa6e5d970874352e82507fc5cce4ecc28
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2261404
Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org>
Reviewed-by: default avatarDavid Grogan <dgrogan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#781586}
parent b2b07a66
...@@ -2669,6 +2669,8 @@ enum WebFeature { ...@@ -2669,6 +2669,8 @@ enum WebFeature {
kContentVisibilityAuto = 3332, kContentVisibilityAuto = 3332,
kContentVisibilityHidden = 3333, kContentVisibilityHidden = 3333,
kContentVisibilityHiddenMatchable = 3334, kContentVisibilityHiddenMatchable = 3334,
kInlineOverflowAutoWithInlineEndPadding = 3335,
kInlineOverflowScrollWithInlineEndPadding = 3336,
// 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.
......
...@@ -503,6 +503,18 @@ void LayoutBlock::ComputeLayoutOverflow(LayoutUnit old_client_after_edge, ...@@ -503,6 +503,18 @@ void LayoutBlock::ComputeLayoutOverflow(LayoutUnit old_client_after_edge,
LayoutUnit(1)); LayoutUnit(1));
AddLayoutOverflow(rect_to_apply); AddLayoutOverflow(rect_to_apply);
SetLayoutClientAfterEdge(old_client_after_edge); SetLayoutClientAfterEdge(old_client_after_edge);
if (PaddingEnd() && !ChildrenInline()) {
EOverflow overflow = StyleRef().OverflowInlineDirection();
if (overflow == EOverflow::kAuto) {
UseCounter::Count(GetDocument(),
WebFeature::kInlineOverflowAutoWithInlineEndPadding);
} else if (overflow == EOverflow::kScroll) {
UseCounter::Count(
GetDocument(),
WebFeature::kInlineOverflowScrollWithInlineEndPadding);
}
}
} }
} }
......
...@@ -28063,6 +28063,8 @@ Called by update_use_counter_feature_enum.py.--> ...@@ -28063,6 +28063,8 @@ Called by update_use_counter_feature_enum.py.-->
<int value="3332" label="ContentVisibilityAuto"/> <int value="3332" label="ContentVisibilityAuto"/>
<int value="3333" label="ContentVisibilityHidden"/> <int value="3333" label="ContentVisibilityHidden"/>
<int value="3334" label="ContentVisibilityHiddenMatchable"/> <int value="3334" label="ContentVisibilityHiddenMatchable"/>
<int value="3335" label="InlineOverflowAutoWithInlineEndPadding"/>
<int value="3336" label="InlineOverflowScrollWithInlineEndPadding"/>
</enum> </enum>
<enum name="FeaturePolicyAllowlistType"> <enum name="FeaturePolicyAllowlistType">
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