From a66c13ecf33cfeef679d1d019c8a98c9cdca99de Mon Sep 17 00:00:00 2001 From: Navid EMAD Date: Sat, 13 Jun 2026 15:12:17 +0200 Subject: [PATCH] webapi: implement HTMLSelectElement.type and HTMLOptionElement.label Both IDL attributes were unimplemented and evaluated to `undefined`. `select.type` reflects the element's mode: "select-multiple" when the `multiple` attribute is present, "select-one" otherwise (derived from the existing `getMultiple()`). `option.label` returns the `label` content attribute when present and non-empty, otherwise the value of the `text` IDL attribute. Both match the HTML Living Standard. Select-enhancement libraries branch on `select.type` to choose single- vs multi-select code paths; reading `undefined` there made them take a dead path and throw during initialization. Closes #2738 --- src/browser/tests/element/html/option.html | 17 +++++++++++++++++ src/browser/tests/element/html/select.html | 14 ++++++++++++++ src/browser/webapi/element/html/Option.zig | 16 ++++++++++++++++ src/browser/webapi/element/html/Select.zig | 8 ++++++++ 4 files changed, 55 insertions(+) diff --git a/src/browser/tests/element/html/option.html b/src/browser/tests/element/html/option.html index 459833702..ec99e8991 100644 --- a/src/browser/tests/element/html/option.html +++ b/src/browser/tests/element/html/option.html @@ -29,6 +29,23 @@ testing.expectEqual('Text 3', $('#opt3').text) + + + + + +