mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 10:37:45 +00:00
LibWeb: Port Dump from DeprecatedString to String
This commit is contained in:
parent
d400291ad9
commit
6e48d9f2e6
1 changed files with 6 additions and 6 deletions
|
@ -146,7 +146,7 @@ void dump_tree(StringBuilder& builder, Layout::Node const& layout_node, bool sho
|
||||||
else
|
else
|
||||||
tag_name = layout_node.dom_node()->node_name();
|
tag_name = layout_node.dom_node()->node_name();
|
||||||
|
|
||||||
DeprecatedString identifier = "";
|
String 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())) {
|
||||||
auto& element = verify_cast<DOM::Element>(*layout_node.dom_node());
|
auto& element = verify_cast<DOM::Element>(*layout_node.dom_node());
|
||||||
StringBuilder builder;
|
StringBuilder builder;
|
||||||
|
@ -159,7 +159,7 @@ void dump_tree(StringBuilder& builder, Layout::Node const& layout_node, bool sho
|
||||||
builder.append('.');
|
builder.append('.');
|
||||||
builder.append(class_name);
|
builder.append(class_name);
|
||||||
}
|
}
|
||||||
identifier = builder.to_deprecated_string();
|
identifier = MUST(builder.to_string());
|
||||||
}
|
}
|
||||||
|
|
||||||
StringView nonbox_color_on = ""sv;
|
StringView nonbox_color_on = ""sv;
|
||||||
|
@ -211,7 +211,7 @@ void dump_tree(StringBuilder& builder, Layout::Node const& layout_node, bool sho
|
||||||
color_on,
|
color_on,
|
||||||
tag_name,
|
tag_name,
|
||||||
color_off,
|
color_off,
|
||||||
identifier.characters());
|
identifier);
|
||||||
|
|
||||||
if (auto const* paintable_box = box.paintable_box()) {
|
if (auto const* paintable_box = box.paintable_box()) {
|
||||||
builder.appendff("at ({},{}) content-size {}x{}",
|
builder.appendff("at ({},{}) content-size {}x{}",
|
||||||
|
@ -381,12 +381,12 @@ void dump_tree(StringBuilder& builder, Layout::Node const& layout_node, bool sho
|
||||||
|
|
||||||
if (show_specified_style && layout_node.dom_node() && layout_node.dom_node()->is_element() && verify_cast<DOM::Element>(layout_node.dom_node())->computed_css_values()) {
|
if (show_specified_style && layout_node.dom_node() && layout_node.dom_node()->is_element() && verify_cast<DOM::Element>(layout_node.dom_node())->computed_css_values()) {
|
||||||
struct NameAndValue {
|
struct NameAndValue {
|
||||||
DeprecatedString name;
|
String name;
|
||||||
DeprecatedString value;
|
String value;
|
||||||
};
|
};
|
||||||
Vector<NameAndValue> properties;
|
Vector<NameAndValue> properties;
|
||||||
verify_cast<DOM::Element>(*layout_node.dom_node()).computed_css_values()->for_each_property([&](auto property_id, auto& value) {
|
verify_cast<DOM::Element>(*layout_node.dom_node()).computed_css_values()->for_each_property([&](auto property_id, auto& value) {
|
||||||
properties.append({ CSS::string_from_property_id(property_id), value.to_string().to_deprecated_string() });
|
properties.append({ MUST(String::from_utf8(CSS::string_from_property_id(property_id))), value.to_string() });
|
||||||
});
|
});
|
||||||
quick_sort(properties, [](auto& a, auto& b) { return a.name < b.name; });
|
quick_sort(properties, [](auto& a, auto& b) { return a.name < b.name; });
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue