LibWeb: Use the [Reflect] attribute to implement HTMLLinkElement.as

Also ensure that all valid potential destinations are allowed permitted.
This commit is contained in:
Tim Ledbetter 2024-11-28 20:38:36 +00:00 committed by Andreas Kling
commit 4ad8ba11d5
Notes: github-actions[bot] 2024-11-29 08:49:55 +00:00
3 changed files with 29 additions and 21 deletions

View file

@ -3,6 +3,34 @@
#import <HTML/HTMLElement.idl>
#import <HTML/Scripting/Fetching.idl>
// https://fetch.spec.whatwg.org/#concept-potential-destination
enum PotentialDestination {
"",
"audio",
"audioworklet",
"document",
"embed",
"font",
"frame",
"iframe",
"image",
"json",
"manifest",
"object",
"paintworklet",
"report",
"script",
"serviceworker",
"sharedworker",
"style",
"track",
"video",
"webidentity",
"worker",
"xslt",
"fetch"
};
// https://html.spec.whatwg.org/multipage/semantics.html#htmllinkelement
[Exposed=Window]
interface HTMLLinkElement : HTMLElement {
@ -12,7 +40,7 @@ interface HTMLLinkElement : HTMLElement {
[CEReactions, Reflect, URL] attribute USVString href;
[CEReactions, Reflect=crossorigin, Enumerated=CORSSettingsAttribute] attribute DOMString? crossOrigin;
[CEReactions, Reflect] attribute DOMString rel;
[CEReactions] attribute DOMString as;
[CEReactions, Reflect, Enumerated=PotentialDestination] attribute DOMString as;
[SameObject, PutForwards=value] readonly attribute DOMTokenList relList;
[CEReactions, Reflect] attribute DOMString media;
[CEReactions, Reflect] attribute DOMString integrity;