
    \j                        S SK Jr  S SKJr  S SKJr  S SKJr  S SKJr  S SKJ	r	  S SKJ
r
  S SKJr  S S	KJr  S S
KJr  S SKJr  S SKJr  S SKJr  S SKJr  S SKJr  S SKJr  S\S\4S jrS\S\4S jrS\S\4S jrS\S\4S jrS\S\4S jrS\S\4S jr S\S\4S jr!S\S\4S jr"S\S\4S jr#S\S\4S jr$S\S\S\SS 4S! jr%S\S\S\SS 4S" jr&S\S\S#\'\   S\SS 4
S$ jr(S\S\S\SS 4S% jr)S\S&\S\S\SS 4
S' jr* S.S\S&\S\S\S\S(\\   SS 4S) jjr+S\S&\S\S\SS 4
S* jr, S.S\S&\S\S\S\S(\\   SS 4S+ jjr-S\S&\S\S\SS 4
S, jr.S\S&\S\S\S\SS 4S- jr/g )/    )StringIO)Optional)TextIO)GenerationContext)"fully_qualified_name_for_interface)idl_identifier_cpp_name)idl_implementation_cpp_name)wrap_with_ce_reactions),wrap_with_extended_attribute_exposure_checks)GeneratedIncludes)to_idl_value)to_javascript_value)	Attribute)IDLParameterizedType)IDLType)	Interface	attributereturnc                     U R                   (       + =(       d;    SU R                  ;   =(       d%    SU R                  ;   =(       d    SU R                  ;   $ )NLegacyLenientSetterPutForwardsReplaceable)readonlyextended_attributesr   s    X/mnt/mint/home/seanl/public/Repos/ladybird/Meta/Generators/libweb_bindings/attributes.pyattribute_has_setterr      sN     	: I$A$AA	:I999	: I999	    c                    SU R                   ;   =(       a    U R                  R                  =(       a    [        U R                  [        5      =(       ao    U R                  R
                  S:H  =(       aO    [        U R                  R                  5      S:H  =(       a&    U R                  R                  S   R
                  S:H  $ )NReflectFrozenArray   r   Element)r   typenullable
isinstancer   namelen
parametersr   s    r   7attribute_is_nullable_reflected_frozen_array_of_elementr*   "   s    Y222 	;NN##	;y~~';<	; NN=0	; 	))*a/		;
 NN%%a(--:r   c                     SU R                   ;   =(       a6    U R                  R                  =(       a    U R                  R                  S:H  $ )Nr    r#   )r   r$   r%   r'   r   s    r   'attribute_is_nullable_reflected_elementr,   -   s:    	555v)..:Q:QvV_VdVdViVimvVvvr   c                 D    SU R                   ;   =(       d    [        U 5      $ )NCachedAttribute)r   r*   r   s    r   attribute_uses_cached_js_valuer/   1   s#    Y::: 	NB9Mr   c                 z    U R                   R                  S5      =(       d    U R                  R                  5       $ )Nr    )r   getr'   lowerr   s    r   reflected_attribute_namer3   8   s+    ((,,Y7Q9>>;O;O;QQr   c                 4    U R                   R                  S;   $ )N)	DOMStringUtf16DOMStringr$   r'   r   s    r   is_dom_string_typer8   <       >>"AAAr   c                 4    U R                   R                  S;   $ )N)	USVStringUtf16USVStringr7   r   s    r   is_usv_string_typer=   @   r9   r   c                 L    U R                   R                  S[        U 5      5      $ )NAttributeCallbackName)r   r1   r   r   s    r   attribute_callback_cpp_namer@   D   s#    ((,,-DF]^gFhiir   c                     [        U 5       S3$ )N_getterr@   r   s    r   attribute_getter_callback_namerD   H       ))45W==r   c                     [        U 5       S3$ )N_setterrC   r   s    r   attribute_setter_callback_namerH   L   rE   r   outincludes	interfaceNc                     UR                    Vs/ s H  nSUR                  ;  d  M  UPM     nnU Vs/ s H  nSUR                  ;  d  M  UPM     nn[        XXB5        g s  snf s  snf NFIXMELegacyUnforgeableregular_attributesr   define_the_attributesrI   rJ   rK   r   
attributess        r   define_the_regular_attributesrU   P   sq     $-#?#?#?i7R[RoRoCo	#?  
 .8tZ	;NV_VsVs;s)ZJt #?
 us   A A A%A%c                     UR                    Vs/ s H)  nSUR                  ;  d  M  SUR                  ;   d  M'  UPM+     nn[        XXB5        g s  snf rM   rP   rS   s        r   !define_the_unforgeable_attributesrW   a   s]     #555I)777 	<OS\SpSp<p 	5  
 #?s   AAArT   c                    U(       d  g U R                  S5        U GH  n[        U5      n[        U5      n[        U5      nSU 3nSU 3n	[	        5       n
U
R                  SU SUR
                   S35        SUR                  ;   a:  UR                  S5        U
R                  SU SUR                   S	U S
U S3	5        OU
R                  SU SU SU S35        [        U5      (       d  U
R                  SU	 S35        OeSUR                  ;   a:  UR                  S5        U
R                  SU	 SUR                   S	U S
U S3	5        OU
R                  SU	 SU SU S35        U
R                  SU SU S
U SU	 SU S35        U R                  [        UUR                  U
R                  5       5      5        GM     g )N
native_z	    auto z_id = "z"_utf16_fly_string;
rO   zLibWeb/Bindings/Intrinsics.hzC = host_defined_intrinsics(realm).ensure_web_unforgeable_function(""_utf16_fly_string, z_id, z!, UnforgeableKey::Type::Getter);
z% = JS::NativeFunction::create(realm, z, 0, z_id, &realm, "get"sv);
z     GC::Ptr<JS::NativeFunction> z;
z!, UnforgeableKey::Type::Setter);
z, 1, z_id, &realm, "set"sv);
zY
    // 4. Let configurable be false if attr is unforgeable and true otherwise.
    auto a	  _attributes = default_attributes;

    // 5. Let desc be the PropertyDescriptor{[[Get]]: getter, [[Set]]: setter, [[Enumerable]]: true, [[Configurable]]: configurable}.

    // 7. Perform ! DefinePropertyOrThrow(target, id, desc).
    object.define_direct_accessor(, uO  _attributes);

    // 8. FIXME: If attr’s type is an observable array type with type argument T, then set target’s backing observable array exotic object for attr to the result of creating an observable array exotic object in realm, given T, attr’s set an indexed value algorithm, and attr’s delete an indexed value algorithm.
)writerD   rH   r@   r   r'   r   addnamespaced_namer   r   getvalue)rI   rJ   rT   rK   r   getter_namesetter_namecpp_namenative_getter_namenative_setter_name
definitions              r   rR   rR   n   s    IIdO  	4Y?4Y?.y9&{m4&{m4Z

 	9XJginn5EEZ[\ )"?"??LL78.//rs|  tM  tM  sN  Nb  ck  bl  lq  r}  q~  ~`  a .//TU`Taafgofp  qI  J
 $I..?@R?SSVWX"i&C&CC;<   233v  xA  xQ  xQ  wR  Rf  go  fp  pu  vA  uB  Bd  e    233XYdXeejksjt  uM  N 	

 #
 $,*E2D1ERHZG[[]^f]g h
	
 			8--##%	
g  r   c                     UR                    HV  nSUR                  ;   a  M  SUR                   S[        U5       S3nU R	                  [        XR                  U5      5        MX     g )NrN   z*    object.define_native_accessor(realm, "r[   z , nullptr, default_attributes);
)static_attributesr   r'   rD   r]   r   )rI   rJ   rK   r   rf   s        r   define_the_static_attributesri      sx    00	i333A)..AQQe  gE  FO  gP  fQ  Qr  s
		>xIfIfhrst	 1r   contextc                 h    UR                    H"  nSUR                  ;   a  M  [        XX#U5        M$     g NrN   )rQ   r   write_attribute_getterrI   rj   rJ   rK   r   s        r   write_attribute_gettersro      s1     11	i333sX)L 2r   receiver_classc                 .
   Uc  UR                   nUR                  R                  S:H  nU(       a  UR                  S5        SnSnS[	        U5       S3n	SUR
                  ;   n
U
=(       a    UR                  R                  (       + nU=(       a    [        U5      nU=(       a    [        U5      nU
(       a+  UR                  R                  S:X  a  S[        U5       S	3n	GOU(       a<  UR                  R                  S
:X  a"  UR                  S5        S[        U5       S3n	GOaU(       a<  UR                  R                  S:X  a"  UR                  S5        S[        U5       S3n	GOU(       ac  UR                  S5        UR                  S5        S[        U5       S3n	SUR
                  ;   a   UR                  S5        S[        U5       S3n	GOU
(       Ga  [        U5      (       Ga  SUR
                  ;   a  UR                  S5        UR                  [        UR
                  S   5      5      nUc  [        SUR
                  S    S35      eSR                  S UR                   5       5      nUR
                  R                  SS5      nUR
                  R                  SU5      nUR                  R                  (       a  S [        U5       S!U S"U S#3n	OS$[        U5       S%U S&U S'U S(3	n	OU(       a  S)[        U5       S	3n	Oy[!        U5      (       a-  UR                  S*5        S+[        U5       S,[	        U5       S-3n	O<[#        U5      (       a,  UR                  S*5        S+[        U5       S.[	        U5       S-3n	S/UR
                  ;   a  S0[	        U5       S13n[#        U5      (       a   UR                  S25        S0[	        U5       S33nS n[%        U5      (       aO  S4n[#        U5      (       a  UR                  S55        S6nS7['        UR                  S8X!5       S9[	        U5       S:U S;3nU(       a  U(       d  U(       a&  [        S<UR                   S=UR                   S35      eU R)                  S>U S?[+        U5       S@U S?[+        U5       SAU	 SB['        UR                  S8X!5       SC35        g U R)                  S>U S?[+        U5       S@U S?[+        U5       SDU SEU	 SFU SGU=(       d    ['        UR                  S8X!5       SC35        g )HNPromisezLibWeb/WebIDL/Promise.h zHauto R = TRY(throw_dom_exception_if_needed(vm, [&] { return idl_object->z(); }));r    booleanz// If a reflected IDL attribute has the type boolean:
    // 1. Let contentAttributeValue be the result of running this's get the content attribute.
    // 2. If contentAttributeValue is null, then return false.
    auto R = idl_object->has_attribute("z"_utf16_fly_string);longzLibWeb/HTML/Numbers.ha  // If a reflected IDL attribute has the type long:
    // 1. Let contentAttributeValue be the result of running this's get the content attribute.
    // 2. If contentAttributeValue is not null:
    //    1. Let parsedValue be the result of integer parsing contentAttributeValue.
    //    2. If parsedValue is not an error and is within the long range, then return parsedValue.
    i32 R = 0;
    auto content_attribute_value = idl_object->get_attribute("z"_utf16_fly_string);
    if (content_attribute_value.has_value()) {
        auto maybe_parsed_value = Web::HTML::parse_integer(*content_attribute_value);
        if (maybe_parsed_value.has_value())
            R = *maybe_parsed_value;
    }unsigned longa  // If a reflected IDL attribute has the type unsigned long:
    // 1. Let contentAttributeValue be the result of running this's get the content attribute.
    // 2. Let minimum be 0.
    // FIXME: 3. If the reflected IDL attribute is limited to only positive numbers or limited to only positive numbers with fallback, then set minimum to 1.
    // FIXME: 4. If the reflected IDL attribute is clamped to the range, then set minimum to clampedMin.
    // 5. Let maximum be 2147483647 if the reflected IDL attribute is not clamped to the range; otherwise clampedMax.
    // 6. If contentAttributeValue is not null:
    //    1. Let parsedValue be the result of non-negative integer parsing contentAttributeValue.
    //    2. If parsedValue is not an error and is in the range minimum to maximum, inclusive, then return parsedValue.
    u32 R = 0;
    auto content_attribute_value = idl_object->get_attribute("at  "_utf16_fly_string);
    u32 minimum = 0;
    u32 maximum = 2147483647;
    if (content_attribute_value.has_value()) {
        auto parsed_value = Web::HTML::parse_non_negative_integer(*content_attribute_value);
        if (parsed_value.has_value()) {
            if (*parsed_value >= minimum && *parsed_value <= maximum)
                R = *parsed_value;
        }
    }zAK/Utf16String.hzLibWeb/Infra/Strings.ha  // If a reflected IDL attribute has the type USVString:
    // 1. Let element be the result of running this's get the element.
    // 2. Let contentAttributeValue be the result of running this's get the content attribute.
    auto content_attribute_value = idl_object->attribute("a  "_utf16_fly_string);

    // 3. Let attributeDefinition be the attribute definition of element's content attribute whose namespace is null and local name is the reflected content attribute name.

    // 5. Return contentAttributeValue, converted to a scalar value string.
    Utf16String R;
    if (content_attribute_value.has_value())
        R = MUST(Infra::convert_to_scalar_value_string(*content_attribute_value));URLzLibWeb/DOM/Document.ha[  "_utf16_fly_string);

    // 3. Let attributeDefinition be the attribute definition of element's content attribute whose namespace is null and local name is the reflected content attribute name.

    // 4. If attributeDefinition indicates it contains a URL:
    Utf16String R;
    if (content_attribute_value.has_value()) {
        // 2. Let urlString be the result of encoding-parsing-and-serializing a URL given contentAttributeValue, relative to element's node document.
        auto url_string = idl_object->document().encoding_parse_and_serialize_url(*content_attribute_value);

        // 3. If urlString is not failure, then return urlString.
        if (url_string.has_value())
            R = Utf16String::from_utf8(url_string.release_value());
        else
            R = MUST(Infra::convert_to_scalar_value_string(*content_attribute_value));
    }
Enumeratedz
AK/Array.hz-Unknown reflected enumerated attribute type ''r\   c              3   .   #    U  H  nS U S3v   M     g7f)"z"_utf16N ).0values     r   	<genexpr>)write_attribute_getter.<locals>.<genexpr>1  s      TAS1UG7!3ASs   MissingValueDefaultInvalidValueDefaultz// If a reflected IDL attribute is an enumerated attribute:
    // 1. Let contentAttributeValue be the result of running this's get the content attribute.
    auto R = idl_object->attribute("z"_utf16_fly_string);

    // 3. If contentAttributeValue is an ASCII case-insensitive match for one of the keywords, then return that keyword's canonical keyword.
    Array valid_values { a   };
    if (R.has_value()) {
        auto has_keyword = false;
        for (auto const& value : valid_values) {
            if (value.equals_ignoring_ascii_case(*R)) {
                has_keyword = true;
                R = value;
                break;
            }
        }

        // 4. If contentAttributeValue is not a keyword, return the invalid value default.
        if (!has_keyword)
            R = "z"_utf16;
    }z// If a reflected IDL attribute is an enumerated attribute:
    // 1. Let contentAttributeValue be the result of running this's get the content attribute.
    auto content_attribute_value = idl_object->attribute("z"_utf16_fly_string);

    // 2. If contentAttributeValue is null, then set contentAttributeValue to the missing value default.
    auto R = content_attribute_value.value_or("a3  "_utf16);
    auto did_set_to_missing_value = false;
    if (!content_attribute_value.has_value())
        did_set_to_missing_value = true;

    // 3. If contentAttributeValue is an ASCII case-insensitive match for one of the keywords, then return that keyword's canonical keyword.
    Array valid_values { a   };
    auto has_keyword = false;
    for (auto const& value : valid_values) {
        if (value.equals_ignoring_ascii_case(R)) {
            has_keyword = true;
            R = value;
            break;
        }
    }

    // 4. If contentAttributeValue is not a keyword and was not set to the missing value default, return the invalid value default.
    if (!has_keyword && !did_set_to_missing_value)
        R = "z"_utf16;a~  // If a reflected IDL attribute has the type DOMString:
    // 1. Let element be the result of running this's get the element.
    // 2. Let contentAttributeValue be the result of running this's get the content attribute.
    // 5. If contentAttributeValue is null, then return the empty string.
    // 6. Return contentAttributeValue.
    auto R = idl_object->get_attribute_value("AK/Utf16FlyString.h<static auto const& content_attribute = *new Utf16FlyString("z"_utf16_fly_string);

    auto R = idl_object->get_the_attribute_associated_element(content_attribute, TRY(throw_dom_exception_if_needed(vm, [&] { return idl_object->z	(); })));z"_utf16_fly_string);

    auto R = idl_object->get_the_attribute_associated_elements(content_attribute, TRY(throw_dom_exception_if_needed(vm, [&] { return idl_object->r.   z/    if (auto cached_value = idl_object->cached_z3())
        return JS::Value(cached_value.ptr());

z"LibWeb/WebIDL/AbstractOperations.hzi(); WebIDL::lists_contain_same_elements(cached_value, R))
        return JS::Value(cached_value.ptr());

z&js_value.as_object()zLibJS/Runtime/Array.hz$&as<JS::Array>(js_value.as_object())z2[&]() -> JS::Value {
        JS::Value js_value = RzG;
        if (js_value.is_object())
            idl_object->set_cached_(z#);
        return js_value;
    }()z&Unsupported cached promise attribute 'z' on 'JS_DEFINE_NATIVE_FUNCTION(::)
{
    WebIDL::log_trace(vm, "z");
    [[maybe_unused]] auto& realm = *vm.current_realm();

    auto steps = [&]() -> JS::ThrowCompletionOr<GC::Ptr<WebIDL::Promise>> {
        // 1. Let idlObject be null.
        [[maybe_unused]] auto* idl_object = TRY(impl_from(vm));
        u<  
        return R;
    };

    auto maybe_R = steps();

    // 2. And then, if an exception E was thrown:

    // 1. If attribute’s type is a promise type, then return ! Call(%Promise.reject%, %Promise%, «E»).
    if (maybe_R.is_throw_completion())
        return WebIDL::create_rejected_promise(realm, maybe_R.error_value())->promise();

    // 2. Otherwise, end these steps and allow the exception to propagate.
    auto R = maybe_R.release_value();

    // 4. Return the result of converting R to a JavaScript value of the type attribute is declared as.
    return ;
}

zi");
    [[maybe_unused]] auto& realm = *vm.current_realm();

    auto* idl_object = TRY(impl_from(vm));

z
    rY   z
    return )prototype_classr$   r'   r^   r	   r   r%   r8   r=   r3   enumerationr   RuntimeErrorjoinvaluesr1   r,   r*   r/   r   r]   rD   )rI   rj   rJ   rK   r   rp   attribute_type_is_promisegetter_preludegetter_cache_checkgetter_stepsis_reflectedis_non_nullable_reflected is_non_nullable_reflected_stringis_reflected_usv_stringr   valid_valuesmissing_value_defaultinvalid_value_defaultcached_return_valuecached_values                       r   rm   rm      s#    "22 ) 3 3y @ ./N^_z  |E  `F  _G  GP  QL	 = ==L , LY^^5L5L1L'@'bEWXaEb$7Y<Ny<Y	++y8) *B))L(MMae 
#y~~':':f'D,-? @XXa?b>c d
 
#y~~':':o'M,-
? @XXa?b>c 	d
( 
!'(-.; <TT];^:_ `S
V I111LL01 ; <TT];^:_ `
L& 
,Y77LILiLi<i\"))')2O2OP\2]*^_?	@]@]^j@k?llmn  yy TASAS TT + ? ? C CDY[] ^ + ? ? C CDY[p q>>"" %%=i%H$I J (. ) (( )%
L* ;;ST];^:_ `0 1F/F G (. ) $$H/0L0 
*/
 0H	/R.SSgk 
1	;	;*+WXpqzX{W| }R Sn  ox  Sy  Rz  zDG 
A	K	K*+WXpqzX{W| }S To  py  Tz  S{  {EH I999LMhirMsLt u  ?yII9:!PQlmvQwPx y  %i00.B9MMLL01AL#1)..#xYZ [$$?	$J#K1\N [	 !/!G	GWW]^g^l^l]mmnopp		*>*:"=[\e=f<g h*+2.LY.W-X Y	 
    	XGH I1	
< 	II&~&6b9WXa9b8c d*+2.LY.W-X Y
   N   ^#6y~~sH#^_ `	r   c                     UR                    H4  nSUR                  ;   a  M  [        U5      (       d  M'  [        XX#U5        M6     g rl   )rQ   r   r   write_attribute_setterrn   s        r   write_attribute_settersr     s?     11	i333#I..sX)L 2r   c                    Uc  UR                   nUR                  S5        UR                  S5        U R                  SU S[        U5       SU S[        U5       S[	        U5       S35        SUR
                  ;  a  U R                  S	5        S
UR
                  ;   a   U R                  SUR                   S35        g SUR
                  ;   a  U R                  S5        SUR
                  ;   a  U R                  S5        g UR
                  R                  S5      =n(       a4  UR                  S5        U R                  SUR                   SU S35        g S[        U5       S3nSUR
                  ;   nU=(       a    UR                  R                  (       + n	U=(       a(    UR                  R                  =(       a    [        U5      n
U	=(       a    [        U5      nU	=(       a    [        U5      nS[        S[        4S jnU(       a7  UR                  R                  S:X  a  S[        U5       S[        U5       S3nGO~U	(       a+  UR                  R                  S:X  a  S [        U5       S!3nGOLU	(       a+  UR                  R                  S":X  a  S#[        U5       S$3nGOU(       a  S#[        U5       S%U" S&5       S'3nOU(       a  S#[        U5       S%U" S&5       S'3nOU
(       a%  S([        U5       S[        U5       S%U" S)5       S'3nO[        U5      (       a9  UR                  S*5        S+[        U5       S,[        U5       S-[        U5       S.3nOe[!        U5      (       aU  UR                  S*5        UR                  S/5        S0[        U5       S1[        U5       S2[        U5       S3[        U5       S43	nU R                  S55        UR#                  UR                  5      b!  U R                  S6[%        US7X!5       S835        O U R                  S9[%        US7X!5       S:35        U R                  S;U S<35        S=UR
                  ;   a  ['        US>5      nOS>nU R                  S?U S@35        g )ANzLibJS/Runtime/Value.hzLibWeb/WebIDL/Tracing.hr   r   r   u~  ");
    [[maybe_unused]] auto& realm = *vm.current_realm();

    // 1. Let V be undefined.
    auto V = JS::js_undefined();

    // 2. If any arguments were passed, then set V to the value of the first argument passed.
    if (vm.argument_count() > 0)
        V = vm.argument(0);

    // 3. Let id be attribute’s identifier.

    // 4. Let idlObject be null.
    [[maybe_unused]] uX  * idl_object = nullptr;

    // 5. If attribute is a regular attribute:

    // 1. Let jsValue be the this value, if it is not null or undefined, or realm’s global object otherwise. (This will subsequently cause a TypeError in a few steps, if the global object does not implement target and [LegacyLenientThis] is not specified.)
    auto js_value = vm.this_value();
    if (js_value.is_nullish())
        js_value = &realm.global_object();

    // 2. FIXME: If jsValue is a platform object, then perform a security check, passing jsValue, attribute’s identifier, and "setter".

    // 3. Let validThis be true if jsValue implements target, or false otherwise.
    auto maybe_idl_object = impl_from(vm, js_value);

    // 4. If validThis is false and attribute was not specified with the [LegacyLenientThis] extended attribute, then throw a TypeError.
LegacyLenientThisz)    idl_object = TRY(maybe_idl_object);

r   z    // 5. If attribute is declared with the [Replaceable] extended attribute, then:
    // 1. Perform ? CreateDataPropertyOrThrow(jsValue, id, V).
    TRY(idl_object->create_data_property_or_throw("zX"_utf16_fly_string, V));

    // 2. Return undefined.
    return JS::js_undefined();
}

a      // 6. If validThis is false, then return undefined.
    if (maybe_idl_object.is_error())
        return JS::js_undefined();

    // 5. Set idlObject to the IDL interface type value that represents a reference to jsValue.
    idl_object = maybe_idl_object.release_value();

r   z    // 7. If attribute is declared with a [LegacyLenientSetter] extended attribute, then return undefined.
    return JS::js_undefined();
}

r   zLibJS/Runtime/PropertyKey.hz    // 8. If attribute is declared with a [PutForwards] extended attribute, then:

    // 1. Let Q be ? Get(jsValue, id).
    auto receiver_value = TRY(idl_object->get("ay  "_utf16_fly_string));

    // 2. If Q is not an Object, then throw a TypeError.
    if (!receiver_value.is_object())
        return vm.throw_completion<JS::TypeError>(JS::ErrorType::NotAnObject, receiver_value);
    auto& receiver = receiver_value.as_object();

    // 3. Let forwardId be the identifier argument of the [PutForwards] extended attribute.
    auto forward_id = "a  "_utf16_fly_string;

    // 4. Perform ? Set(Q, forwardId, V, false).
    TRY(receiver.set(JS::PropertyKey { forward_id, JS::PropertyKey::StringMayBeNumber::No }, V, JS::Object::ShouldThrowExceptions::No));

    // 5. Return undefined.
    return JS::js_undefined();
}

zCTRY(throw_dom_exception_if_needed(vm, [&] { return idl_object->set_z (idl_value); }));
    return {};r    r~   r   c                     SU  S3$ )Nzattribute_value_to_utf16()r|   )r~   s    r   as_utf16_string_expression:write_attribute_setter.<locals>.as_utf16_string_expressionD  s    *5'33r   rt   z6if (!idl_value)
        idl_object->remove_attribute("zG"_utf16_fly_string);
    else
        idl_object->set_attribute_value("z3"_utf16_fly_string, Utf16String {});
    return {};rv   zu32 minimum = 0;
    u32 new_value = minimum;
    if (idl_value >= minimum && idl_value <= 2147483647)
        new_value = idl_value;
    idl_object->set_attribute_value("zC"_utf16_fly_string, Utf16String::number(new_value));
    return {};ru   z!idl_object->set_attribute_value("zC"_utf16_fly_string, Utf16String::number(idl_value));
    return {};r[   	idl_valuez);
    return {};zBif (!idl_value.has_value())
        idl_object->remove_attribute("z
*idl_valuer   r   zD"_utf16_fly_string);

    if (!idl_value) {
        idl_object->set_z({});
        idl_object->remove_attribute(content_attribute);
        return {};
    }

    idl_object->set_attribute_value(content_attribute, Utf16String {});

    idl_object->set_z(*idl_value);
    return {};zLibGC/Weak.hzidl_object->set_cached_zL(nullptr);

    static auto const& content_attribute = *new Utf16FlyString("zP"_utf16_fly_string);

    if (!idl_value.has_value()) {
        idl_object->set_an  ({});
        idl_object->remove_attribute(content_attribute);
        return {};
    }

    idl_object->set_attribute_value(content_attribute, Utf16String {});

    Vector<GC::Weak<DOM::Element>> elements;
    elements.ensure_capacity(idl_value->size());

    for (auto const& element : *idl_value)
        elements.unchecked_append(*element);

    idl_object->set_z (move(elements));
    return {};zF    auto original_steps = [&]() -> JS::ThrowCompletionOr<JS::Value> {
z        // 6. Let idlValue be determined as follows:
        // -> attribute's type is an enumeration
        // 1. Let S be ? ToString(V).
        auto maybe_idl_value = throw_dom_exception_if_needed(vm, [&] { return Va+  ; });

        // 2. If S is not one of the enumeration's values, then return undefined.
        if (maybe_idl_value.is_error())
            return JS::js_undefined();

        // 3. Otherwise, idlValue is the enumeration value equal to S.
        auto idl_value = maybe_idl_value.release_value();

u           // 6. Let idlValue be determined as follows:
        // -> Otherwise, idlValue is the result of converting V to an IDL value of attribute’s type.
        auto idl_value = TRY(throw_dom_exception_if_needed(vm, [&] { return z; }));

z        // 7. Run the setter steps of attribute with idlObject as this and idlValue as the value.
        auto setter_result = [&]() -> JS::ThrowCompletionOr<void> {
            z
        }();

        if (setter_result.is_error())
            return setter_result.release_error();

        return JS::js_undefined();
    };
CEReactionszoriginal_steps()z,
    // 8. Return undefined.
    return TRY(z);
}

)r   r^   r]   rH   r   r   r'   r1   r	   r$   r%   r8   r=   strr3   r,   r*   r   r   r
   )rI   rj   rJ   rK   r   rp   put_forwards_identifiersetter_stepsr   r   is_nullable_reflected_stringr   r   r   setter_results                  r   r   r     sw    "22LL()LL*+II&~&6b9WXa9b8c d*+2.LY.W-X Y 9CD E	 B )"?"??			

 	555		44=NN3C D
	
 	i;;;				
 	 = ==			
 	"+"?"?"C"CM"RRR23		0 1:/? @ 00 	1	
. 	YZuv  [A  ZB  Bf  gL	 = ==L , LY^^5L5L1L#/#mINN4K4K#mPbclPm '@'bEWXaEb$7Y<Ny<Y4# 4# 4 	++y8''?	'J&K L**B9*M)N O
 
#y~~':':o'M& '?y&I%J K	 
#y~~':':f'D:;ST];^:_  `f  g	 :;ST];^:__s  uO  P[  u\  t]  ]q  r	):;ST];^:__s  uO  P[  u\  t]  ]q  r	%''?	'J&K L**B9*M)NNbc}  K  dL  cM M
 
1	;	;*+WXpqzX{W| } 5Y?@ A 1;< = 
A	K	K*+^$23Ny3Y2Z [AAYZcAd@e f 5Y?@ A 1;< =%( II	 9>>*6		P Q]]fhkmuP  PA 	A	
  			NNZ[dfiksN}M~ 	
 IIN 
	 	555.x9KL*II   r   c                 h    UR                    H"  nSUR                  ;   a  M  [        XX#U5        M$     g rl   )rh   r   write_static_attribute_getterrn   s        r   write_static_attribute_gettersr     s1     00	i333%cHS 1r   c                     U R                  SUR                   S[        U5       SUR                   S[        U5       S[        U5       S[	        U5       S[        UR                  SX!5       S35        g )Nr   r   r   z");

    // Let R be the result of running the getter steps of attribute.
    auto R = TRY(throw_dom_exception_if_needed(vm, [&] { return z|(vm); }));

    // Return the result of converting R to a JavaScript value of the type attribute is declared as.
    return r   r   )r]   constructor_classrD   r   r	   r   r$   rn   s        r   r   r     s     II,Y-H-H,ILjktLuKv w%778;YZc;d:e fB CeenBoAppr  tO  PY  tZ  s[ [  	XGH I r   )N)0ior   typingr   r   "Generators.libweb_bindings.contextr   $Generators.libweb_bindings.cpp_typesr   r   r	   .Generators.libweb_bindings.extended_attributesr
   r   #Generators.libweb_bindings.includesr   'Generators.libweb_bindings.to_idl_valuer   &Generators.libweb_bindings.to_js_valuer   Utils.webidl_parserr   r   r   r   boolr   r*   r,   r/   r   r3   r8   r=   r@   rD   rH   rU   rW   listrR   ri   ro   rm   r   r   r   r   r|   r   r   <module>r      sP      @ S H L Q g A @ F ) 4 ' )I $ y UY wy wT wi D R	 Rc RB) B BB) B Bj9 j j>i >C >>i >C >@	@@ @ 
	@"
@	
@
@ 
@ 
	
@E
	E
E
 YE
 	E

 
E
Puf u8I uV_ udh uM	M+M7HMU^M	M %)u	uu  u 	u
 u SMu 
upM	M+M7HMU^M	M" %)m	mm  m 	m
 m SMm 
m`T	T+T7HTU^T	T	   	
  
r   