diff --git a/Libraries/LibWeb/CSS/Length.h b/Libraries/LibWeb/CSS/Length.h index ff1d2897b0..bce76a059c 100644 --- a/Libraries/LibWeb/CSS/Length.h +++ b/Libraries/LibWeb/CSS/Length.h @@ -151,7 +151,7 @@ public: { if (is_auto()) return "[auto]"; - return String::format("[%g %s]", m_value, unit_name()); + return String::formatted("[{} {}]", m_value, unit_name()); } bool operator==(const Length& other) const diff --git a/Libraries/LibWeb/CSS/StyleValue.h b/Libraries/LibWeb/CSS/StyleValue.h index c0d66f731c..7b3ee54f6c 100644 --- a/Libraries/LibWeb/CSS/StyleValue.h +++ b/Libraries/LibWeb/CSS/StyleValue.h @@ -329,7 +329,7 @@ public: static NonnullRefPtr create(const URL& url, DOM::Document& document) { return adopt(*new ImageStyleValue(url, document)); } virtual ~ImageStyleValue() override { } - String to_string() const override { return String::format("Image{%s}", m_url.to_string().characters()); } + String to_string() const override { return String::formatted("Image({})", m_url.to_string()); } const Gfx::Bitmap* bitmap() const { return m_bitmap; } diff --git a/Libraries/LibWeb/CodeGenerators/WrapperGenerator.cpp b/Libraries/LibWeb/CodeGenerators/WrapperGenerator.cpp index 646987d783..45e05776a6 100644 --- a/Libraries/LibWeb/CodeGenerators/WrapperGenerator.cpp +++ b/Libraries/LibWeb/CodeGenerators/WrapperGenerator.cpp @@ -227,8 +227,8 @@ static OwnPtr parse_interface(StringView filename, const StringView& attribute.unsigned_ = unsigned_; attribute.type = type; attribute.name = name; - attribute.getter_callback_name = String::format("%s_getter", snake_name(attribute.name).characters()); - attribute.setter_callback_name = String::format("%s_setter", snake_name(attribute.name).characters()); + attribute.getter_callback_name = String::formatted("{}_getter", snake_name(attribute.name)); + attribute.setter_callback_name = String::formatted("{}_setter", snake_name(attribute.name)); attribute.extended_attributes = move(extended_attributes); interface->attributes.append(move(attribute)); }; @@ -306,8 +306,8 @@ static OwnPtr parse_interface(StringView filename, const StringView& parse_function(extended_attributes); } - interface->wrapper_class = String::format("%sWrapper", interface->name.characters()); - interface->wrapper_base_class = String::format("%sWrapper", interface->parent_name.is_empty() ? "" : interface->parent_name.characters()); + interface->wrapper_class = String::formatted("{}Wrapper", interface->name); + interface->wrapper_base_class = String::formatted("{}Wrapper", interface->parent_name.is_empty() ? String::empty() : interface->parent_name); return interface; } diff --git a/Libraries/LibWeb/DOMTreeModel.cpp b/Libraries/LibWeb/DOMTreeModel.cpp index c8c6a43ce2..76c0e39769 100644 --- a/Libraries/LibWeb/DOMTreeModel.cpp +++ b/Libraries/LibWeb/DOMTreeModel.cpp @@ -130,7 +130,7 @@ GUI::Variant DOMTreeModel::data(const GUI::ModelIndex& index, GUI::ModelRole rol } if (role == GUI::ModelRole::Display) { if (node.is_text()) - return String::format("%s", with_whitespace_collapsed(downcast(node).data()).characters()); + return with_whitespace_collapsed(downcast(node).data()); if (!node.is_element()) return node.node_name(); auto& element = downcast(node); diff --git a/Libraries/LibWeb/HTML/Parser/HTMLToken.cpp b/Libraries/LibWeb/HTML/Parser/HTMLToken.cpp index aa9f33c35e..53a2357be5 100644 --- a/Libraries/LibWeb/HTML/Parser/HTMLToken.cpp +++ b/Libraries/LibWeb/HTML/Parser/HTMLToken.cpp @@ -78,9 +78,6 @@ String HTMLToken::to_string() const } return builder.to_string(); - - //dbg() << "[" << String::format("%42s", state_name(m_state)) << "] " << builder.to_string(); - //m_current_token = {}; } } diff --git a/Libraries/LibWeb/LayoutTreeModel.cpp b/Libraries/LibWeb/LayoutTreeModel.cpp index 02d3850509..440b2fce52 100644 --- a/Libraries/LibWeb/LayoutTreeModel.cpp +++ b/Libraries/LibWeb/LayoutTreeModel.cpp @@ -128,7 +128,7 @@ GUI::Variant LayoutTreeModel::data(const GUI::ModelIndex& index, GUI::ModelRole } if (role == GUI::ModelRole::Display) { if (is(node)) - return String::format("TextNode: %s", with_whitespace_collapsed(downcast(node).text_for_rendering()).characters()); + return String::formatted("TextNode: {}", with_whitespace_collapsed(downcast(node).text_for_rendering())); StringBuilder builder; builder.append(node.class_name()); builder.append(' '); diff --git a/Libraries/LibWeb/Loader/ResourceLoader.cpp b/Libraries/LibWeb/Loader/ResourceLoader.cpp index 30611c579d..7f278247f9 100644 --- a/Libraries/LibWeb/Loader/ResourceLoader.cpp +++ b/Libraries/LibWeb/Loader/ResourceLoader.cpp @@ -173,7 +173,7 @@ void ResourceLoader::load(const LoadRequest& request, Functionon_buffered_download_finish = [this, success_callback = move(success_callback), error_callback = move(error_callback), download](bool success, auto, auto& response_headers, auto status_code, ReadonlyBytes payload) { if (status_code.has_value() && status_code.value() >= 400 && status_code.value() <= 499) { if (error_callback) - error_callback(String::format("HTTP error (%u)", status_code.value())); + error_callback(String::formatted("HTTP error ({})", status_code.value())); return; } --m_pending_loads; @@ -201,7 +201,7 @@ void ResourceLoader::load(const LoadRequest& request, Function& response_headers)> success_callback, Function error_callback)