srctree

Robin Linden parent 86509c7e d2d72923
browser: Only try to download stylesheets with the right attributes

inlinesplit
browser/engine.cpp added: 9, removed: 6, total 3
@@ -87,11 +87,14 @@ void Engine::on_navigation_success() {
}
 
auto head_links = dom::nodes_by_path(dom_.html(), "html.head.link");
head_links.erase(std::remove_if(begin(head_links),
end(head_links),
[](auto const *link) {
return link->attributes.contains("rel") && link->attributes.at("rel") != "stylesheet";
}),
head_links.erase(
std::remove_if(begin(head_links),
end(head_links),
[](auto const *link) {
return !link->attributes.contains("rel")
|| (link->attributes.contains("rel") && link->attributes.at("rel") != "stylesheet")
|| !link->attributes.contains("href");
}),
end(head_links));
 
// Start downloading all stylesheets.