mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
LibWeb: Cache the value of Element::lang()
This reduces the time spent in `SelectorEngine::matches_lang_pseudo_class()` from 1.9% to 0.41% on https://cloudflare.com
This commit is contained in:
parent
0ec97eabab
commit
154e9db033
Notes:
github-actions[bot]
2025-11-12 11:37:21 +00:00
Author: https://github.com/tcl3
Commit: 154e9db033
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6794
Reviewed-by: https://github.com/gmta ✅
5 changed files with 92 additions and 8 deletions
|
|
@ -144,6 +144,7 @@ void HTMLMetaElement::inserted()
|
|||
// 9. Set the pragma-set default language to candidate.
|
||||
auto language = String::from_utf8_without_validation(candidate.bytes());
|
||||
document().set_pragma_set_default_language(language);
|
||||
document().document_element()->invalidate_lang_value();
|
||||
break;
|
||||
}
|
||||
case HttpEquivAttributeState::ContentSecurityPolicy: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue