diff --git a/third_party/blink/renderer/modules/accessibility/ax_object.cc b/third_party/blink/renderer/modules/accessibility/ax_object.cc index d5d6120c6a328..873391bfc3b4b 100644 --- a/third_party/blink/renderer/modules/accessibility/ax_object.cc +++ b/third_party/blink/renderer/modules/accessibility/ax_object.cc @@ -1004,9 +1004,13 @@ bool AXObject::CanHaveChildren(Element& element) { // so there's no need to add its text children. Placeholder text is a separate // node that gets removed when it disappears, so this will only be present if // the placeholder is visible. - if (element.ShadowPseudoId() == - shadow_element_names::kPseudoInputPlaceholder) { - return false; + if (Element* host = element.OwnerShadowHost()) { + if (auto* ancestor_input = DynamicTo(host)) { + if (ancestor_input->PlaceholderElement() == &element) { + // |element| is a placeholder. + return false; + } + } } if (IsA(element)) {