mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-19 15:43:20 +00:00
LibWeb: Avoid unnecessary style invalidation in Document::set_url()
If we set the same URL that we already had, there's no need to invalidate style for the base URL changing. This avoids some style recomputation while loading pages.
This commit is contained in:
parent
ec2b568919
commit
775d15c115
Notes:
github-actions[bot]
2025-08-20 07:16:44 +00:00
Author: https://github.com/awesomekling
Commit: 775d15c115
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5917
Reviewed-by: https://github.com/gmta ✅
1 changed files with 4 additions and 0 deletions
|
@ -1178,6 +1178,10 @@ void Document::respond_to_base_url_changes()
|
|||
// https://html.spec.whatwg.org/multipage/urls-and-fetching.html#set-the-url
|
||||
void Document::set_url(URL::URL const& url)
|
||||
{
|
||||
// OPTIMIZATION: Avoid unnecessary work if the URL is already set.
|
||||
if (m_url == url)
|
||||
return;
|
||||
|
||||
// To set the URL for a Document document to a URL record url:
|
||||
|
||||
// 1. Set document's URL to url.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue