LibWeb: Remove "locked for focus" concept

Corresponds to 5ba23f9f6d
This commit is contained in:
Sam Atkins 2025-04-11 16:15:50 +01:00 committed by Andreas Kling
parent 3e17b1c9ae
commit 609d568776
Notes: github-actions[bot] 2025-04-18 09:08:31 +00:00
3 changed files with 4 additions and 20 deletions

View file

@ -3490,10 +3490,7 @@ bool Document::allow_focus() const
if (is_allowed_to_use_feature(PolicyControlledFeature::FocusWithoutUserActivation))
return true;
// FIXME: 2. If any of the following are true:
// - target's relevant global object has transient user activation; or
// - target's node navigable's container, if any, is marked as locked for focus,
// then return true.
// FIXME: 2. If target's relevant global object has transient activation, then return true.
// 3. Return false.
return false;

View file

@ -30,25 +30,15 @@ void HTMLOrSVGElement<ElementBase>::focus()
if (!static_cast<ElementBase*>(this)->document().allow_focus())
return;
// 2. If the element is marked as locked for focus, then return.
if (m_locked_for_focus)
return;
// 3. Mark the element as locked for focus.
m_locked_for_focus = true;
// 4. Run the focusing steps for the element.
// 2. Run the focusing steps for the element.
run_focusing_steps(static_cast<ElementBase*>(this));
// FIXME: 5. If the value of the focusVisible dictionary member of options is true, or is not present but in an implementation-defined way the user agent determines it would be best to do so, then indicate focus.
// FIXME: 3. If the value of the focusVisible dictionary member of options is true, or is not present but in an implementation-defined way the user agent determines it would be best to do so, then indicate focus.
// FIXME: 6. If the value of the preventScroll dictionary member of options is false,
// FIXME: 4. If the value of the preventScroll dictionary member of options is false,
// then scroll the element into view with scroll behavior "auto",
// block flow direction position set to an implementation-defined value,
// and inline base direction position set to an implementation-defined value.
// 7. Unmark the element as locked for focus.
m_locked_for_focus = false;
}
// https://html.spec.whatwg.org/multipage/interaction.html#dom-blur

View file

@ -35,9 +35,6 @@ protected:
// https://html.spec.whatwg.org/multipage/urls-and-fetching.html#cryptographicnonce
String m_cryptographic_nonce;
// https://html.spec.whatwg.org/multipage/interaction.html#locked-for-focus
bool m_locked_for_focus { false };
};
}