Commit 8447db20 authored by Mason Freed's avatar Mason Freed Committed by Commit Bot

Add use counter for Form Associated Custom Elements

Bug: 905922
Change-Id: I0d2331aac15930b21c8ff565d4856050a2aa9ed2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2346968
Commit-Queue: Mason Freed <masonfreed@chromium.org>
Commit-Queue: Joey Arhar <jarhar@chromium.org>
Reviewed-by: default avatarJoey Arhar <jarhar@chromium.org>
Auto-Submit: Mason Freed <masonfreed@chromium.org>
Cr-Commit-Position: refs/heads/master@{#796623}
parent 4dfcf73b
...@@ -2671,6 +2671,8 @@ enum WebFeature { ...@@ -2671,6 +2671,8 @@ enum WebFeature {
kInlineOverflowScrollWithInlineEndPadding = 3336, kInlineOverflowScrollWithInlineEndPadding = 3336,
kCSSSelectorPseudoWebKitDetailsMarker = 3337, kCSSSelectorPseudoWebKitDetailsMarker = 3337,
kSerialPortGetInfo = 3338, kSerialPortGetInfo = 3338,
// The above items are available in M85 branch.
kFileSystemPickerMethod = 3339, kFileSystemPickerMethod = 3339,
kV8Window_ShowOpenFilePicker_Method = 3340, kV8Window_ShowOpenFilePicker_Method = 3340,
kV8Window_ShowSaveFilePicker_Method = 3341, kV8Window_ShowSaveFilePicker_Method = 3341,
...@@ -2699,6 +2701,7 @@ enum WebFeature { ...@@ -2699,6 +2701,7 @@ enum WebFeature {
kConversionRegistration = 3367, kConversionRegistration = 3367,
kWebSharePolicyAllow = 3368, kWebSharePolicyAllow = 3368,
kWebSharePolicyDisallow = 3369, kWebSharePolicyDisallow = 3369,
kFormAssociatedCustomElement = 3370,
// 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.
......
...@@ -212,6 +212,11 @@ CustomElementDefinition* CustomElementRegistry::DefineInternal( ...@@ -212,6 +212,11 @@ CustomElementDefinition* CustomElementRegistry::DefineInternal(
NameIdMap::AddResult result = name_id_map_.insert(descriptor.GetName(), id); NameIdMap::AddResult result = name_id_map_.insert(descriptor.GetName(), id);
CHECK(result.is_new_entry); CHECK(result.is_new_entry);
if (definition->IsFormAssociated()) {
if (Document* document = owner_->document())
UseCounter::Count(*document, WebFeature::kFormAssociatedCustomElement);
}
HeapVector<Member<Element>> candidates; HeapVector<Member<Element>> candidates;
CollectCandidates(descriptor, &candidates); CollectCandidates(descriptor, &candidates);
for (Element* candidate : candidates) for (Element* candidate : candidates)
......
...@@ -28693,6 +28693,7 @@ Called by update_use_counter_feature_enum.py.--> ...@@ -28693,6 +28693,7 @@ Called by update_use_counter_feature_enum.py.-->
<int value="3367" label="ConversionRegistration"/> <int value="3367" label="ConversionRegistration"/>
<int value="3368" label="WebSharePolicyAllow"/> <int value="3368" label="WebSharePolicyAllow"/>
<int value="3369" label="WebSharePolicyDisallow"/> <int value="3369" label="WebSharePolicyDisallow"/>
<int value="3370" label="FormAssociatedCustomElement"/>
</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