Commit 84ac498a authored by Noam Rosenthal's avatar Noam Rosenthal Committed by Commit Bot

Add a UseCounter for inline relative MouseEvent offsets

The UseCounter is counted when offsetX/offsetY/layerX/layerY
is requested, and the target element is rendered inline.

Bug: 1054515
Change-Id: Ie584a9070edce2748537edd06b8b8f2f27efe0c3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2517020Reviewed-by: default avatarChris Harrelson <chrishtr@chromium.org>
Commit-Queue: Chris Harrelson <chrishtr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#823607}
parent 58c2757e
...@@ -3046,7 +3046,7 @@ enum WebFeature { ...@@ -3046,7 +3046,7 @@ enum WebFeature {
kCSSPseudoHostContextCompoundList = 3717, kCSSPseudoHostContextCompoundList = 3717,
kCSSPseudoHostDynamicSpecificity = 3718, kCSSPseudoHostDynamicSpecificity = 3718,
kGetCurrentBrowsingContextMedia = 3719, kGetCurrentBrowsingContextMedia = 3719,
kMouseEventRelativePositionForInlineElement = 3720,
// 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.
// Also, run update_use_counter_feature_enum.py in // Also, run update_use_counter_feature_enum.py in
......
...@@ -491,6 +491,12 @@ void MouseEvent::ComputeRelativePosition() { ...@@ -491,6 +491,12 @@ void MouseEvent::ComputeRelativePosition() {
FloatPoint local_pos = layout_object->AbsoluteToLocalFloatPoint( FloatPoint local_pos = layout_object->AbsoluteToLocalFloatPoint(
FloatPoint(AbsoluteLocation())); FloatPoint(AbsoluteLocation()));
if (layout_object->IsInline()) {
UseCounter::Count(
target_node->GetDocument(),
WebFeature::kMouseEventRelativePositionForInlineElement);
}
// Adding this here to address crbug.com/570666. Basically we'd like to // Adding this here to address crbug.com/570666. Basically we'd like to
// find the local coordinates relative to the padding box not the border // find the local coordinates relative to the padding box not the border
// box. // box.
......
...@@ -30133,6 +30133,7 @@ Called by update_use_counter_feature_enum.py.--> ...@@ -30133,6 +30133,7 @@ Called by update_use_counter_feature_enum.py.-->
<int value="3717" label="CSSPseudoHostContextCompoundList"/> <int value="3717" label="CSSPseudoHostContextCompoundList"/>
<int value="3718" label="CSSPseudoHostDynamicSpecificity"/> <int value="3718" label="CSSPseudoHostDynamicSpecificity"/>
<int value="3719" label="GetCurrentBrowsingContextMedia"/> <int value="3719" label="GetCurrentBrowsingContextMedia"/>
<int value="3720" label="MouseEventRelativePositionForInlineElement"/>
</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