mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 10:07:15 +02:00
LibWeb: Simplify iframe sandbox attribute lookup
Fold the has_attribute and attribute call into an if statement initializer.
This commit is contained in:
committed by
Alexander Kalenik
parent
0086a7899d
commit
e20fd9ba74
Notes:
github-actions[bot]
2026-04-01 02:42:20 +00:00
Author: https://github.com/shannonbooth Commit: https://github.com/LadybirdBrowser/ladybird/commit/e20fd9ba74c Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/8690 Reviewed-by: https://github.com/kalenikaliaksandr ✅
@@ -115,11 +115,8 @@ void HTMLIFrameElement::post_connection()
|
||||
|
||||
// 2. If insertedNode has a sandbox attribute, then parse the sandboxing directive given the attribute's
|
||||
// value and insertedNode's iframe sandboxing flag set.
|
||||
if (has_attribute(AttributeNames::sandbox)) {
|
||||
auto sandbox_attribute = attribute(AttributeNames::sandbox);
|
||||
VERIFY(sandbox_attribute.has_value());
|
||||
m_iframe_sandboxing_flag_set = parse_a_sandboxing_directive(sandbox_attribute.value());
|
||||
}
|
||||
if (auto sandbox = attribute(AttributeNames::sandbox); sandbox.has_value())
|
||||
m_iframe_sandboxing_flag_set = parse_a_sandboxing_directive(sandbox.value());
|
||||
|
||||
// 3. Process the iframe attributes for insertedNode, with initialInsertion set to true.
|
||||
process_the_iframe_attributes(InitialInsertion::Yes);
|
||||
|
||||
Reference in New Issue
Block a user