mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 21:17:44 +00:00
LibWeb: Make Node::root return a reference
The root of a node can never be null, as "the root of an object is itself, if its parent is null, or else it is the root of its parent." https://dom.spec.whatwg.org/#concept-tree-root
This commit is contained in:
parent
7f46022e66
commit
f7f37eaa0f
5 changed files with 24 additions and 20 deletions
|
@ -113,14 +113,14 @@ public:
|
|||
|
||||
String child_text_content() const;
|
||||
|
||||
Node* root();
|
||||
const Node* root() const
|
||||
Node& root();
|
||||
const Node& root() const
|
||||
{
|
||||
return const_cast<Node*>(this)->root();
|
||||
}
|
||||
|
||||
Node* shadow_including_root();
|
||||
const Node* shadow_including_root() const
|
||||
Node& shadow_including_root();
|
||||
const Node& shadow_including_root() const
|
||||
{
|
||||
return const_cast<Node*>(this)->shadow_including_root();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue