mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-06 19:22:53 +00:00
LibWeb: Add a non-DeprecatedString version of Element::prefix()
Renaming the old DeprecatedString version of this function to deprecated_prefix().
This commit is contained in:
parent
e5e4920e66
commit
ebe01b51c8
Notes:
sideshowbarker
2024-07-16 16:23:32 +09:00
Author: https://github.com/shannonbooth
Commit: ebe01b51c8
Pull-request: https://github.com/SerenityOS/serenity/pull/21283
4 changed files with 6 additions and 4 deletions
|
@ -83,7 +83,9 @@ public:
|
||||||
// NOTE: This is for the JS bindings
|
// NOTE: This is for the JS bindings
|
||||||
DeprecatedString const& tag_name() const { return html_uppercased_qualified_name(); }
|
DeprecatedString const& tag_name() const { return html_uppercased_qualified_name(); }
|
||||||
|
|
||||||
DeprecatedFlyString prefix() const { return m_qualified_name.deprecated_prefix(); }
|
Optional<FlyString> const& prefix() const { return m_qualified_name.prefix(); }
|
||||||
|
DeprecatedFlyString deprecated_prefix() const { return m_qualified_name.deprecated_prefix(); }
|
||||||
|
|
||||||
void set_prefix(DeprecatedFlyString const& value);
|
void set_prefix(DeprecatedFlyString const& value);
|
||||||
|
|
||||||
DeprecatedFlyString namespace_() const { return m_qualified_name.deprecated_namespace_(); }
|
DeprecatedFlyString namespace_() const { return m_qualified_name.deprecated_namespace_(); }
|
||||||
|
|
|
@ -24,7 +24,7 @@ dictionary ScrollIntoViewOptions : ScrollOptions {
|
||||||
[Exposed=Window, UseDeprecatedAKString]
|
[Exposed=Window, UseDeprecatedAKString]
|
||||||
interface Element : Node {
|
interface Element : Node {
|
||||||
readonly attribute DOMString? namespaceURI;
|
readonly attribute DOMString? namespaceURI;
|
||||||
readonly attribute DOMString? prefix;
|
[ImplementedAs=deprecated_prefix] readonly attribute DOMString? prefix;
|
||||||
readonly attribute DOMString localName;
|
readonly attribute DOMString localName;
|
||||||
readonly attribute DOMString tagName;
|
readonly attribute DOMString tagName;
|
||||||
|
|
||||||
|
|
|
@ -809,7 +809,7 @@ JS::NonnullGCPtr<Node> Node::clone_node(Document* document, bool clone_children)
|
||||||
if (is<Element>(this)) {
|
if (is<Element>(this)) {
|
||||||
// 1. Let copy be the result of creating an element, given document, node’s local name, node’s namespace, node’s namespace prefix, and node’s is value, with the synchronous custom elements flag unset.
|
// 1. Let copy be the result of creating an element, given document, node’s local name, node’s namespace, node’s namespace prefix, and node’s is value, with the synchronous custom elements flag unset.
|
||||||
auto& element = *verify_cast<Element>(this);
|
auto& element = *verify_cast<Element>(this);
|
||||||
auto element_copy = DOM::create_element(*document, element.local_name(), element.namespace_(), element.prefix(), element.is_value(), false).release_value_but_fixme_should_propagate_errors();
|
auto element_copy = DOM::create_element(*document, element.local_name(), element.namespace_(), element.deprecated_prefix(), element.is_value(), false).release_value_but_fixme_should_propagate_errors();
|
||||||
|
|
||||||
// 2. For each attribute in node’s attribute list:
|
// 2. For each attribute in node’s attribute list:
|
||||||
element.for_each_attribute([&](auto& name, auto& value) {
|
element.for_each_attribute([&](auto& name, auto& value) {
|
||||||
|
|
|
@ -549,7 +549,7 @@ static WebIDL::ExceptionOr<DeprecatedString> serialize_element(DOM::Element cons
|
||||||
// 12. Otherwise, inherited ns is not equal to ns (the node's own namespace is different from the context namespace of its parent). Run these sub-steps:
|
// 12. Otherwise, inherited ns is not equal to ns (the node's own namespace is different from the context namespace of its parent). Run these sub-steps:
|
||||||
else {
|
else {
|
||||||
// 1. Let prefix be the value of node's prefix attribute.
|
// 1. Let prefix be the value of node's prefix attribute.
|
||||||
auto prefix = element.prefix();
|
auto prefix = element.deprecated_prefix();
|
||||||
|
|
||||||
// 2. Let candidate prefix be the result of retrieving a preferred prefix string prefix from map given namespace ns.
|
// 2. Let candidate prefix be the result of retrieving a preferred prefix string prefix from map given namespace ns.
|
||||||
auto candidate_prefix = retrieve_a_preferred_prefix_string(prefix, map, ns);
|
auto candidate_prefix = retrieve_a_preferred_prefix_string(prefix, map, ns);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue