From 3ef8c7419a2bbcfa0f028a8db521bfc567f8a002 Mon Sep 17 00:00:00 2001 From: Psychpsyo <60073468+Psychpsyo@users.noreply.github.com> Date: Mon, 16 Sep 2024 21:57:58 +0200 Subject: [PATCH 1/2] Add htmlFor and className aliases This adds for as an alias for htmlFor to be more consistent and intuitive. This is now possible since 'for' is no longer a globally reserved word in Javascript. It also updates one example to match the new 'class' alias for 'className' from the DOM spec. fixes #9379 --- source | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/source b/source index e8c4389d51c..cb9984cef5c 100644 --- a/source +++ b/source @@ -46242,7 +46242,8 @@ interface HTMLLabelElement : HTMLElement { [HTMLConstructor] constructor(); readonly attribute HTMLFormElement? form; - [CEReactions] attribute DOMString htmlFor; + [CEReactions] attribute DOMString for; + [CEReactions] attribute DOMString htmlFor; // legacy alias of .for readonly attribute HTMLElement? control; }; @@ -46348,8 +46349,9 @@ interface HTMLLabelElement : HTMLElement {
-

The htmlFor - IDL attribute must reflect the for content +

The for and + htmlFor + IDL attributes must reflect the for content attribute.

The control @@ -54870,7 +54872,8 @@ Daddy"></textarea> interface HTMLOutputElement : HTMLElement { [HTMLConstructor] constructor(); - [SameObject, PutForwards=value] readonly attribute DOMTokenList htmlFor; + [SameObject, PutForwards=value] readonly attribute DOMTokenList for; + [SameObject, PutForwards=value] readonly attribute DOMTokenList htmlFor; // legacy alias of .for readonly attribute HTMLFormElement? form; [CEReactions] attribute DOMString name; @@ -54993,7 +54996,8 @@ interface HTMLOutputElement : HTMLElement { getter steps are to return "output".

The htmlFor IDL attribute must reflect the for and htmlFor IDL attributes must reflect the for content attribute.

The willValidate, navigation.currentEntry.index) { - li.className = "forward"; + li.class = "forward"; } else { - li.className = "current"; + li.class = "current"; } li.textContent = entry.url; @@ -137923,7 +137927,8 @@ interface HTMLParamElement : HTMLElement {

partial interface HTMLScriptElement {
   [CEReactions] attribute DOMString charset;
   [CEReactions] attribute DOMString event;
-  [CEReactions] attribute DOMString htmlFor;
+  [CEReactions] attribute DOMString for;
+  [CEReactions] attribute DOMString htmlFor; // legacy alias of .for
 };

The HTMLParamElement : HTMLElement { must reflect the respective content attributes of the same name.

The htmlFor IDL attribute of the script element + data-x="dom-script-for">for and htmlFor IDL attributes of the script element must reflect the element's for content attribute.

@@ -144905,6 +144911,7 @@ INSERT INTERFACES HERE Prateek Rungta, Pravir Gupta, Prayag Verma, + Psychpsyo, 李普君 (Pujun Li), Rachid Finge, Rafael Weinstein, From 85ee34b0c47ae57d70b4e20acf41507ece5c28b7 Mon Sep 17 00:00:00 2001 From: Psychpsyo <60073468+Psychpsyo@users.noreply.github.com> Date: Tue, 17 Sep 2024 14:40:30 +0200 Subject: [PATCH 2/2] Remove 'for' IDL attribute from script --- source | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/source b/source index cb9984cef5c..fe15e91ca2a 100644 --- a/source +++ b/source @@ -137927,8 +137927,7 @@ interface HTMLParamElement : HTMLElement {
partial interface HTMLScriptElement {
   [CEReactions] attribute DOMString charset;
   [CEReactions] attribute DOMString event;
-  [CEReactions] attribute DOMString for;
-  [CEReactions] attribute DOMString htmlFor; // legacy alias of .for
+  [CEReactions] attribute DOMString htmlFor;
 };

The HTMLParamElement : HTMLElement { must reflect the respective content attributes of the same name.

The for and htmlFor IDL attributes of the script element + data-x="dom-script-htmlFor">htmlFor IDL attribute of the script element must reflect the element's for content attribute.