mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-01 06:07:59 +00:00
LibWeb: Add Layout::Node::is_root_element()
This returns true if the layout node corresponds to the <html> element.
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
#include <LibWeb/DOM/Document.h>
|
||||
#include <LibWeb/DOM/Element.h>
|
||||
#include <LibWeb/Dump.h>
|
||||
#include <LibWeb/HTML/HTMLHtmlElement.h>
|
||||
#include <LibWeb/Layout/BlockBox.h>
|
||||
#include <LibWeb/Layout/InitialContainingBlockBox.h>
|
||||
#include <LibWeb/Layout/Node.h>
|
||||
@@ -265,4 +266,11 @@ void Node::handle_mousemove(Badge<EventHandler>, const Gfx::IntPoint&, unsigned,
|
||||
{
|
||||
}
|
||||
|
||||
bool Node::is_root_element() const
|
||||
{
|
||||
if (is_anonymous())
|
||||
return false;
|
||||
return is<HTML::HTMLHtmlElement>(*dom_node());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user