LibWeb: Make DOM::Position's node mandatory

We can only construct positions if there's a node involved, which was
already enforced by Position::create() only accepting a GC::Ref.
This commit is contained in:
Jelle Raaijmakers 2025-08-20 11:32:16 +02:00 committed by Tim Ledbetter
parent cd08b3b6f4
commit 51ce46859e
Notes: github-actions[bot] 2025-08-20 11:26:01 +00:00
4 changed files with 10 additions and 14 deletions

View file

@ -477,14 +477,11 @@ Document::Document(JS::Realm& realm, const URL::URL& url, TemporaryDocumentForFr
if (!cursor_position)
return;
auto node = cursor_position->node();
if (!node)
return;
auto navigable = this->navigable();
if (!navigable || !navigable->is_focused())
return;
auto node = cursor_position->node();
node->document().update_layout(UpdateLayoutReason::CursorBlinkTimer);
if (node->paintable()) {