1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:57:45 +00:00

LibWeb: Bring Node closer to spec

Node::base_uri() correct implementation was left as a FIXME.
This commit is contained in:
Igor Pissolati 2022-04-12 13:20:13 -03:00 committed by Andreas Kling
parent e2fa5c0cda
commit 682a4a347a
3 changed files with 11 additions and 0 deletions

View file

@ -78,6 +78,13 @@ Node::~Node()
deallocate_node_id(m_id);
}
// https://dom.spec.whatwg.org/#dom-node-baseuri
String Node::base_uri() const
{
// FIXME: Return thiss node documents document base URL, serialized.
return document().url_string();
}
const HTML::HTMLAnchorElement* Node::enclosing_link_element() const
{
for (auto* node = this; node; node = node->parent()) {

View file

@ -113,6 +113,8 @@ public:
virtual FlyString node_name() const = 0;
String base_uri() const;
String descendant_text_content() const;
String text_content() const;
void set_text_content(String const&);

View file

@ -7,6 +7,8 @@ interface Node : EventTarget {
readonly attribute unsigned short nodeType;
readonly attribute DOMString nodeName;
readonly attribute USVString baseURI;
boolean hasChildNodes();
[SameObject] readonly attribute NodeList childNodes;
readonly attribute Node? firstChild;