mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2026-04-19 02:10:26 +00:00
LibWeb: Simplify iframe sandbox attribute lookup
Fold the has_attribute and attribute call into an if statement initializer.
This commit is contained in:
parent
0086a7899d
commit
e20fd9ba74
Notes:
github-actions[bot]
2026-04-01 02:42:20 +00:00
Author: https://github.com/shannonbooth
Commit: e20fd9ba74
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/8690
Reviewed-by: https://github.com/kalenikaliaksandr ✅
1 changed files with 2 additions and 5 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue