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:
parent
e2fa5c0cda
commit
682a4a347a
3 changed files with 11 additions and 0 deletions
|
@ -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 this’s node document’s document base URL, serialized.
|
||||
return document().url_string();
|
||||
}
|
||||
|
||||
const HTML::HTMLAnchorElement* Node::enclosing_link_element() const
|
||||
{
|
||||
for (auto* node = this; node; node = node->parent()) {
|
||||
|
|
|
@ -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&);
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue