mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
LibWeb: Update Element::directionality() for bdi elements to match spec
This fixes three WPT test cases at html/dom/elements/global-attributes/dir-assorted.window.html Update test expectations for Tests/LibWeb/Text/expected/wpt-import/css/selectors/dir-pseudo-on-bdi-element.txt
This commit is contained in:
Notes:
github-actions[bot]
2025-03-23 08:59:37 +00:00
Author: https://github.com/Noah55-maker 🔰 Commit: https://github.com/LadybirdBrowser/ladybird/commit/add380d6e21 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4031 Reviewed-by: https://github.com/gmta ✅
@@ -3291,10 +3291,18 @@ Element::Directionality Element::directionality() const
|
||||
// -> undefined
|
||||
VERIFY(!maybe_dir.has_value());
|
||||
|
||||
// FIXME: If element is a bdi element:
|
||||
// FIXME: 1. Let result be the auto directionality of element.
|
||||
// FIXME: 2. If result is null, then return 'ltr'.
|
||||
// FIXME: 3. Return result.
|
||||
// If element is a bdi element:
|
||||
if (local_name() == HTML::TagNames::bdi) {
|
||||
// 1. Let result be the auto directionality of element.
|
||||
auto result = auto_directionality();
|
||||
|
||||
// 2. If result is null, then return 'ltr'.
|
||||
if (!result.has_value())
|
||||
return Directionality::Ltr;
|
||||
|
||||
// 3. Return result.
|
||||
return result.release_value();
|
||||
}
|
||||
|
||||
// If element is an input element whose type attribute is in the Telephone state:
|
||||
if (is<HTML::HTMLInputElement>(this) && static_cast<HTML::HTMLInputElement const&>(*this).type_state() == HTML::HTMLInputElement::TypeAttributeState::Telephone) {
|
||||
|
||||
Reference in New Issue
Block a user