mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 19:17:41 +00:00
LibWeb: Check document fully active status in "element cannot navigate"
This resolves a FIXME and brings us closer to spec.
This commit is contained in:
parent
46b8a4cda3
commit
575e3bf37d
1 changed files with 8 additions and 1 deletions
|
@ -196,9 +196,16 @@ int HTMLElement::offset_height() const
|
||||||
return paint_box()->border_box_height();
|
return paint_box()->border_box_height();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// https://html.spec.whatwg.org/multipage/links.html#cannot-navigate
|
||||||
bool HTMLElement::cannot_navigate() const
|
bool HTMLElement::cannot_navigate() const
|
||||||
{
|
{
|
||||||
// FIXME: Return true if element's node document is not fully active
|
// An element element cannot navigate if one of the following is true:
|
||||||
|
|
||||||
|
// - element's node document is not fully active
|
||||||
|
if (!document().is_fully_active())
|
||||||
|
return true;
|
||||||
|
|
||||||
|
// - element is not an a element and is not connected.
|
||||||
return !is<HTML::HTMLAnchorElement>(this) && !is_connected();
|
return !is<HTML::HTMLAnchorElement>(this) && !is_connected();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue