mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
LibWeb: Implement Node::navigable()
https://html.spec.whatwg.org/multipage/document-sequences.html#node-navigable
This commit is contained in:
parent
6e416284b9
commit
22572c39e0
Notes:
sideshowbarker
2024-07-17 08:55:54 +09:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/SerenityOS/serenity/commit/22572c39e0 Pull-request: https://github.com/SerenityOS/serenity/pull/18470
2 changed files with 11 additions and 0 deletions
|
@ -32,6 +32,7 @@
|
|||
#include <LibWeb/HTML/CustomElements/CustomElementReactionNames.h>
|
||||
#include <LibWeb/HTML/HTMLAnchorElement.h>
|
||||
#include <LibWeb/HTML/HTMLStyleElement.h>
|
||||
#include <LibWeb/HTML/Navigable.h>
|
||||
#include <LibWeb/HTML/NavigableContainer.h>
|
||||
#include <LibWeb/HTML/Origin.h>
|
||||
#include <LibWeb/HTML/Parser/HTMLParser.h>
|
||||
|
@ -238,6 +239,14 @@ void Node::set_node_value(DeprecatedString const& value)
|
|||
// Otherwise, do nothing.
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/document-sequences.html#node-navigable
|
||||
JS::GCPtr<HTML::Navigable> Node::navigable() const
|
||||
{
|
||||
// To get the node navigable of a node node, return the navigable whose active document is node's node document,
|
||||
// or null if there is no such navigable.
|
||||
return HTML::Navigable::navigable_with_active_document(const_cast<Document&>(document()));
|
||||
}
|
||||
|
||||
void Node::invalidate_style()
|
||||
{
|
||||
if (is_document()) {
|
||||
|
|
|
@ -135,6 +135,8 @@ public:
|
|||
DeprecatedString node_value() const;
|
||||
void set_node_value(DeprecatedString const&);
|
||||
|
||||
JS::GCPtr<HTML::Navigable> navigable() const;
|
||||
|
||||
Document& document() { return *m_document; }
|
||||
Document const& document() const { return *m_document; }
|
||||
|
||||
|
|
Loading…
Reference in a new issue