summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Atkins <atkinssj@serenityos.org>2023-02-14 16:05:40 +0000
committerTim Flynn <trflynn89@pm.me>2023-02-15 12:48:26 -0500
commite338ef49141200eed8cff27f5b94a54b4cd9cf1f (patch)
tree3187ce3a603a550adb5597745cca6df7414f6488
parent9e735cc02e17fb993da289f2ea2448f31d3b4479 (diff)
downloadserenity-e338ef49141200eed8cff27f5b94a54b4cd9cf1f.zip
LibWeb: Port ComputedValues to new Strings
-rw-r--r--Userland/Libraries/LibWeb/CSS/ComputedValues.h4
-rw-r--r--Userland/Libraries/LibWeb/CSS/StyleProperties.cpp4
-rw-r--r--Userland/Libraries/LibWeb/Layout/TreeBuilder.cpp2
3 files changed, 5 insertions, 5 deletions
diff --git a/Userland/Libraries/LibWeb/CSS/ComputedValues.h b/Userland/Libraries/LibWeb/CSS/ComputedValues.h
index 6221428ea3..930fe8232f 100644
--- a/Userland/Libraries/LibWeb/CSS/ComputedValues.h
+++ b/Userland/Libraries/LibWeb/CSS/ComputedValues.h
@@ -133,8 +133,8 @@ struct ContentData {
} type { Type::Normal };
// FIXME: Data is a list of identifiers, strings and image values.
- DeprecatedString data {};
- DeprecatedString alt_text {};
+ String data {};
+ String alt_text {};
};
struct BorderRadiusData {
diff --git a/Userland/Libraries/LibWeb/CSS/StyleProperties.cpp b/Userland/Libraries/LibWeb/CSS/StyleProperties.cpp
index d08b983af8..a8785b6e1c 100644
--- a/Userland/Libraries/LibWeb/CSS/StyleProperties.cpp
+++ b/Userland/Libraries/LibWeb/CSS/StyleProperties.cpp
@@ -494,7 +494,7 @@ CSS::ContentData StyleProperties::content() const
}
}
content_data.type = ContentData::Type::String;
- content_data.data = builder.to_deprecated_string();
+ content_data.data = builder.to_string().release_value_but_fixme_should_propagate_errors();
if (content_style_value.has_alt_text()) {
StringBuilder alt_text_builder;
@@ -505,7 +505,7 @@ CSS::ContentData StyleProperties::content() const
// TODO: Implement counters
}
}
- content_data.alt_text = alt_text_builder.to_deprecated_string();
+ content_data.alt_text = alt_text_builder.to_string().release_value_but_fixme_should_propagate_errors();
}
return content_data;
diff --git a/Userland/Libraries/LibWeb/Layout/TreeBuilder.cpp b/Userland/Libraries/LibWeb/Layout/TreeBuilder.cpp
index 87784458f6..e993151760 100644
--- a/Userland/Libraries/LibWeb/Layout/TreeBuilder.cpp
+++ b/Userland/Libraries/LibWeb/Layout/TreeBuilder.cpp
@@ -171,7 +171,7 @@ ErrorOr<void> TreeBuilder::create_pseudo_element_if_needed(DOM::Element& element
pseudo_element_node->set_generated(true);
// FIXME: Handle images, and multiple values
if (pseudo_element_content.type == CSS::ContentData::Type::String) {
- auto text = document.heap().allocate<DOM::Text>(document.realm(), document, pseudo_element_content.data).release_allocated_value_but_fixme_should_propagate_errors();
+ auto text = document.heap().allocate<DOM::Text>(document.realm(), document, pseudo_element_content.data.to_deprecated_string()).release_allocated_value_but_fixme_should_propagate_errors();
auto text_node = document.heap().allocate_without_realm<Layout::TextNode>(document, *text);
text_node->set_generated(true);
push_parent(verify_cast<NodeWithStyle>(*pseudo_element_node));