mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 08:08:12 +00:00
LibWeb: Rename Element::attribute to Element::deprecated_attribute
This should allow us to add a Element::attribute which returns an Optional<String>. Eventually all callers should be ported to switch from the DeprecatedString version, but in the meantime, this should allow us to port some more IDL interfaces away from DeprecatedString.
This commit is contained in:
parent
da637a527d
commit
0f6782fae6
42 changed files with 141 additions and 141 deletions
|
@ -58,12 +58,12 @@ void HTMLLinkElement::inserted()
|
|||
if (m_relationship & Relationship::Preload) {
|
||||
// FIXME: Respect the "as" attribute.
|
||||
LoadRequest request;
|
||||
request.set_url(document().parse_url(attribute(HTML::AttributeNames::href)));
|
||||
request.set_url(document().parse_url(deprecated_attribute(HTML::AttributeNames::href)));
|
||||
set_resource(ResourceLoader::the().load_resource(Resource::Type::Generic, request));
|
||||
} else if (m_relationship & Relationship::DNSPrefetch) {
|
||||
ResourceLoader::the().prefetch_dns(document().parse_url(attribute(HTML::AttributeNames::href)));
|
||||
ResourceLoader::the().prefetch_dns(document().parse_url(deprecated_attribute(HTML::AttributeNames::href)));
|
||||
} else if (m_relationship & Relationship::Preconnect) {
|
||||
ResourceLoader::the().preconnect(document().parse_url(attribute(HTML::AttributeNames::href)));
|
||||
ResourceLoader::the().preconnect(document().parse_url(deprecated_attribute(HTML::AttributeNames::href)));
|
||||
} else if (m_relationship & Relationship::Icon) {
|
||||
auto favicon_url = document().parse_url(href());
|
||||
auto favicon_request = LoadRequest::create_for_url_on_page(favicon_url, document().page());
|
||||
|
@ -343,7 +343,7 @@ void HTMLLinkElement::process_stylesheet_resource(bool success, Fetch::Infrastru
|
|||
// 2. Otherwise, return the document's character encoding. [DOM]
|
||||
|
||||
DeprecatedString encoding;
|
||||
if (auto charset = attribute(HTML::AttributeNames::charset); !charset.is_null())
|
||||
if (auto charset = deprecated_attribute(HTML::AttributeNames::charset); !charset.is_null())
|
||||
encoding = charset;
|
||||
else
|
||||
encoding = document().encoding_or_default();
|
||||
|
@ -366,7 +366,7 @@ void HTMLLinkElement::process_stylesheet_resource(bool success, Fetch::Infrastru
|
|||
|
||||
if (m_loaded_style_sheet) {
|
||||
m_loaded_style_sheet->set_owner_node(this);
|
||||
m_loaded_style_sheet->set_media(attribute(HTML::AttributeNames::media));
|
||||
m_loaded_style_sheet->set_media(deprecated_attribute(HTML::AttributeNames::media));
|
||||
document().style_sheets().add_sheet(*m_loaded_style_sheet);
|
||||
} else {
|
||||
dbgln_if(CSS_LOADER_DEBUG, "HTMLLinkElement: Failed to parse stylesheet: {}", resource()->url());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue