|
@@ -7,6 +7,7 @@
|
|
|
#include <LibWeb/Bindings/HTMLOListElementPrototype.h>
|
|
|
#include <LibWeb/Bindings/Intrinsics.h>
|
|
|
#include <LibWeb/HTML/HTMLOListElement.h>
|
|
|
+#include <LibWeb/HTML/Numbers.h>
|
|
|
|
|
|
namespace Web::HTML {
|
|
|
|
|
@@ -25,4 +26,14 @@ void HTMLOListElement::initialize(JS::Realm& realm)
|
|
|
WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLOListElement);
|
|
|
}
|
|
|
|
|
|
+// https://html.spec.whatwg.org/multipage/grouping-content.html#dom-ol-start
|
|
|
+WebIDL::Long HTMLOListElement::start()
|
|
|
+{
|
|
|
+ // The start IDL attribute must reflect the content attribute of the same name, with a default value of 1.
|
|
|
+ auto content_attribute_value = get_attribute(AttributeNames::start).value_or("1"_string);
|
|
|
+ if (auto maybe_number = HTML::parse_integer(content_attribute_value); maybe_number.has_value())
|
|
|
+ return *maybe_number;
|
|
|
+ return 1;
|
|
|
+}
|
|
|
+
|
|
|
}
|