mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-09 01:29:17 +00:00
parent
3e17b1c9ae
commit
609d568776
Notes:
github-actions[bot]
2025-04-18 09:08:31 +00:00
Author: https://github.com/AtkinsSJ
Commit: 609d568776
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4324
3 changed files with 4 additions and 20 deletions
|
@ -3490,10 +3490,7 @@ bool Document::allow_focus() const
|
||||||
if (is_allowed_to_use_feature(PolicyControlledFeature::FocusWithoutUserActivation))
|
if (is_allowed_to_use_feature(PolicyControlledFeature::FocusWithoutUserActivation))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// FIXME: 2. If any of the following are true:
|
// FIXME: 2. If target's relevant global object has transient activation, then return 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.
|
|
||||||
|
|
||||||
// 3. Return false.
|
// 3. Return false.
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -30,25 +30,15 @@ void HTMLOrSVGElement<ElementBase>::focus()
|
||||||
if (!static_cast<ElementBase*>(this)->document().allow_focus())
|
if (!static_cast<ElementBase*>(this)->document().allow_focus())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// 2. If the element is marked as locked for focus, then return.
|
// 2. Run the focusing steps for the element.
|
||||||
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.
|
|
||||||
run_focusing_steps(static_cast<ElementBase*>(this));
|
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",
|
// then scroll the element into view with scroll behavior "auto",
|
||||||
// block flow direction position set to an implementation-defined value,
|
// block flow direction position set to an implementation-defined value,
|
||||||
// and inline base 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
|
// https://html.spec.whatwg.org/multipage/interaction.html#dom-blur
|
||||||
|
|
|
@ -35,9 +35,6 @@ protected:
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/multipage/urls-and-fetching.html#cryptographicnonce
|
// https://html.spec.whatwg.org/multipage/urls-and-fetching.html#cryptographicnonce
|
||||||
String m_cryptographic_nonce;
|
String m_cryptographic_nonce;
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/multipage/interaction.html#locked-for-focus
|
|
||||||
bool m_locked_for_focus { false };
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue