mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-30 16:28:48 +00:00
LibWeb: Use cached element name and id where possible
Instead of looking up in the named node map, we can simply use the cached name and ID on the element.
This commit is contained in:
parent
41f84deb9f
commit
0695236408
Notes:
sideshowbarker
2024-07-18 22:57:59 +09:00
Author: https://github.com/shannonbooth
Commit: 0695236408
Pull-request: https://github.com/SerenityOS/serenity/pull/22732
11 changed files with 30 additions and 36 deletions
|
@ -54,9 +54,8 @@ void HTMLMetaElement::inserted()
|
|||
// * The element is in a document tree
|
||||
// * The element has a name attribute, whose value is an ASCII case-insensitive match for theme-color
|
||||
// * The element has a content attribute
|
||||
auto name = attribute(AttributeNames::name);
|
||||
auto content = attribute(AttributeNames::content);
|
||||
if (name.has_value() && name->bytes_as_string_view().equals_ignoring_ascii_case("theme-color"sv) && content.has_value()) {
|
||||
if (name().has_value() && name()->equals_ignoring_ascii_case("theme-color"sv) && content.has_value()) {
|
||||
auto context = CSS::Parser::ParsingContext { document() };
|
||||
|
||||
// 2. For each element in candidate elements:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue