diff --git a/Libraries/LibWeb/DOM/Document.cpp b/Libraries/LibWeb/DOM/Document.cpp index 2c6f58a7a8d..60ffa47d088 100644 --- a/Libraries/LibWeb/DOM/Document.cpp +++ b/Libraries/LibWeb/DOM/Document.cpp @@ -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; diff --git a/Libraries/LibWeb/HTML/HTMLOrSVGElement.cpp b/Libraries/LibWeb/HTML/HTMLOrSVGElement.cpp index 825fd3935d6..9c843f21854 100644 --- a/Libraries/LibWeb/HTML/HTMLOrSVGElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLOrSVGElement.cpp @@ -30,25 +30,15 @@ void HTMLOrSVGElement::focus() if (!static_cast(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(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 diff --git a/Libraries/LibWeb/HTML/HTMLOrSVGElement.h b/Libraries/LibWeb/HTML/HTMLOrSVGElement.h index 316fd7fa6d6..937947c6382 100644 --- a/Libraries/LibWeb/HTML/HTMLOrSVGElement.h +++ b/Libraries/LibWeb/HTML/HTMLOrSVGElement.h @@ -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 }; }; }