mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 10:28:10 +00:00
LibWeb: Port Node interface from DeprecatedString to String
Which is fortunately quite straight forward :^)
This commit is contained in:
parent
a76ef04ae6
commit
8ce9e51c97
21 changed files with 50 additions and 45 deletions
|
@ -24,7 +24,7 @@ public:
|
||||||
|
|
||||||
virtual ~Attr() override = default;
|
virtual ~Attr() override = default;
|
||||||
|
|
||||||
virtual DeprecatedFlyString node_name() const override { return name(); }
|
virtual FlyString node_name() const override { return MUST(FlyString::from_deprecated_fly_string(name())); }
|
||||||
|
|
||||||
DeprecatedFlyString const& namespace_uri() const { return m_qualified_name.namespace_(); }
|
DeprecatedFlyString const& namespace_uri() const { return m_qualified_name.namespace_(); }
|
||||||
DeprecatedFlyString const& prefix() const { return m_qualified_name.prefix(); }
|
DeprecatedFlyString const& prefix() const { return m_qualified_name.prefix(); }
|
||||||
|
|
|
@ -18,7 +18,7 @@ public:
|
||||||
virtual ~CDATASection() override;
|
virtual ~CDATASection() override;
|
||||||
|
|
||||||
// ^Node
|
// ^Node
|
||||||
virtual DeprecatedFlyString node_name() const override { return "#cdata-section"; }
|
virtual FlyString node_name() const override { return "#cdata-section"_fly_string; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CDATASection(Document&, String const&);
|
CDATASection(Document&, String const&);
|
||||||
|
|
|
@ -18,7 +18,7 @@ public:
|
||||||
static WebIDL::ExceptionOr<JS::NonnullGCPtr<Comment>> construct_impl(JS::Realm&, String const& data);
|
static WebIDL::ExceptionOr<JS::NonnullGCPtr<Comment>> construct_impl(JS::Realm&, String const& data);
|
||||||
virtual ~Comment() override = default;
|
virtual ~Comment() override = default;
|
||||||
|
|
||||||
virtual DeprecatedFlyString node_name() const override { return "#comment"; }
|
virtual FlyString node_name() const override { return "#comment"_fly_string; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Comment(Document&, String const&);
|
Comment(Document&, String const&);
|
||||||
|
|
|
@ -706,7 +706,7 @@ DeprecatedString Document::title() const
|
||||||
// 2. Otherwise, let value be the child text content of the title element, or the empty string if the title element
|
// 2. Otherwise, let value be the child text content of the title element, or the empty string if the title element
|
||||||
// is null.
|
// is null.
|
||||||
else if (auto title_element = this->title_element()) {
|
else if (auto title_element = this->title_element()) {
|
||||||
value = title_element->text_content();
|
value = title_element->text_content().value_or(String {}).to_deprecated_string();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 3. Strip and collapse ASCII whitespace in value.
|
// 3. Strip and collapse ASCII whitespace in value.
|
||||||
|
|
|
@ -130,7 +130,7 @@ public:
|
||||||
|
|
||||||
CSS::StyleSheetList* style_sheets_for_bindings() { return &style_sheets(); }
|
CSS::StyleSheetList* style_sheets_for_bindings() { return &style_sheets(); }
|
||||||
|
|
||||||
virtual DeprecatedFlyString node_name() const override { return "#document"; }
|
virtual FlyString node_name() const override { return "#document"_fly_string; }
|
||||||
|
|
||||||
void set_hovered_node(Node*);
|
void set_hovered_node(Node*);
|
||||||
Node* hovered_node() { return m_hovered_node.ptr(); }
|
Node* hovered_node() { return m_hovered_node.ptr(); }
|
||||||
|
|
|
@ -23,7 +23,7 @@ public:
|
||||||
|
|
||||||
virtual ~DocumentFragment() override = default;
|
virtual ~DocumentFragment() override = default;
|
||||||
|
|
||||||
virtual DeprecatedFlyString node_name() const override { return "#document-fragment"; }
|
virtual FlyString node_name() const override { return "#document-fragment"_fly_string; }
|
||||||
|
|
||||||
Element* host() { return m_host.ptr(); }
|
Element* host() { return m_host.ptr(); }
|
||||||
Element const* host() const { return m_host.ptr(); }
|
Element const* host() const { return m_host.ptr(); }
|
||||||
|
|
|
@ -23,7 +23,7 @@ public:
|
||||||
|
|
||||||
virtual ~DocumentType() override = default;
|
virtual ~DocumentType() override = default;
|
||||||
|
|
||||||
virtual DeprecatedFlyString node_name() const override { return "#doctype"; }
|
virtual FlyString node_name() const override { return "#doctype"_fly_string; }
|
||||||
|
|
||||||
String const& name() const { return m_name; }
|
String const& name() const { return m_name; }
|
||||||
void set_name(String const& name) { m_name = name; }
|
void set_name(String const& name) { m_name = name; }
|
||||||
|
|
|
@ -76,7 +76,7 @@ public:
|
||||||
|
|
||||||
DeprecatedFlyString const& qualified_name() const { return m_qualified_name.as_string(); }
|
DeprecatedFlyString const& qualified_name() const { return m_qualified_name.as_string(); }
|
||||||
DeprecatedString const& html_uppercased_qualified_name() const { return m_html_uppercased_qualified_name; }
|
DeprecatedString const& html_uppercased_qualified_name() const { return m_html_uppercased_qualified_name; }
|
||||||
virtual DeprecatedFlyString node_name() const final { return html_uppercased_qualified_name(); }
|
virtual FlyString node_name() const final { return MUST(FlyString::from_deprecated_fly_string(html_uppercased_qualified_name())); }
|
||||||
DeprecatedFlyString const& local_name() const { return m_qualified_name.local_name(); }
|
DeprecatedFlyString const& local_name() const { return m_qualified_name.local_name(); }
|
||||||
|
|
||||||
// NOTE: This is for the JS bindings
|
// NOTE: This is for the JS bindings
|
||||||
|
|
|
@ -108,10 +108,10 @@ void Node::visit_edges(Cell::Visitor& visitor)
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://dom.spec.whatwg.org/#dom-node-baseuri
|
// https://dom.spec.whatwg.org/#dom-node-baseuri
|
||||||
DeprecatedString Node::base_uri() const
|
String Node::base_uri() const
|
||||||
{
|
{
|
||||||
// Return this’s node document’s document base URL, serialized.
|
// Return this’s node document’s document base URL, serialized.
|
||||||
return document().base_url().to_deprecated_string();
|
return MUST(document().base_url().to_string());
|
||||||
}
|
}
|
||||||
|
|
||||||
const HTML::HTMLAnchorElement* Node::enclosing_link_element() const
|
const HTML::HTMLAnchorElement* Node::enclosing_link_element() const
|
||||||
|
@ -141,18 +141,18 @@ const HTML::HTMLElement* Node::enclosing_html_element_with_attribute(DeprecatedF
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://dom.spec.whatwg.org/#concept-descendant-text-content
|
// https://dom.spec.whatwg.org/#concept-descendant-text-content
|
||||||
DeprecatedString Node::descendant_text_content() const
|
String Node::descendant_text_content() const
|
||||||
{
|
{
|
||||||
StringBuilder builder;
|
StringBuilder builder;
|
||||||
for_each_in_subtree_of_type<Text>([&](auto& text_node) {
|
for_each_in_subtree_of_type<Text>([&](auto& text_node) {
|
||||||
builder.append(text_node.data());
|
builder.append(text_node.data());
|
||||||
return IterationDecision::Continue;
|
return IterationDecision::Continue;
|
||||||
});
|
});
|
||||||
return builder.to_deprecated_string();
|
return MUST(builder.to_string());
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://dom.spec.whatwg.org/#dom-node-textcontent
|
// https://dom.spec.whatwg.org/#dom-node-textcontent
|
||||||
DeprecatedString Node::text_content() const
|
Optional<String> Node::text_content() const
|
||||||
{
|
{
|
||||||
// The textContent getter steps are to return the following, switching on the interface this implements:
|
// The textContent getter steps are to return the following, switching on the interface this implements:
|
||||||
|
|
||||||
|
@ -162,21 +162,22 @@ DeprecatedString Node::text_content() const
|
||||||
|
|
||||||
// If CharacterData, return this’s data.
|
// If CharacterData, return this’s data.
|
||||||
if (is<CharacterData>(this))
|
if (is<CharacterData>(this))
|
||||||
return static_cast<CharacterData const&>(*this).data();
|
return MUST(String::from_deprecated_string(static_cast<CharacterData const&>(*this).data()));
|
||||||
|
|
||||||
// If Attr node, return this's value.
|
// If Attr node, return this's value.
|
||||||
if (is<Attr>(*this))
|
if (is<Attr>(*this))
|
||||||
return static_cast<Attr const&>(*this).value();
|
return MUST(String::from_deprecated_string(static_cast<Attr const&>(*this).value()));
|
||||||
|
|
||||||
// Otherwise, return null
|
// Otherwise, return null
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://dom.spec.whatwg.org/#ref-for-dom-node-textcontent%E2%91%A0
|
// https://dom.spec.whatwg.org/#ref-for-dom-node-textcontent%E2%91%A0
|
||||||
void Node::set_text_content(DeprecatedString const& content)
|
void Node::set_text_content(Optional<String> const& maybe_content)
|
||||||
{
|
{
|
||||||
// The textContent setter steps are to, if the given value is null, act as if it was the empty string instead,
|
// The textContent setter steps are to, if the given value is null, act as if it was the empty string instead,
|
||||||
// and then do as described below, switching on the interface this implements:
|
// and then do as described below, switching on the interface this implements:
|
||||||
|
auto content = maybe_content.value_or(String {}).to_deprecated_string();
|
||||||
|
|
||||||
// If DocumentFragment or Element, string replace all with the given value within this.
|
// If DocumentFragment or Element, string replace all with the given value within this.
|
||||||
if (is<DocumentFragment>(this) || is<Element>(this)) {
|
if (is<DocumentFragment>(this) || is<Element>(this)) {
|
||||||
|
@ -205,18 +206,18 @@ void Node::set_text_content(DeprecatedString const& content)
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://dom.spec.whatwg.org/#dom-node-nodevalue
|
// https://dom.spec.whatwg.org/#dom-node-nodevalue
|
||||||
DeprecatedString Node::node_value() const
|
Optional<String> Node::node_value() const
|
||||||
{
|
{
|
||||||
// The nodeValue getter steps are to return the following, switching on the interface this implements:
|
// The nodeValue getter steps are to return the following, switching on the interface this implements:
|
||||||
|
|
||||||
// If Attr, return this’s value.
|
// If Attr, return this’s value.
|
||||||
if (is<Attr>(this)) {
|
if (is<Attr>(this)) {
|
||||||
return verify_cast<Attr>(this)->value();
|
return MUST(String::from_deprecated_string(verify_cast<Attr>(this)->value()));
|
||||||
}
|
}
|
||||||
|
|
||||||
// If CharacterData, return this’s data.
|
// If CharacterData, return this’s data.
|
||||||
if (is<CharacterData>(this)) {
|
if (is<CharacterData>(this)) {
|
||||||
return verify_cast<CharacterData>(this)->data();
|
return MUST(String::from_deprecated_string(verify_cast<CharacterData>(this)->data()));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Otherwise, return null.
|
// Otherwise, return null.
|
||||||
|
@ -224,17 +225,18 @@ DeprecatedString Node::node_value() const
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://dom.spec.whatwg.org/#ref-for-dom-node-nodevalue%E2%91%A0
|
// https://dom.spec.whatwg.org/#ref-for-dom-node-nodevalue%E2%91%A0
|
||||||
void Node::set_node_value(DeprecatedString const& value)
|
void Node::set_node_value(Optional<String> const& maybe_value)
|
||||||
{
|
{
|
||||||
// The nodeValue setter steps are to, if the given value is null, act as if it was the empty string instead,
|
// The nodeValue setter steps are to, if the given value is null, act as if it was the empty string instead,
|
||||||
// and then do as described below, switching on the interface this implements:
|
// and then do as described below, switching on the interface this implements:
|
||||||
|
auto value = maybe_value.value_or(String {});
|
||||||
|
|
||||||
// If Attr, set an existing attribute value with this and the given value.
|
// If Attr, set an existing attribute value with this and the given value.
|
||||||
if (is<Attr>(this)) {
|
if (is<Attr>(this)) {
|
||||||
verify_cast<Attr>(this)->set_value(value);
|
verify_cast<Attr>(this)->set_value(value.to_deprecated_string());
|
||||||
} else if (is<CharacterData>(this)) {
|
} else if (is<CharacterData>(this)) {
|
||||||
// If CharacterData, replace data with node this, offset 0, count this’s length, and data the given value.
|
// If CharacterData, replace data with node this, offset 0, count this’s length, and data the given value.
|
||||||
verify_cast<CharacterData>(this)->set_data(value);
|
verify_cast<CharacterData>(this)->set_data(value.to_deprecated_string());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Otherwise, do nothing.
|
// Otherwise, do nothing.
|
||||||
|
@ -281,8 +283,11 @@ DeprecatedString Node::child_text_content() const
|
||||||
|
|
||||||
StringBuilder builder;
|
StringBuilder builder;
|
||||||
verify_cast<ParentNode>(*this).for_each_child([&](auto& child) {
|
verify_cast<ParentNode>(*this).for_each_child([&](auto& child) {
|
||||||
if (is<Text>(child))
|
if (is<Text>(child)) {
|
||||||
builder.append(verify_cast<Text>(child).text_content());
|
auto maybe_content = verify_cast<Text>(child).text_content();
|
||||||
|
if (maybe_content.has_value())
|
||||||
|
builder.append(maybe_content.value());
|
||||||
|
}
|
||||||
});
|
});
|
||||||
return builder.to_deprecated_string();
|
return builder.to_deprecated_string();
|
||||||
}
|
}
|
||||||
|
@ -1149,7 +1154,7 @@ bool Node::is_uninteresting_whitespace_node() const
|
||||||
|
|
||||||
void Node::serialize_tree_as_json(JsonObjectSerializer<StringBuilder>& object) const
|
void Node::serialize_tree_as_json(JsonObjectSerializer<StringBuilder>& object) const
|
||||||
{
|
{
|
||||||
MUST(object.add("name"sv, node_name().view()));
|
MUST(object.add("name"sv, node_name()));
|
||||||
MUST(object.add("id"sv, id()));
|
MUST(object.add("id"sv, id()));
|
||||||
if (is_document()) {
|
if (is_document()) {
|
||||||
MUST(object.add("type"sv, "document"));
|
MUST(object.add("type"sv, "document"));
|
||||||
|
@ -1465,7 +1470,7 @@ JS::NonnullGCPtr<Node> Node::get_root_node(GetRootNodeOptions const& options)
|
||||||
DeprecatedString Node::debug_description() const
|
DeprecatedString Node::debug_description() const
|
||||||
{
|
{
|
||||||
StringBuilder builder;
|
StringBuilder builder;
|
||||||
builder.append(node_name().to_lowercase());
|
builder.append(node_name().to_deprecated_fly_string().to_lowercase());
|
||||||
if (is_element()) {
|
if (is_element()) {
|
||||||
auto& element = static_cast<DOM::Element const&>(*this);
|
auto& element = static_cast<DOM::Element const&>(*this);
|
||||||
if (auto id = element.get_attribute(HTML::AttributeNames::id); !id.is_null())
|
if (auto id = element.get_attribute(HTML::AttributeNames::id); !id.is_null())
|
||||||
|
|
|
@ -136,16 +136,16 @@ public:
|
||||||
JS::NonnullGCPtr<NodeList> child_nodes();
|
JS::NonnullGCPtr<NodeList> child_nodes();
|
||||||
Vector<JS::Handle<Node>> children_as_vector() const;
|
Vector<JS::Handle<Node>> children_as_vector() const;
|
||||||
|
|
||||||
virtual DeprecatedFlyString node_name() const = 0;
|
virtual FlyString node_name() const = 0;
|
||||||
|
|
||||||
DeprecatedString base_uri() const;
|
String base_uri() const;
|
||||||
|
|
||||||
DeprecatedString descendant_text_content() const;
|
String descendant_text_content() const;
|
||||||
DeprecatedString text_content() const;
|
Optional<String> text_content() const;
|
||||||
void set_text_content(DeprecatedString const&);
|
void set_text_content(Optional<String> const&);
|
||||||
|
|
||||||
DeprecatedString node_value() const;
|
Optional<String> node_value() const;
|
||||||
void set_node_value(DeprecatedString const&);
|
void set_node_value(Optional<String> const&);
|
||||||
|
|
||||||
JS::GCPtr<HTML::Navigable> navigable() const;
|
JS::GCPtr<HTML::Navigable> navigable() const;
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
#import <DOM/EventTarget.idl>
|
#import <DOM/EventTarget.idl>
|
||||||
|
|
||||||
// https://dom.spec.whatwg.org/#node
|
// https://dom.spec.whatwg.org/#node
|
||||||
[Exposed=Window, UseDeprecatedAKString]
|
[Exposed=Window]
|
||||||
interface Node : EventTarget {
|
interface Node : EventTarget {
|
||||||
|
|
||||||
readonly attribute unsigned short nodeType;
|
readonly attribute unsigned short nodeType;
|
||||||
|
|
|
@ -17,7 +17,7 @@ class ProcessingInstruction final : public CharacterData {
|
||||||
public:
|
public:
|
||||||
virtual ~ProcessingInstruction() override = default;
|
virtual ~ProcessingInstruction() override = default;
|
||||||
|
|
||||||
virtual DeprecatedFlyString node_name() const override { return m_target; }
|
virtual FlyString node_name() const override { return MUST(FlyString::from_deprecated_fly_string(m_target)); }
|
||||||
|
|
||||||
DeprecatedString const& target() const { return m_target; }
|
DeprecatedString const& target() const { return m_target; }
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ private:
|
||||||
virtual void initialize(JS::Realm&) override;
|
virtual void initialize(JS::Realm&) override;
|
||||||
|
|
||||||
// ^Node
|
// ^Node
|
||||||
virtual DeprecatedFlyString node_name() const override { return "#shadow-root"; }
|
virtual FlyString node_name() const override { return "#shadow-root"_fly_string; }
|
||||||
virtual bool is_shadow_root() const final { return true; }
|
virtual bool is_shadow_root() const final { return true; }
|
||||||
|
|
||||||
// NOTE: The specification doesn't seem to specify a default value for mode. Assuming closed for now.
|
// NOTE: The specification doesn't seem to specify a default value for mode. Assuming closed for now.
|
||||||
|
|
|
@ -51,7 +51,7 @@ void StyleElementUtils::update_a_style_block(DOM::Element& style_element)
|
||||||
|
|
||||||
// FIXME: This is a bit awkward, as the spec doesn't actually tell us when to parse the CSS text,
|
// FIXME: This is a bit awkward, as the spec doesn't actually tell us when to parse the CSS text,
|
||||||
// so we just do it here and pass the parsed sheet to create_a_css_style_sheet().
|
// so we just do it here and pass the parsed sheet to create_a_css_style_sheet().
|
||||||
auto* sheet = parse_css_stylesheet(CSS::Parser::ParsingContext(style_element.document()), style_element.text_content());
|
auto* sheet = parse_css_stylesheet(CSS::Parser::ParsingContext(style_element.document()), style_element.text_content().value_or(String {}));
|
||||||
if (!sheet)
|
if (!sheet)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ public:
|
||||||
static WebIDL::ExceptionOr<JS::NonnullGCPtr<Text>> construct_impl(JS::Realm& realm, String const& data);
|
static WebIDL::ExceptionOr<JS::NonnullGCPtr<Text>> construct_impl(JS::Realm& realm, String const& data);
|
||||||
|
|
||||||
// ^Node
|
// ^Node
|
||||||
virtual DeprecatedFlyString node_name() const override { return "#text"; }
|
virtual FlyString node_name() const override { return "#text"_fly_string; }
|
||||||
virtual bool is_editable() const override { return m_always_editable || CharacterData::is_editable(); }
|
virtual bool is_editable() const override { return m_always_editable || CharacterData::is_editable(); }
|
||||||
|
|
||||||
void set_always_editable(bool b) { m_always_editable = b; }
|
void set_always_editable(bool b) { m_always_editable = b; }
|
||||||
|
|
|
@ -144,7 +144,7 @@ void dump_tree(StringBuilder& builder, Layout::Node const& layout_node, bool sho
|
||||||
else if (is<DOM::Element>(layout_node.dom_node()))
|
else if (is<DOM::Element>(layout_node.dom_node()))
|
||||||
tag_name = verify_cast<DOM::Element>(*layout_node.dom_node()).local_name();
|
tag_name = verify_cast<DOM::Element>(*layout_node.dom_node()).local_name();
|
||||||
else
|
else
|
||||||
tag_name = layout_node.dom_node()->node_name();
|
tag_name = layout_node.dom_node()->node_name().to_deprecated_fly_string();
|
||||||
|
|
||||||
DeprecatedString identifier = "";
|
DeprecatedString identifier = "";
|
||||||
if (layout_node.dom_node() && is<DOM::Element>(*layout_node.dom_node())) {
|
if (layout_node.dom_node() && is<DOM::Element>(*layout_node.dom_node())) {
|
||||||
|
|
|
@ -108,7 +108,7 @@ Optional<ARIA::Role> HTMLAnchorElement::default_role() const
|
||||||
String HTMLAnchorElement::text() const
|
String HTMLAnchorElement::text() const
|
||||||
{
|
{
|
||||||
// The text attribute's getter must return this element's descendant text content.
|
// The text attribute's getter must return this element's descendant text content.
|
||||||
return MUST(String::from_deprecated_string(descendant_text_content()));
|
return descendant_text_content();
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/multipage/text-level-semantics.html#dom-a-text
|
// https://html.spec.whatwg.org/multipage/text-level-semantics.html#dom-a-text
|
||||||
|
|
|
@ -137,7 +137,7 @@ String HTMLElement::inner_text()
|
||||||
// innerText for element being rendered takes visibility into account, so force a layout and then walk the layout tree.
|
// innerText for element being rendered takes visibility into account, so force a layout and then walk the layout tree.
|
||||||
document().update_layout();
|
document().update_layout();
|
||||||
if (!layout_node())
|
if (!layout_node())
|
||||||
return MUST(String::from_deprecated_string(text_content()));
|
return text_content().value_or(String {});
|
||||||
|
|
||||||
Function<void(Layout::Node const&)> recurse = [&](auto& node) {
|
Function<void(Layout::Node const&)> recurse = [&](auto& node) {
|
||||||
for (auto* child = node.first_child(); child; child = child->next_sibling()) {
|
for (auto* child = node.first_child(); child; child = child->next_sibling()) {
|
||||||
|
|
|
@ -106,7 +106,7 @@ void HTMLTextAreaElement::create_shadow_tree_if_needed()
|
||||||
m_text_node->set_editable_text_node_owner(Badge<HTMLTextAreaElement> {}, *this);
|
m_text_node->set_editable_text_node_owner(Badge<HTMLTextAreaElement> {}, *this);
|
||||||
// NOTE: If `children_changed()` was called before now, `m_raw_value` will hold the text content.
|
// NOTE: If `children_changed()` was called before now, `m_raw_value` will hold the text content.
|
||||||
// Otherwise, it will get filled in whenever that does get called.
|
// Otherwise, it will get filled in whenever that does get called.
|
||||||
m_text_node->set_text_content(m_raw_value);
|
m_text_node->set_text_content(MUST(String::from_deprecated_string(m_raw_value)));
|
||||||
|
|
||||||
MUST(m_inner_text_element->append_child(*m_text_node));
|
MUST(m_inner_text_element->append_child(*m_text_node));
|
||||||
MUST(element->append_child(*m_inner_text_element));
|
MUST(element->append_child(*m_inner_text_element));
|
||||||
|
@ -122,7 +122,7 @@ void HTMLTextAreaElement::children_changed()
|
||||||
if (!m_dirty) {
|
if (!m_dirty) {
|
||||||
m_raw_value = child_text_content();
|
m_raw_value = child_text_content();
|
||||||
if (m_text_node)
|
if (m_text_node)
|
||||||
m_text_node->set_text_content(m_raw_value);
|
m_text_node->set_text_content(MUST(String::from_deprecated_string(m_raw_value)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,7 @@ void XMLDocumentBuilder::element_start(const XML::Name& name, HashMap<XML::Name,
|
||||||
script_element.set_parser_document(Badge<XMLDocumentBuilder> {}, m_document);
|
script_element.set_parser_document(Badge<XMLDocumentBuilder> {}, m_document);
|
||||||
script_element.set_force_async(Badge<XMLDocumentBuilder> {}, false);
|
script_element.set_force_async(Badge<XMLDocumentBuilder> {}, false);
|
||||||
}
|
}
|
||||||
if (HTML::TagNames::template_ == m_current_node->node_name()) {
|
if (HTML::TagNames::template_ == m_current_node->node_name().to_deprecated_fly_string()) {
|
||||||
// When an XML parser would append a node to a template element, it must instead append it to the template element's template contents (a DocumentFragment node).
|
// When an XML parser would append a node to a template element, it must instead append it to the template element's template contents (a DocumentFragment node).
|
||||||
MUST(static_cast<HTML::HTMLTemplateElement&>(*m_current_node).content()->append_child(node));
|
MUST(static_cast<HTML::HTMLTemplateElement&>(*m_current_node).content()->append_child(node));
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -1164,7 +1164,7 @@ Messages::WebDriverClient::GetElementTextResponse WebDriverConnection::get_eleme
|
||||||
auto rendered_text = element->text_content();
|
auto rendered_text = element->text_content();
|
||||||
|
|
||||||
// 5. Return success with data rendered text.
|
// 5. Return success with data rendered text.
|
||||||
return rendered_text;
|
return rendered_text.value_or(String {}).to_deprecated_string();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 12.4.6 Get Element Tag Name, https://w3c.github.io/webdriver/#dfn-get-element-tag-name
|
// 12.4.6 Get Element Tag Name, https://w3c.github.io/webdriver/#dfn-get-element-tag-name
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue