mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 02:05:07 +02:00
LibWeb: Implement named and indexed property access for HTMLFormElement
This commit is contained in:
committed by
Andreas Kling
parent
521ed0e911
commit
b5ec520f84
Notes:
sideshowbarker
2024-07-17 06:39:26 +09:00
Author: https://github.com/ADKaster Commit: https://github.com/SerenityOS/serenity/commit/b5ec520f84 Pull-request: https://github.com/SerenityOS/serenity/pull/22675 Reviewed-by: https://github.com/shannonbooth ✅
@@ -8,6 +8,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/Time.h>
|
||||
#include <LibWeb/ARIA/Roles.h>
|
||||
#include <LibWeb/HTML/AbstractBrowsingContext.h>
|
||||
#include <LibWeb/HTML/HTMLElement.h>
|
||||
@@ -95,6 +96,12 @@ private:
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
// ^PlatformObject
|
||||
virtual WebIDL::ExceptionOr<JS::Value> item_value(size_t index) const override;
|
||||
virtual WebIDL::ExceptionOr<JS::Value> named_item_value(FlyString const& name) const override;
|
||||
virtual Vector<FlyString> supported_property_names() const override;
|
||||
virtual bool is_supported_property_index(u32) const override;
|
||||
|
||||
ErrorOr<void> populate_vector_with_submittable_elements_in_tree_order(JS::NonnullGCPtr<DOM::Element> element, Vector<JS::NonnullGCPtr<DOM::Element>>& elements);
|
||||
|
||||
ErrorOr<String> pick_an_encoding() const;
|
||||
@@ -113,6 +120,13 @@ private:
|
||||
|
||||
Vector<JS::GCPtr<HTMLElement>> m_associated_elements;
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/forms.html#past-names-map
|
||||
struct PastNameEntry {
|
||||
JS::GCPtr<DOM::Node const> node;
|
||||
MonotonicTime insertion_time;
|
||||
};
|
||||
HashMap<FlyString, PastNameEntry> mutable m_past_names_map;
|
||||
|
||||
JS::GCPtr<DOM::HTMLFormControlsCollection> mutable m_elements;
|
||||
|
||||
bool m_constructing_entry_list { false };
|
||||
|
||||
Reference in New Issue
Block a user