1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:28:12 +00:00

LibWeb: Implement (most of) HTMLElement.focus()

The main deviation from the spec is that we don't have a straightforward
representation of the spec's "focusable area" concept.

I've left a bunch of FIXME's around for our future selves. :^)
This commit is contained in:
Andreas Kling 2022-02-06 18:46:26 +01:00
parent 1165a94624
commit a062e803c5
3 changed files with 213 additions and 0 deletions

View file

@ -40,6 +40,8 @@ public:
NonnullRefPtr<DOMStringMap> dataset() const { return m_dataset; }
void focus();
protected:
virtual void parse_attribute(const FlyString& name, const String& value) override;
@ -55,6 +57,9 @@ private:
ContentEditableState content_editable_state() const;
NonnullRefPtr<DOMStringMap> m_dataset;
// https://html.spec.whatwg.org/multipage/interaction.html#locked-for-focus
bool m_locked_for_focus { false };
};
}