From cae57b63b944b83b928afec79414a9704b20271c Mon Sep 17 00:00:00 2001 From: Joey Arhar Date: Mon, 29 Sep 2025 08:29:22 -0700 Subject: [PATCH 1/5] Make option disabledness look for ancestor optgroups Now that option elements can be descendants of optgroups instead of just children, the disabledness algorithm should look for ancestors intead of just a parent optgroup. Fixes https://github.com/whatwg/html/issues/11707 --- source | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source b/source index 877761a9424..96ab3bb9b8c 100644 --- a/source +++ b/source @@ -56989,9 +56989,9 @@ interface HTMLOptionElement : HTMLElement {

The disabled attribute is a boolean attribute. An option element is disabled if its disabled attribute is present or if it is a child of an - optgroup element whose disabled - attribute is present.

+ data-x="attr-option-disabled">disabled attribute is present or if it is a + descendant of an optgroup element whose disabled attribute is present.

From 10b756aea8a51a6b3029d31b56025788d4d84ba8 Mon Sep 17 00:00:00 2001 From: Joey Arhar Date: Tue, 30 Sep 2025 11:09:54 -0700 Subject: [PATCH 2/5] look for nearest ancestor --- source | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source b/source index 96ab3bb9b8c..7127cd34d76 100644 --- a/source +++ b/source @@ -56989,9 +56989,9 @@ interface HTMLOptionElement : HTMLElement {

The disabled attribute is a boolean attribute. An option element is disabled if its disabled attribute is present or if it is a - descendant of an optgroup element whose disabled attribute is present.

+ data-x="attr-option-disabled">disabled attribute is present or if its nearest + ancestor optgroup, if present, has the disabled attribute set.

From 7ddc327ada0da99007e6aa9bab16a4c4a6b2447e Mon Sep 17 00:00:00 2001 From: Joey Arhar Date: Wed, 1 Oct 2025 13:55:06 -0700 Subject: [PATCH 3/5] use algorithm and check for select elements --- source | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/source b/source index 7127cd34d76..2207c0517a3 100644 --- a/source +++ b/source @@ -56987,11 +56987,28 @@ interface HTMLOptionElement : HTMLElement {

The disabled - attribute is a boolean attribute. An option element is disabled if its disabled attribute is present or if its nearest - ancestor optgroup, if present, has the disabled attribute set.

+ attribute is a boolean attribute. An option element option is + disabled if the following steps return true:

+ +
    +
  1. If option's disabled attribute is + present, then return true.

  2. + +
  3. +

    For each ancestor of insertedOption's ancestors in reverse tree order:

    + +
      +
    1. If ancestor is a select element, then return false.

    2. + +
    3. If ancestor is an optgroup element, then return true if + ancestor's disabled attribute is + present, otherwise return false.

    4. +
    +
  4. + +
  5. Return false.

  6. +
From 3b60a7a28cd6a567b3b6c30045672800c64b4635 Mon Sep 17 00:00:00 2001 From: Joey Arhar Date: Wed, 1 Oct 2025 15:52:02 -0700 Subject: [PATCH 4/5] incorporate hr and option element ancestors --- source | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source b/source index 2207c0517a3..4e56a07dffd 100644 --- a/source +++ b/source @@ -56999,7 +56999,8 @@ interface HTMLOptionElement : HTMLElement { data-x="ancestor">ancestors in reverse tree order:

    -
  1. If ancestor is a select element, then return false.

  2. +
  3. If ancestor is a select, hr, or option + element, then return false.

  4. If ancestor is an optgroup element, then return true if ancestor's disabled attribute is From 39c41f5ee3cf451250710c2e991dee8e221e731f Mon Sep 17 00:00:00 2001 From: Joey Arhar Date: Tue, 7 Oct 2025 13:32:03 -0700 Subject: [PATCH 5/5] remove extra return --- source | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source b/source index 4e56a07dffd..1b1a6daf75f 100644 --- a/source +++ b/source @@ -57004,7 +57004,7 @@ interface HTMLOptionElement : HTMLElement {

  5. If ancestor is an optgroup element, then return true if ancestor's disabled attribute is - present, otherwise return false.

  6. + present; otherwise false.