Commit 6611e924 authored by Xianzhu Wang's avatar Xianzhu Wang Committed by Commit Bot

Add UMA for custom scrollbar buttons in reversed direction

We support custom scrollbar buttons in reversed direction (e.g. the
backward scroll button at the bottom of a vertical scrollbar with
-webkit-scrollbar-button:decrement:end). Count it to see if we can
remove it to reduce complexity of custom scrollbars.

Bug: 1009063
Change-Id: If54d8c0deaae44cc9e40a21c55dfbe0e6c3b48a4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1830217
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Reviewed-by: default avatarPhilip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#700907}
parent b8f66689
......@@ -2408,15 +2408,19 @@ enum WebFeature {
kDeprecatedFileSystemRead = 3025,
kDeprecatedFileSystemWrite = 3026,
kPointerLockUnadjustedMovement = 3027,
// The above items are available in M78 branch.
kCreateObjectBlob = 3028,
kQuotaRead = 3029,
kQuotaRead = 3029, // available in M78 branch.
kDelegateFocus = 3030,
kDelegateFocusNotFirstInFlatTree = 3031,
kThirdPartySharedWorker = 3032,
kThirdPartyBroadcastChannel = 3033,
kMediaSourceGroupEndTimestampDecreaseWithinMediaSegment = 3034,
kTextFragmentAnchorTapToDismiss = 3035,
kTextFragmentAnchorTapToDismiss = 3035, // available in M78 branch.
kXRIsSessionSupported = 3036,
kScrollbarUseScrollbarButtonReversedDirection = 3037,
kCSSSelectorPseudoScrollbarButtonReversedDirection = 3038,
// Add new features immediately above this line. Don't change assigned
// numbers of any item, and don't reuse removed slots.
......
......@@ -47,9 +47,13 @@ LayoutScrollbarPart::LayoutScrollbarPart(ScrollableArea* scrollable_area,
static void RecordScrollbarPartStats(Document& document, ScrollbarPart part) {
switch (part) {
case kBackButtonStartPart:
case kForwardButtonStartPart:
case kBackButtonEndPart:
case kForwardButtonStartPart:
UseCounter::Count(
document,
WebFeature::kCSSSelectorPseudoScrollbarButtonReversedDirection);
U_FALLTHROUGH;
case kBackButtonStartPart:
case kForwardButtonEndPart:
UseCounter::Count(document,
WebFeature::kCSSSelectorPseudoScrollbarButton);
......
......@@ -2839,9 +2839,13 @@ void PaintLayerScrollableArea::DidScrollWithScrollbar(
WebInputEvent::Type type) {
WebFeature scrollbar_use_uma;
switch (part) {
case kBackButtonStartPart:
case kForwardButtonStartPart:
case kBackButtonEndPart:
case kForwardButtonStartPart:
UseCounter::Count(
GetLayoutBox()->GetDocument(),
WebFeature::kScrollbarUseScrollbarButtonReversedDirection);
U_FALLTHROUGH;
case kBackButtonStartPart:
case kForwardButtonEndPart:
scrollbar_use_uma =
(orientation == kVerticalScrollbar
......
......@@ -24752,6 +24752,8 @@ Called by update_net_error_codes.py.-->
label="MediaSourceGroupEndTimestampDecreaseWithinMediaSegment"/>
<int value="3035" label="TextFragmentAnchorTapToDismiss"/>
<int value="3036" label="XRIsSessionSupported"/>
<int value="3037" label="ScrollbarUseScrollbarButtonReversedDirection"/>
<int value="3038" label="CSSSelectorPseudoScrollbarButtonReversedDirection"/>
</enum>
<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