mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-04 09:22:53 +00:00
LibWeb: Keep track of the order in which option elements are selected
This allows us to locate the most-recently-selected when running the selectedness update algorithm.
This commit is contained in:
parent
581597cb34
commit
dc9179bb1b
Notes:
github-actions[bot]
2024-11-14 22:07:21 +00:00
Author: https://github.com/awesomekling
Commit: dc9179bb1b
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2348
10 changed files with 107 additions and 27 deletions
|
@ -21,6 +21,7 @@ public:
|
|||
bool selected() const { return m_selected; }
|
||||
void set_selected(bool);
|
||||
void set_selected_internal(bool);
|
||||
[[nodiscard]] u64 selectedness_update_index() const { return m_selectedness_update_index; }
|
||||
|
||||
String value() const;
|
||||
WebIDL::ExceptionOr<void> set_value(String const&);
|
||||
|
@ -46,6 +47,9 @@ private:
|
|||
|
||||
virtual void attribute_changed(FlyString const& name, Optional<String> const& old_value, Optional<String> const& value, Optional<FlyString> const& namespace_) override;
|
||||
|
||||
virtual void inserted() override;
|
||||
virtual void removed_from(Node*) override;
|
||||
|
||||
void ask_for_a_reset();
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/form-elements.html#concept-option-selectedness
|
||||
|
@ -53,6 +57,8 @@ private:
|
|||
|
||||
// https://html.spec.whatwg.org/multipage/form-elements.html#concept-option-dirtiness
|
||||
bool m_dirty { false };
|
||||
|
||||
u64 m_selectedness_update_index { 0 };
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue