From 8cec364f8d9180e0bf86507369bc5ada23f316b7 Mon Sep 17 00:00:00 2001 From: Joey Arhar Date: Tue, 7 Oct 2025 14:03:10 -0700 Subject: [PATCH 1/2] Improve behavior for parsing option end tags This PR moves the steps to clone an option element into a selectedcontent element from the parsing of an option end tag to a paragraph which specifies that this should happen any time an option is popped off the stack of open elements, which will make the algorithm run even if the author didn't explicitly write a closing option tag. This was found here: https://github.com/whatwg/html/issues/11653 --- source | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/source b/source index 877761a9424..30d6f0d0117 100644 --- a/source +++ b/source @@ -57192,6 +57192,12 @@ interface HTMLOptionElement : HTMLElement { +
+

When an option element is popped off the stack of open elements of an + HTML parser, the user agent must run maybe clone an option into + selectedcontent given the option.

+
+
option.selected
@@ -141391,17 +141397,6 @@ document.body.appendChild(text);

Insert an HTML element for the token.

-
An end tag whose tag name is "option"
-
-

Let option be the first option element in the stack of open - elements.

- -

Run the steps for "any other end tag."

- -

If option is no longer in the stack of open elements, then run - maybe clone an option into selectedcontent given option.

-
-
A start tag whose tag name is one of: "rb", "rtc"

If the stack of open elements has a From 19b57d9218d57b10e3194de3ca5043de087d9589 Mon Sep 17 00:00:00 2001 From: Joey Arhar Date: Wed, 8 Oct 2025 15:36:17 -0700 Subject: [PATCH 2/2] xml parser --- source | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source b/source index 30d6f0d0117..f41e6f9c608 100644 --- a/source +++ b/source @@ -57194,8 +57194,8 @@ interface HTMLOptionElement : HTMLElement {

When an option element is popped off the stack of open elements of an - HTML parser, the user agent must run maybe clone an option into - selectedcontent given the option.

+ HTML parser or XML parser, the user agent must run maybe clone an + option into selectedcontent given the option.