mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-10 18:10:56 +09:00
LibWeb: Stop lying about string types
This commit is contained in:
parent
9300b9a364
commit
eeb15fc10b
Notes:
sideshowbarker
2024-07-17 16:42:19 +09:00
Author: https://github.com/Hendiadyoin1
Commit: eeb15fc10b
Pull-request: https://github.com/SerenityOS/serenity/pull/19356
Reviewed-by: https://github.com/alimpfard
Reviewed-by: https://github.com/gmta ✅
Reviewed-by: https://github.com/krkk ✅
5 changed files with 7 additions and 7 deletions
|
@ -722,7 +722,7 @@ Parser::ParseErrorOr<Optional<Selector::SimpleSelector>> Parser::parse_simple_se
|
|||
return Selector::SimpleSelector {
|
||||
.type = Selector::SimpleSelector::Type::TagName,
|
||||
// FIXME: XML requires case-sensitivity for identifiers, while HTML does not. As such, this should be reworked if XML support is added.
|
||||
.value = Selector::SimpleSelector::Name { FlyString::from_utf8(first_value.token().ident().to_lowercase_string()).release_value_but_fixme_should_propagate_errors() }
|
||||
.value = Selector::SimpleSelector::Name { FlyString::from_deprecated_fly_string(first_value.token().ident().to_lowercase_string()).release_value_but_fixme_should_propagate_errors() }
|
||||
};
|
||||
}
|
||||
if (first_value.is_block() && first_value.block().is_square())
|
||||
|
|
|
@ -1971,7 +1971,7 @@ void StyleComputer::compute_font(StyleProperties& style, DOM::Element const* ele
|
|||
default:
|
||||
return {};
|
||||
}
|
||||
return find_font(String::from_utf8(Platform::FontPlugin::the().generic_font_name(generic_font)).release_value_but_fixme_should_propagate_errors());
|
||||
return find_font(String::from_deprecated_string(Platform::FontPlugin::the().generic_font_name(generic_font)).release_value_but_fixme_should_propagate_errors());
|
||||
};
|
||||
|
||||
RefPtr<Gfx::Font const> found_font;
|
||||
|
|
|
@ -1323,7 +1323,7 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<Element>> Document::create_element(Deprecat
|
|||
if (options.has<ElementCreationOptions>()) {
|
||||
auto const& element_creation_options = options.get<ElementCreationOptions>();
|
||||
if (!element_creation_options.is.is_null())
|
||||
is_value = TRY_OR_THROW_OOM(vm, String::from_utf8(element_creation_options.is));
|
||||
is_value = TRY_OR_THROW_OOM(vm, String::from_deprecated_string(element_creation_options.is));
|
||||
}
|
||||
|
||||
// 5. Let namespace be the HTML namespace, if this is an HTML document or this’s content type is "application/xhtml+xml"; otherwise null.
|
||||
|
@ -1351,7 +1351,7 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<Element>> Document::create_element_ns(Depre
|
|||
if (options.has<ElementCreationOptions>()) {
|
||||
auto const& element_creation_options = options.get<ElementCreationOptions>();
|
||||
if (!element_creation_options.is.is_null())
|
||||
is_value = TRY_OR_THROW_OOM(vm, String::from_utf8(element_creation_options.is));
|
||||
is_value = TRY_OR_THROW_OOM(vm, String::from_deprecated_string(element_creation_options.is));
|
||||
}
|
||||
|
||||
// 4. Return the result of creating an element given document, localName, namespace, prefix, is, and with the synchronous custom elements flag set.
|
||||
|
@ -2237,7 +2237,7 @@ JS::GCPtr<HTML::CustomElementDefinition> Document::lookup_custom_element_definit
|
|||
auto registry = window().custom_elements().release_value_but_fixme_should_propagate_errors();
|
||||
|
||||
// 4. If there is custom element definition in registry with name and local name both equal to localName, return that custom element definition.
|
||||
auto converted_local_name = String::from_utf8(local_name).release_value_but_fixme_should_propagate_errors();
|
||||
auto converted_local_name = String::from_deprecated_string(local_name).release_value_but_fixme_should_propagate_errors();
|
||||
auto maybe_definition = registry->get_definition_with_name_and_local_name(converted_local_name, converted_local_name);
|
||||
if (maybe_definition)
|
||||
return maybe_definition;
|
||||
|
|
|
@ -957,7 +957,7 @@ BrowsingContext::ChosenBrowsingContext BrowsingContext::choose_a_browsing_contex
|
|||
|
||||
// 6. If name is not an ASCII case-insensitive match for "_blank", then set chosen's name to name.
|
||||
if (!Infra::is_ascii_case_insensitive_match(name, "_blank"sv))
|
||||
chosen->set_name(String::from_deprecated_string(name).release_value_but_fixme_should_propagate_errors());
|
||||
chosen->set_name(String::from_utf8(name).release_value_but_fixme_should_propagate_errors());
|
||||
}
|
||||
|
||||
// --> If the user agent has been configured such that in this instance t will reuse current
|
||||
|
|
|
@ -463,7 +463,7 @@ public:
|
|||
// empty string, then end the synchronous section, and jump down to the failed with elements step below.
|
||||
String candiate_src;
|
||||
if (m_candidate->has_attribute(HTML::AttributeNames::src))
|
||||
candiate_src = TRY_OR_THROW_OOM(vm, String::from_utf8(m_candidate->attribute(HTML::AttributeNames::src)));
|
||||
candiate_src = TRY_OR_THROW_OOM(vm, String::from_deprecated_string(m_candidate->attribute(HTML::AttributeNames::src)));
|
||||
|
||||
if (candiate_src.is_empty()) {
|
||||
TRY(failed_with_elements());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue