Commit 3906de9d authored by Mason Freed's avatar Mason Freed Committed by Commit Bot

Move declarative Shadow DOM use counter into element.cc

It makes more sense to count this feature at the usage site,
which is Element::AttachDeclarativeShadowRoot.

Bug: 1042130
Change-Id: I53ffbf6821b56e964dc5ab1eae84a0ed566a96e3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2227338
Commit-Queue: Mason Freed <masonfreed@chromium.org>
Commit-Queue: Kouhei Ueno <kouhei@chromium.org>
Auto-Submit: Mason Freed <masonfreed@chromium.org>
Reviewed-by: default avatarKouhei Ueno <kouhei@chromium.org>
Cr-Commit-Position: refs/heads/master@{#774441}
parent bc80b7ae
...@@ -3674,6 +3674,7 @@ void Element::AttachDeclarativeShadowRoot(HTMLTemplateElement* template_element, ...@@ -3674,6 +3674,7 @@ void Element::AttachDeclarativeShadowRoot(HTMLTemplateElement* template_element,
SlotAssignmentMode slot_assignment) { SlotAssignmentMode slot_assignment) {
DCHECK(template_element); DCHECK(template_element);
DCHECK(type == ShadowRootType::kOpen || type == ShadowRootType::kClosed); DCHECK(type == ShadowRootType::kOpen || type == ShadowRootType::kClosed);
UseCounter::Count(GetDocument(), WebFeature::kDeclarativeShadowRoot);
// 12. Run attach a shadow root with shadow host equal to declarative shadow // 12. Run attach a shadow root with shadow host equal to declarative shadow
// host element, mode equal to declarative shadow mode, and delegates focus // host element, mode equal to declarative shadow mode, and delegates focus
......
...@@ -957,8 +957,6 @@ bool HTMLTreeBuilder::ProcessTemplateEndTag(AtomicHTMLToken* token) { ...@@ -957,8 +957,6 @@ bool HTMLTreeBuilder::ProcessTemplateEndTag(AtomicHTMLToken* token) {
shadow_host_stack_item->GetNode() != tree_.OpenElements()->RootNode()) { shadow_host_stack_item->GetNode() != tree_.OpenElements()->RootNode()) {
DCHECK(shadow_host_stack_item); DCHECK(shadow_host_stack_item);
DCHECK(shadow_host_stack_item->IsElementNode()); DCHECK(shadow_host_stack_item->IsElementNode());
UseCounter::Count(shadow_host_stack_item->GetElement()->GetDocument(),
WebFeature::kDeclarativeShadowRoot);
bool delegates_focus = template_stack_item->GetAttributeItem( bool delegates_focus = template_stack_item->GetAttributeItem(
html_names::kShadowrootdelegatesfocusAttr); html_names::kShadowrootdelegatesfocusAttr);
// TODO(crbug.com/1063157): Add an attribute for imperative slot // TODO(crbug.com/1063157): Add an attribute for imperative slot
......
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