LibWeb: Update focusing spec steps

Update a couple of focus-related spec steps and their implementations.
The most relevant change is that we no longer allow focusing on elements
that return false for `->is_focusable()`, which necessitates fixing a
broken test that tried to `.focus()` on `<div>`s that were not
focusable. That test's output now more accurately reflects the expected
outcome as seen in other browsers.
This commit is contained in:
Jelle Raaijmakers 2025-08-22 11:04:24 +02:00 committed by Jelle Raaijmakers
commit 65910dc343
Notes: github-actions[bot] 2025-08-26 08:27:05 +00:00
5 changed files with 79 additions and 71 deletions

View file

@ -26,6 +26,9 @@ public:
virtual GC::Ptr<Layout::Node> create_layout_node(GC::Ref<CSS::ComputedProperties>) override;
virtual void adjust_computed_style(CSS::ComputedProperties&) override;
// ^EventTarget
virtual bool is_focusable() const override { return true; }
void set_current_navigation_was_lazy_loaded(bool value);
Optional<HighResolutionTime::DOMHighResTimeStamp> const& pending_resource_start_time() const { return m_pending_resource_start_time; }