LibWeb: Implement HTMLTableElement row attributes

rows returns a HTMLCollection of all the tr elements contained within
the table.
We leave the SameObject attribute off the attribute in the IDL as we
cannot currently return the same HTMLCollection every time (see the
FIXME on DOM::Document::applets)

The WrapperGenerator currently does not correctly handle the default
value for the type long on insertRow. Currently not specifying the
index will insert a row at index 0.
This commit is contained in:
Adam Hodgen 2021-04-26 16:36:40 +01:00 committed by Andreas Kling
parent 2d600a8675
commit 887fa18e32
Notes: sideshowbarker 2024-07-18 18:25:34 +09:00
4 changed files with 92 additions and 0 deletions

View file

@ -6,7 +6,9 @@
#pragma once
#include <LibWeb/DOM/ExceptionOr.h>
#include <LibWeb/HTML/HTMLElement.h>
#include <LibWeb/HTML/HTMLTableRowElement.h>
namespace Web::HTML {
@ -17,6 +19,10 @@ public:
HTMLTableElement(DOM::Document&, QualifiedName);
virtual ~HTMLTableElement() override;
NonnullRefPtr<DOM::HTMLCollection> rows();
DOM::ExceptionOr<NonnullRefPtr<HTMLTableRowElement>> insert_row(long index);
DOM::ExceptionOr<void> delete_row(long index);
private:
virtual void apply_presentational_hints(CSS::StyleProperties&) const override;
};