LibWeb: Fix accessible-name computation for pseudo-element content

This change fixes handling for substep ii of the “F. Name From Content”
step at https://w3c.github.io/accname/#step2F in the “Accessible Name
and Description Computation” spec — to correctly include any ::before
and ::after pseudo-element content in the computation of accessible
names. Otherwise, without this change, accessible names unexpectedly
don’t include that pseudo-element content.
This commit is contained in:
sideshowbarker 2024-11-04 14:47:55 +09:00 committed by Andrew Kaster
commit b1587cc60f
Notes: github-actions[bot] 2024-11-11 21:58:09 +00:00
3 changed files with 24 additions and 14 deletions

View file

@ -254,6 +254,7 @@ void TreeBuilder::create_pseudo_element_if_needed(DOM::Element& element, CSS::Se
element.set_pseudo_element_node({}, pseudo_element, pseudo_element_node);
insert_node_into_inline_or_block_ancestor(*pseudo_element_node, pseudo_element_display, mode);
pseudo_element_node->mutable_computed_values().set_content(pseudo_element_content);
}
static bool is_ignorable_whitespace(Layout::Node const& node)