Document.js 144 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511
  1. "use strict";
  2. const conversions = require("webidl-conversions");
  3. const utils = require("./utils.js");
  4. const ElementCreationOptions = require("./ElementCreationOptions.js");
  5. const ceReactionsPreSteps_jsdom_living_helpers_custom_elements =
  6. require("../../jsdom/living/helpers/custom-elements.js").ceReactionsPreSteps;
  7. const ceReactionsPostSteps_jsdom_living_helpers_custom_elements =
  8. require("../../jsdom/living/helpers/custom-elements.js").ceReactionsPostSteps;
  9. const Node = require("./Node.js");
  10. const NodeFilter = require("./NodeFilter.js");
  11. const HTMLElement = require("./HTMLElement.js");
  12. const EventHandlerNonNull = require("./EventHandlerNonNull.js");
  13. const OnErrorEventHandlerNonNull = require("./OnErrorEventHandlerNonNull.js");
  14. const implSymbol = utils.implSymbol;
  15. const ctorRegistrySymbol = utils.ctorRegistrySymbol;
  16. const interfaceName = "Document";
  17. exports.is = value => {
  18. return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation;
  19. };
  20. exports.isImpl = value => {
  21. return utils.isObject(value) && value instanceof Impl.implementation;
  22. };
  23. exports.convert = (globalObject, value, { context = "The provided value" } = {}) => {
  24. if (exports.is(value)) {
  25. return utils.implForWrapper(value);
  26. }
  27. throw new globalObject.TypeError(`${context} is not of type 'Document'.`);
  28. };
  29. function makeWrapper(globalObject, newTarget) {
  30. let proto;
  31. if (newTarget !== undefined) {
  32. proto = newTarget.prototype;
  33. }
  34. if (!utils.isObject(proto)) {
  35. proto = globalObject[ctorRegistrySymbol]["Document"].prototype;
  36. }
  37. return Object.create(proto);
  38. }
  39. exports.create = (globalObject, constructorArgs, privateData) => {
  40. const wrapper = makeWrapper(globalObject);
  41. return exports.setup(wrapper, globalObject, constructorArgs, privateData);
  42. };
  43. exports.createImpl = (globalObject, constructorArgs, privateData) => {
  44. const wrapper = exports.create(globalObject, constructorArgs, privateData);
  45. return utils.implForWrapper(wrapper);
  46. };
  47. function getUnforgeables(globalObject) {
  48. let unforgeables = unforgeablesMap.get(globalObject);
  49. if (unforgeables === undefined) {
  50. unforgeables = Object.create(null);
  51. utils.define(unforgeables, {
  52. get location() {
  53. const esValue = this !== null && this !== undefined ? this : globalObject;
  54. if (!exports.is(esValue)) {
  55. throw new globalObject.TypeError(
  56. "'get location' called on an object that is not a valid instance of Document."
  57. );
  58. }
  59. return utils.tryWrapperForImpl(esValue[implSymbol]["location"]);
  60. },
  61. set location(V) {
  62. const esValue = this !== null && this !== undefined ? this : globalObject;
  63. if (!exports.is(esValue)) {
  64. throw new globalObject.TypeError(
  65. "'set location' called on an object that is not a valid instance of Document."
  66. );
  67. }
  68. const Q = esValue["location"];
  69. if (!utils.isObject(Q)) {
  70. throw new globalObject.TypeError("Property 'location' is not an object");
  71. }
  72. Reflect.set(Q, "href", V);
  73. }
  74. });
  75. Object.defineProperties(unforgeables, {
  76. location: { configurable: false }
  77. });
  78. unforgeablesMap.set(globalObject, unforgeables);
  79. }
  80. return unforgeables;
  81. }
  82. exports._internalSetup = (wrapper, globalObject) => {
  83. Node._internalSetup(wrapper, globalObject);
  84. utils.define(wrapper, getUnforgeables(globalObject));
  85. };
  86. exports.setup = (wrapper, globalObject, constructorArgs = [], privateData = {}) => {
  87. privateData.wrapper = wrapper;
  88. exports._internalSetup(wrapper, globalObject);
  89. Object.defineProperty(wrapper, implSymbol, {
  90. value: new Impl.implementation(globalObject, constructorArgs, privateData),
  91. configurable: true
  92. });
  93. wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
  94. if (Impl.init) {
  95. Impl.init(wrapper[implSymbol]);
  96. }
  97. return wrapper;
  98. };
  99. exports.new = (globalObject, newTarget) => {
  100. const wrapper = makeWrapper(globalObject, newTarget);
  101. exports._internalSetup(wrapper, globalObject);
  102. Object.defineProperty(wrapper, implSymbol, {
  103. value: Object.create(Impl.implementation.prototype),
  104. configurable: true
  105. });
  106. wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
  107. if (Impl.init) {
  108. Impl.init(wrapper[implSymbol]);
  109. }
  110. return wrapper[implSymbol];
  111. };
  112. const unforgeablesMap = new WeakMap();
  113. const exposed = new Set(["Window"]);
  114. exports.install = (globalObject, globalNames) => {
  115. if (!globalNames.some(globalName => exposed.has(globalName))) {
  116. return;
  117. }
  118. const ctorRegistry = utils.initCtorRegistry(globalObject);
  119. class Document extends globalObject.Node {
  120. constructor() {
  121. return exports.setup(Object.create(new.target.prototype), globalObject, undefined);
  122. }
  123. getElementsByTagName(qualifiedName) {
  124. const esValue = this !== null && this !== undefined ? this : globalObject;
  125. if (!exports.is(esValue)) {
  126. throw new globalObject.TypeError(
  127. "'getElementsByTagName' called on an object that is not a valid instance of Document."
  128. );
  129. }
  130. if (arguments.length < 1) {
  131. throw new globalObject.TypeError(
  132. `Failed to execute 'getElementsByTagName' on 'Document': 1 argument required, but only ${arguments.length} present.`
  133. );
  134. }
  135. const args = [];
  136. {
  137. let curArg = arguments[0];
  138. curArg = conversions["DOMString"](curArg, {
  139. context: "Failed to execute 'getElementsByTagName' on 'Document': parameter 1",
  140. globals: globalObject
  141. });
  142. args.push(curArg);
  143. }
  144. return utils.tryWrapperForImpl(esValue[implSymbol].getElementsByTagName(...args));
  145. }
  146. getElementsByTagNameNS(namespace, localName) {
  147. const esValue = this !== null && this !== undefined ? this : globalObject;
  148. if (!exports.is(esValue)) {
  149. throw new globalObject.TypeError(
  150. "'getElementsByTagNameNS' called on an object that is not a valid instance of Document."
  151. );
  152. }
  153. if (arguments.length < 2) {
  154. throw new globalObject.TypeError(
  155. `Failed to execute 'getElementsByTagNameNS' on 'Document': 2 arguments required, but only ${arguments.length} present.`
  156. );
  157. }
  158. const args = [];
  159. {
  160. let curArg = arguments[0];
  161. if (curArg === null || curArg === undefined) {
  162. curArg = null;
  163. } else {
  164. curArg = conversions["DOMString"](curArg, {
  165. context: "Failed to execute 'getElementsByTagNameNS' on 'Document': parameter 1",
  166. globals: globalObject
  167. });
  168. }
  169. args.push(curArg);
  170. }
  171. {
  172. let curArg = arguments[1];
  173. curArg = conversions["DOMString"](curArg, {
  174. context: "Failed to execute 'getElementsByTagNameNS' on 'Document': parameter 2",
  175. globals: globalObject
  176. });
  177. args.push(curArg);
  178. }
  179. return utils.tryWrapperForImpl(esValue[implSymbol].getElementsByTagNameNS(...args));
  180. }
  181. getElementsByClassName(classNames) {
  182. const esValue = this !== null && this !== undefined ? this : globalObject;
  183. if (!exports.is(esValue)) {
  184. throw new globalObject.TypeError(
  185. "'getElementsByClassName' called on an object that is not a valid instance of Document."
  186. );
  187. }
  188. if (arguments.length < 1) {
  189. throw new globalObject.TypeError(
  190. `Failed to execute 'getElementsByClassName' on 'Document': 1 argument required, but only ${arguments.length} present.`
  191. );
  192. }
  193. const args = [];
  194. {
  195. let curArg = arguments[0];
  196. curArg = conversions["DOMString"](curArg, {
  197. context: "Failed to execute 'getElementsByClassName' on 'Document': parameter 1",
  198. globals: globalObject
  199. });
  200. args.push(curArg);
  201. }
  202. return utils.tryWrapperForImpl(esValue[implSymbol].getElementsByClassName(...args));
  203. }
  204. createElement(localName) {
  205. const esValue = this !== null && this !== undefined ? this : globalObject;
  206. if (!exports.is(esValue)) {
  207. throw new globalObject.TypeError(
  208. "'createElement' called on an object that is not a valid instance of Document."
  209. );
  210. }
  211. if (arguments.length < 1) {
  212. throw new globalObject.TypeError(
  213. `Failed to execute 'createElement' on 'Document': 1 argument required, but only ${arguments.length} present.`
  214. );
  215. }
  216. const args = [];
  217. {
  218. let curArg = arguments[0];
  219. curArg = conversions["DOMString"](curArg, {
  220. context: "Failed to execute 'createElement' on 'Document': parameter 1",
  221. globals: globalObject
  222. });
  223. args.push(curArg);
  224. }
  225. {
  226. let curArg = arguments[1];
  227. if (curArg !== undefined) {
  228. if (curArg === null || curArg === undefined) {
  229. curArg = ElementCreationOptions.convert(globalObject, curArg, {
  230. context: "Failed to execute 'createElement' on 'Document': parameter 2"
  231. });
  232. } else if (utils.isObject(curArg)) {
  233. curArg = ElementCreationOptions.convert(globalObject, curArg, {
  234. context: "Failed to execute 'createElement' on 'Document': parameter 2" + " dictionary"
  235. });
  236. } else {
  237. curArg = conversions["DOMString"](curArg, {
  238. context: "Failed to execute 'createElement' on 'Document': parameter 2",
  239. globals: globalObject
  240. });
  241. }
  242. }
  243. args.push(curArg);
  244. }
  245. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  246. try {
  247. return utils.tryWrapperForImpl(esValue[implSymbol].createElement(...args));
  248. } finally {
  249. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  250. }
  251. }
  252. createElementNS(namespace, qualifiedName) {
  253. const esValue = this !== null && this !== undefined ? this : globalObject;
  254. if (!exports.is(esValue)) {
  255. throw new globalObject.TypeError(
  256. "'createElementNS' called on an object that is not a valid instance of Document."
  257. );
  258. }
  259. if (arguments.length < 2) {
  260. throw new globalObject.TypeError(
  261. `Failed to execute 'createElementNS' on 'Document': 2 arguments required, but only ${arguments.length} present.`
  262. );
  263. }
  264. const args = [];
  265. {
  266. let curArg = arguments[0];
  267. if (curArg === null || curArg === undefined) {
  268. curArg = null;
  269. } else {
  270. curArg = conversions["DOMString"](curArg, {
  271. context: "Failed to execute 'createElementNS' on 'Document': parameter 1",
  272. globals: globalObject
  273. });
  274. }
  275. args.push(curArg);
  276. }
  277. {
  278. let curArg = arguments[1];
  279. curArg = conversions["DOMString"](curArg, {
  280. context: "Failed to execute 'createElementNS' on 'Document': parameter 2",
  281. globals: globalObject
  282. });
  283. args.push(curArg);
  284. }
  285. {
  286. let curArg = arguments[2];
  287. if (curArg !== undefined) {
  288. if (curArg === null || curArg === undefined) {
  289. curArg = ElementCreationOptions.convert(globalObject, curArg, {
  290. context: "Failed to execute 'createElementNS' on 'Document': parameter 3"
  291. });
  292. } else if (utils.isObject(curArg)) {
  293. curArg = ElementCreationOptions.convert(globalObject, curArg, {
  294. context: "Failed to execute 'createElementNS' on 'Document': parameter 3" + " dictionary"
  295. });
  296. } else {
  297. curArg = conversions["DOMString"](curArg, {
  298. context: "Failed to execute 'createElementNS' on 'Document': parameter 3",
  299. globals: globalObject
  300. });
  301. }
  302. }
  303. args.push(curArg);
  304. }
  305. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  306. try {
  307. return utils.tryWrapperForImpl(esValue[implSymbol].createElementNS(...args));
  308. } finally {
  309. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  310. }
  311. }
  312. createDocumentFragment() {
  313. const esValue = this !== null && this !== undefined ? this : globalObject;
  314. if (!exports.is(esValue)) {
  315. throw new globalObject.TypeError(
  316. "'createDocumentFragment' called on an object that is not a valid instance of Document."
  317. );
  318. }
  319. return utils.tryWrapperForImpl(esValue[implSymbol].createDocumentFragment());
  320. }
  321. createTextNode(data) {
  322. const esValue = this !== null && this !== undefined ? this : globalObject;
  323. if (!exports.is(esValue)) {
  324. throw new globalObject.TypeError(
  325. "'createTextNode' called on an object that is not a valid instance of Document."
  326. );
  327. }
  328. if (arguments.length < 1) {
  329. throw new globalObject.TypeError(
  330. `Failed to execute 'createTextNode' on 'Document': 1 argument required, but only ${arguments.length} present.`
  331. );
  332. }
  333. const args = [];
  334. {
  335. let curArg = arguments[0];
  336. curArg = conversions["DOMString"](curArg, {
  337. context: "Failed to execute 'createTextNode' on 'Document': parameter 1",
  338. globals: globalObject
  339. });
  340. args.push(curArg);
  341. }
  342. return utils.tryWrapperForImpl(esValue[implSymbol].createTextNode(...args));
  343. }
  344. createCDATASection(data) {
  345. const esValue = this !== null && this !== undefined ? this : globalObject;
  346. if (!exports.is(esValue)) {
  347. throw new globalObject.TypeError(
  348. "'createCDATASection' called on an object that is not a valid instance of Document."
  349. );
  350. }
  351. if (arguments.length < 1) {
  352. throw new globalObject.TypeError(
  353. `Failed to execute 'createCDATASection' on 'Document': 1 argument required, but only ${arguments.length} present.`
  354. );
  355. }
  356. const args = [];
  357. {
  358. let curArg = arguments[0];
  359. curArg = conversions["DOMString"](curArg, {
  360. context: "Failed to execute 'createCDATASection' on 'Document': parameter 1",
  361. globals: globalObject
  362. });
  363. args.push(curArg);
  364. }
  365. return utils.tryWrapperForImpl(esValue[implSymbol].createCDATASection(...args));
  366. }
  367. createComment(data) {
  368. const esValue = this !== null && this !== undefined ? this : globalObject;
  369. if (!exports.is(esValue)) {
  370. throw new globalObject.TypeError(
  371. "'createComment' called on an object that is not a valid instance of Document."
  372. );
  373. }
  374. if (arguments.length < 1) {
  375. throw new globalObject.TypeError(
  376. `Failed to execute 'createComment' on 'Document': 1 argument required, but only ${arguments.length} present.`
  377. );
  378. }
  379. const args = [];
  380. {
  381. let curArg = arguments[0];
  382. curArg = conversions["DOMString"](curArg, {
  383. context: "Failed to execute 'createComment' on 'Document': parameter 1",
  384. globals: globalObject
  385. });
  386. args.push(curArg);
  387. }
  388. return utils.tryWrapperForImpl(esValue[implSymbol].createComment(...args));
  389. }
  390. createProcessingInstruction(target, data) {
  391. const esValue = this !== null && this !== undefined ? this : globalObject;
  392. if (!exports.is(esValue)) {
  393. throw new globalObject.TypeError(
  394. "'createProcessingInstruction' called on an object that is not a valid instance of Document."
  395. );
  396. }
  397. if (arguments.length < 2) {
  398. throw new globalObject.TypeError(
  399. `Failed to execute 'createProcessingInstruction' on 'Document': 2 arguments required, but only ${arguments.length} present.`
  400. );
  401. }
  402. const args = [];
  403. {
  404. let curArg = arguments[0];
  405. curArg = conversions["DOMString"](curArg, {
  406. context: "Failed to execute 'createProcessingInstruction' on 'Document': parameter 1",
  407. globals: globalObject
  408. });
  409. args.push(curArg);
  410. }
  411. {
  412. let curArg = arguments[1];
  413. curArg = conversions["DOMString"](curArg, {
  414. context: "Failed to execute 'createProcessingInstruction' on 'Document': parameter 2",
  415. globals: globalObject
  416. });
  417. args.push(curArg);
  418. }
  419. return utils.tryWrapperForImpl(esValue[implSymbol].createProcessingInstruction(...args));
  420. }
  421. importNode(node) {
  422. const esValue = this !== null && this !== undefined ? this : globalObject;
  423. if (!exports.is(esValue)) {
  424. throw new globalObject.TypeError("'importNode' called on an object that is not a valid instance of Document.");
  425. }
  426. if (arguments.length < 1) {
  427. throw new globalObject.TypeError(
  428. `Failed to execute 'importNode' on 'Document': 1 argument required, but only ${arguments.length} present.`
  429. );
  430. }
  431. const args = [];
  432. {
  433. let curArg = arguments[0];
  434. curArg = Node.convert(globalObject, curArg, {
  435. context: "Failed to execute 'importNode' on 'Document': parameter 1"
  436. });
  437. args.push(curArg);
  438. }
  439. {
  440. let curArg = arguments[1];
  441. if (curArg !== undefined) {
  442. curArg = conversions["boolean"](curArg, {
  443. context: "Failed to execute 'importNode' on 'Document': parameter 2",
  444. globals: globalObject
  445. });
  446. } else {
  447. curArg = false;
  448. }
  449. args.push(curArg);
  450. }
  451. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  452. try {
  453. return utils.tryWrapperForImpl(esValue[implSymbol].importNode(...args));
  454. } finally {
  455. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  456. }
  457. }
  458. adoptNode(node) {
  459. const esValue = this !== null && this !== undefined ? this : globalObject;
  460. if (!exports.is(esValue)) {
  461. throw new globalObject.TypeError("'adoptNode' called on an object that is not a valid instance of Document.");
  462. }
  463. if (arguments.length < 1) {
  464. throw new globalObject.TypeError(
  465. `Failed to execute 'adoptNode' on 'Document': 1 argument required, but only ${arguments.length} present.`
  466. );
  467. }
  468. const args = [];
  469. {
  470. let curArg = arguments[0];
  471. curArg = Node.convert(globalObject, curArg, {
  472. context: "Failed to execute 'adoptNode' on 'Document': parameter 1"
  473. });
  474. args.push(curArg);
  475. }
  476. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  477. try {
  478. return utils.tryWrapperForImpl(esValue[implSymbol].adoptNode(...args));
  479. } finally {
  480. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  481. }
  482. }
  483. createAttribute(localName) {
  484. const esValue = this !== null && this !== undefined ? this : globalObject;
  485. if (!exports.is(esValue)) {
  486. throw new globalObject.TypeError(
  487. "'createAttribute' called on an object that is not a valid instance of Document."
  488. );
  489. }
  490. if (arguments.length < 1) {
  491. throw new globalObject.TypeError(
  492. `Failed to execute 'createAttribute' on 'Document': 1 argument required, but only ${arguments.length} present.`
  493. );
  494. }
  495. const args = [];
  496. {
  497. let curArg = arguments[0];
  498. curArg = conversions["DOMString"](curArg, {
  499. context: "Failed to execute 'createAttribute' on 'Document': parameter 1",
  500. globals: globalObject
  501. });
  502. args.push(curArg);
  503. }
  504. return utils.tryWrapperForImpl(esValue[implSymbol].createAttribute(...args));
  505. }
  506. createAttributeNS(namespace, qualifiedName) {
  507. const esValue = this !== null && this !== undefined ? this : globalObject;
  508. if (!exports.is(esValue)) {
  509. throw new globalObject.TypeError(
  510. "'createAttributeNS' called on an object that is not a valid instance of Document."
  511. );
  512. }
  513. if (arguments.length < 2) {
  514. throw new globalObject.TypeError(
  515. `Failed to execute 'createAttributeNS' on 'Document': 2 arguments required, but only ${arguments.length} present.`
  516. );
  517. }
  518. const args = [];
  519. {
  520. let curArg = arguments[0];
  521. if (curArg === null || curArg === undefined) {
  522. curArg = null;
  523. } else {
  524. curArg = conversions["DOMString"](curArg, {
  525. context: "Failed to execute 'createAttributeNS' on 'Document': parameter 1",
  526. globals: globalObject
  527. });
  528. }
  529. args.push(curArg);
  530. }
  531. {
  532. let curArg = arguments[1];
  533. curArg = conversions["DOMString"](curArg, {
  534. context: "Failed to execute 'createAttributeNS' on 'Document': parameter 2",
  535. globals: globalObject
  536. });
  537. args.push(curArg);
  538. }
  539. return utils.tryWrapperForImpl(esValue[implSymbol].createAttributeNS(...args));
  540. }
  541. createEvent(interface_) {
  542. const esValue = this !== null && this !== undefined ? this : globalObject;
  543. if (!exports.is(esValue)) {
  544. throw new globalObject.TypeError("'createEvent' called on an object that is not a valid instance of Document.");
  545. }
  546. if (arguments.length < 1) {
  547. throw new globalObject.TypeError(
  548. `Failed to execute 'createEvent' on 'Document': 1 argument required, but only ${arguments.length} present.`
  549. );
  550. }
  551. const args = [];
  552. {
  553. let curArg = arguments[0];
  554. curArg = conversions["DOMString"](curArg, {
  555. context: "Failed to execute 'createEvent' on 'Document': parameter 1",
  556. globals: globalObject
  557. });
  558. args.push(curArg);
  559. }
  560. return utils.tryWrapperForImpl(esValue[implSymbol].createEvent(...args));
  561. }
  562. createRange() {
  563. const esValue = this !== null && this !== undefined ? this : globalObject;
  564. if (!exports.is(esValue)) {
  565. throw new globalObject.TypeError("'createRange' called on an object that is not a valid instance of Document.");
  566. }
  567. return utils.tryWrapperForImpl(esValue[implSymbol].createRange());
  568. }
  569. createNodeIterator(root) {
  570. const esValue = this !== null && this !== undefined ? this : globalObject;
  571. if (!exports.is(esValue)) {
  572. throw new globalObject.TypeError(
  573. "'createNodeIterator' called on an object that is not a valid instance of Document."
  574. );
  575. }
  576. if (arguments.length < 1) {
  577. throw new globalObject.TypeError(
  578. `Failed to execute 'createNodeIterator' on 'Document': 1 argument required, but only ${arguments.length} present.`
  579. );
  580. }
  581. const args = [];
  582. {
  583. let curArg = arguments[0];
  584. curArg = Node.convert(globalObject, curArg, {
  585. context: "Failed to execute 'createNodeIterator' on 'Document': parameter 1"
  586. });
  587. args.push(curArg);
  588. }
  589. {
  590. let curArg = arguments[1];
  591. if (curArg !== undefined) {
  592. curArg = conversions["unsigned long"](curArg, {
  593. context: "Failed to execute 'createNodeIterator' on 'Document': parameter 2",
  594. globals: globalObject
  595. });
  596. } else {
  597. curArg = 0xffffffff;
  598. }
  599. args.push(curArg);
  600. }
  601. {
  602. let curArg = arguments[2];
  603. if (curArg !== undefined) {
  604. if (curArg === null || curArg === undefined) {
  605. curArg = null;
  606. } else {
  607. curArg = NodeFilter.convert(globalObject, curArg, {
  608. context: "Failed to execute 'createNodeIterator' on 'Document': parameter 3"
  609. });
  610. }
  611. } else {
  612. curArg = null;
  613. }
  614. args.push(curArg);
  615. }
  616. return utils.tryWrapperForImpl(esValue[implSymbol].createNodeIterator(...args));
  617. }
  618. createTreeWalker(root) {
  619. const esValue = this !== null && this !== undefined ? this : globalObject;
  620. if (!exports.is(esValue)) {
  621. throw new globalObject.TypeError(
  622. "'createTreeWalker' called on an object that is not a valid instance of Document."
  623. );
  624. }
  625. if (arguments.length < 1) {
  626. throw new globalObject.TypeError(
  627. `Failed to execute 'createTreeWalker' on 'Document': 1 argument required, but only ${arguments.length} present.`
  628. );
  629. }
  630. const args = [];
  631. {
  632. let curArg = arguments[0];
  633. curArg = Node.convert(globalObject, curArg, {
  634. context: "Failed to execute 'createTreeWalker' on 'Document': parameter 1"
  635. });
  636. args.push(curArg);
  637. }
  638. {
  639. let curArg = arguments[1];
  640. if (curArg !== undefined) {
  641. curArg = conversions["unsigned long"](curArg, {
  642. context: "Failed to execute 'createTreeWalker' on 'Document': parameter 2",
  643. globals: globalObject
  644. });
  645. } else {
  646. curArg = 0xffffffff;
  647. }
  648. args.push(curArg);
  649. }
  650. {
  651. let curArg = arguments[2];
  652. if (curArg !== undefined) {
  653. if (curArg === null || curArg === undefined) {
  654. curArg = null;
  655. } else {
  656. curArg = NodeFilter.convert(globalObject, curArg, {
  657. context: "Failed to execute 'createTreeWalker' on 'Document': parameter 3"
  658. });
  659. }
  660. } else {
  661. curArg = null;
  662. }
  663. args.push(curArg);
  664. }
  665. return utils.tryWrapperForImpl(esValue[implSymbol].createTreeWalker(...args));
  666. }
  667. getElementsByName(elementName) {
  668. const esValue = this !== null && this !== undefined ? this : globalObject;
  669. if (!exports.is(esValue)) {
  670. throw new globalObject.TypeError(
  671. "'getElementsByName' called on an object that is not a valid instance of Document."
  672. );
  673. }
  674. if (arguments.length < 1) {
  675. throw new globalObject.TypeError(
  676. `Failed to execute 'getElementsByName' on 'Document': 1 argument required, but only ${arguments.length} present.`
  677. );
  678. }
  679. const args = [];
  680. {
  681. let curArg = arguments[0];
  682. curArg = conversions["DOMString"](curArg, {
  683. context: "Failed to execute 'getElementsByName' on 'Document': parameter 1",
  684. globals: globalObject
  685. });
  686. args.push(curArg);
  687. }
  688. return utils.tryWrapperForImpl(esValue[implSymbol].getElementsByName(...args));
  689. }
  690. open() {
  691. const esValue = this !== null && this !== undefined ? this : globalObject;
  692. if (!exports.is(esValue)) {
  693. throw new globalObject.TypeError("'open' called on an object that is not a valid instance of Document.");
  694. }
  695. const args = [];
  696. {
  697. let curArg = arguments[0];
  698. if (curArg !== undefined) {
  699. curArg = conversions["DOMString"](curArg, {
  700. context: "Failed to execute 'open' on 'Document': parameter 1",
  701. globals: globalObject
  702. });
  703. } else {
  704. curArg = "text/html";
  705. }
  706. args.push(curArg);
  707. }
  708. {
  709. let curArg = arguments[1];
  710. if (curArg !== undefined) {
  711. curArg = conversions["DOMString"](curArg, {
  712. context: "Failed to execute 'open' on 'Document': parameter 2",
  713. globals: globalObject
  714. });
  715. } else {
  716. curArg = "";
  717. }
  718. args.push(curArg);
  719. }
  720. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  721. try {
  722. return utils.tryWrapperForImpl(esValue[implSymbol].open(...args));
  723. } finally {
  724. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  725. }
  726. }
  727. close() {
  728. const esValue = this !== null && this !== undefined ? this : globalObject;
  729. if (!exports.is(esValue)) {
  730. throw new globalObject.TypeError("'close' called on an object that is not a valid instance of Document.");
  731. }
  732. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  733. try {
  734. return esValue[implSymbol].close();
  735. } finally {
  736. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  737. }
  738. }
  739. write() {
  740. const esValue = this !== null && this !== undefined ? this : globalObject;
  741. if (!exports.is(esValue)) {
  742. throw new globalObject.TypeError("'write' called on an object that is not a valid instance of Document.");
  743. }
  744. const args = [];
  745. for (let i = 0; i < arguments.length; i++) {
  746. let curArg = arguments[i];
  747. curArg = conversions["DOMString"](curArg, {
  748. context: "Failed to execute 'write' on 'Document': parameter " + (i + 1),
  749. globals: globalObject
  750. });
  751. args.push(curArg);
  752. }
  753. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  754. try {
  755. return esValue[implSymbol].write(...args);
  756. } finally {
  757. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  758. }
  759. }
  760. writeln() {
  761. const esValue = this !== null && this !== undefined ? this : globalObject;
  762. if (!exports.is(esValue)) {
  763. throw new globalObject.TypeError("'writeln' called on an object that is not a valid instance of Document.");
  764. }
  765. const args = [];
  766. for (let i = 0; i < arguments.length; i++) {
  767. let curArg = arguments[i];
  768. curArg = conversions["DOMString"](curArg, {
  769. context: "Failed to execute 'writeln' on 'Document': parameter " + (i + 1),
  770. globals: globalObject
  771. });
  772. args.push(curArg);
  773. }
  774. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  775. try {
  776. return esValue[implSymbol].writeln(...args);
  777. } finally {
  778. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  779. }
  780. }
  781. hasFocus() {
  782. const esValue = this !== null && this !== undefined ? this : globalObject;
  783. if (!exports.is(esValue)) {
  784. throw new globalObject.TypeError("'hasFocus' called on an object that is not a valid instance of Document.");
  785. }
  786. return esValue[implSymbol].hasFocus();
  787. }
  788. clear() {
  789. const esValue = this !== null && this !== undefined ? this : globalObject;
  790. if (!exports.is(esValue)) {
  791. throw new globalObject.TypeError("'clear' called on an object that is not a valid instance of Document.");
  792. }
  793. return esValue[implSymbol].clear();
  794. }
  795. captureEvents() {
  796. const esValue = this !== null && this !== undefined ? this : globalObject;
  797. if (!exports.is(esValue)) {
  798. throw new globalObject.TypeError(
  799. "'captureEvents' called on an object that is not a valid instance of Document."
  800. );
  801. }
  802. return esValue[implSymbol].captureEvents();
  803. }
  804. releaseEvents() {
  805. const esValue = this !== null && this !== undefined ? this : globalObject;
  806. if (!exports.is(esValue)) {
  807. throw new globalObject.TypeError(
  808. "'releaseEvents' called on an object that is not a valid instance of Document."
  809. );
  810. }
  811. return esValue[implSymbol].releaseEvents();
  812. }
  813. getSelection() {
  814. const esValue = this !== null && this !== undefined ? this : globalObject;
  815. if (!exports.is(esValue)) {
  816. throw new globalObject.TypeError(
  817. "'getSelection' called on an object that is not a valid instance of Document."
  818. );
  819. }
  820. return utils.tryWrapperForImpl(esValue[implSymbol].getSelection());
  821. }
  822. getElementById(elementId) {
  823. const esValue = this !== null && this !== undefined ? this : globalObject;
  824. if (!exports.is(esValue)) {
  825. throw new globalObject.TypeError(
  826. "'getElementById' called on an object that is not a valid instance of Document."
  827. );
  828. }
  829. if (arguments.length < 1) {
  830. throw new globalObject.TypeError(
  831. `Failed to execute 'getElementById' on 'Document': 1 argument required, but only ${arguments.length} present.`
  832. );
  833. }
  834. const args = [];
  835. {
  836. let curArg = arguments[0];
  837. curArg = conversions["DOMString"](curArg, {
  838. context: "Failed to execute 'getElementById' on 'Document': parameter 1",
  839. globals: globalObject
  840. });
  841. args.push(curArg);
  842. }
  843. return utils.tryWrapperForImpl(esValue[implSymbol].getElementById(...args));
  844. }
  845. prepend() {
  846. const esValue = this !== null && this !== undefined ? this : globalObject;
  847. if (!exports.is(esValue)) {
  848. throw new globalObject.TypeError("'prepend' called on an object that is not a valid instance of Document.");
  849. }
  850. const args = [];
  851. for (let i = 0; i < arguments.length; i++) {
  852. let curArg = arguments[i];
  853. if (Node.is(curArg)) {
  854. curArg = utils.implForWrapper(curArg);
  855. } else {
  856. curArg = conversions["DOMString"](curArg, {
  857. context: "Failed to execute 'prepend' on 'Document': parameter " + (i + 1),
  858. globals: globalObject
  859. });
  860. }
  861. args.push(curArg);
  862. }
  863. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  864. try {
  865. return esValue[implSymbol].prepend(...args);
  866. } finally {
  867. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  868. }
  869. }
  870. append() {
  871. const esValue = this !== null && this !== undefined ? this : globalObject;
  872. if (!exports.is(esValue)) {
  873. throw new globalObject.TypeError("'append' called on an object that is not a valid instance of Document.");
  874. }
  875. const args = [];
  876. for (let i = 0; i < arguments.length; i++) {
  877. let curArg = arguments[i];
  878. if (Node.is(curArg)) {
  879. curArg = utils.implForWrapper(curArg);
  880. } else {
  881. curArg = conversions["DOMString"](curArg, {
  882. context: "Failed to execute 'append' on 'Document': parameter " + (i + 1),
  883. globals: globalObject
  884. });
  885. }
  886. args.push(curArg);
  887. }
  888. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  889. try {
  890. return esValue[implSymbol].append(...args);
  891. } finally {
  892. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  893. }
  894. }
  895. replaceChildren() {
  896. const esValue = this !== null && this !== undefined ? this : globalObject;
  897. if (!exports.is(esValue)) {
  898. throw new globalObject.TypeError(
  899. "'replaceChildren' called on an object that is not a valid instance of Document."
  900. );
  901. }
  902. const args = [];
  903. for (let i = 0; i < arguments.length; i++) {
  904. let curArg = arguments[i];
  905. if (Node.is(curArg)) {
  906. curArg = utils.implForWrapper(curArg);
  907. } else {
  908. curArg = conversions["DOMString"](curArg, {
  909. context: "Failed to execute 'replaceChildren' on 'Document': parameter " + (i + 1),
  910. globals: globalObject
  911. });
  912. }
  913. args.push(curArg);
  914. }
  915. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  916. try {
  917. return esValue[implSymbol].replaceChildren(...args);
  918. } finally {
  919. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  920. }
  921. }
  922. querySelector(selectors) {
  923. const esValue = this !== null && this !== undefined ? this : globalObject;
  924. if (!exports.is(esValue)) {
  925. throw new globalObject.TypeError(
  926. "'querySelector' called on an object that is not a valid instance of Document."
  927. );
  928. }
  929. if (arguments.length < 1) {
  930. throw new globalObject.TypeError(
  931. `Failed to execute 'querySelector' on 'Document': 1 argument required, but only ${arguments.length} present.`
  932. );
  933. }
  934. const args = [];
  935. {
  936. let curArg = arguments[0];
  937. curArg = conversions["DOMString"](curArg, {
  938. context: "Failed to execute 'querySelector' on 'Document': parameter 1",
  939. globals: globalObject
  940. });
  941. args.push(curArg);
  942. }
  943. return utils.tryWrapperForImpl(esValue[implSymbol].querySelector(...args));
  944. }
  945. querySelectorAll(selectors) {
  946. const esValue = this !== null && this !== undefined ? this : globalObject;
  947. if (!exports.is(esValue)) {
  948. throw new globalObject.TypeError(
  949. "'querySelectorAll' called on an object that is not a valid instance of Document."
  950. );
  951. }
  952. if (arguments.length < 1) {
  953. throw new globalObject.TypeError(
  954. `Failed to execute 'querySelectorAll' on 'Document': 1 argument required, but only ${arguments.length} present.`
  955. );
  956. }
  957. const args = [];
  958. {
  959. let curArg = arguments[0];
  960. curArg = conversions["DOMString"](curArg, {
  961. context: "Failed to execute 'querySelectorAll' on 'Document': parameter 1",
  962. globals: globalObject
  963. });
  964. args.push(curArg);
  965. }
  966. return utils.tryWrapperForImpl(esValue[implSymbol].querySelectorAll(...args));
  967. }
  968. get implementation() {
  969. const esValue = this !== null && this !== undefined ? this : globalObject;
  970. if (!exports.is(esValue)) {
  971. throw new globalObject.TypeError(
  972. "'get implementation' called on an object that is not a valid instance of Document."
  973. );
  974. }
  975. return utils.getSameObject(this, "implementation", () => {
  976. return utils.tryWrapperForImpl(esValue[implSymbol]["implementation"]);
  977. });
  978. }
  979. get URL() {
  980. const esValue = this !== null && this !== undefined ? this : globalObject;
  981. if (!exports.is(esValue)) {
  982. throw new globalObject.TypeError("'get URL' called on an object that is not a valid instance of Document.");
  983. }
  984. return esValue[implSymbol]["URL"];
  985. }
  986. get documentURI() {
  987. const esValue = this !== null && this !== undefined ? this : globalObject;
  988. if (!exports.is(esValue)) {
  989. throw new globalObject.TypeError(
  990. "'get documentURI' called on an object that is not a valid instance of Document."
  991. );
  992. }
  993. return esValue[implSymbol]["documentURI"];
  994. }
  995. get compatMode() {
  996. const esValue = this !== null && this !== undefined ? this : globalObject;
  997. if (!exports.is(esValue)) {
  998. throw new globalObject.TypeError(
  999. "'get compatMode' called on an object that is not a valid instance of Document."
  1000. );
  1001. }
  1002. return esValue[implSymbol]["compatMode"];
  1003. }
  1004. get characterSet() {
  1005. const esValue = this !== null && this !== undefined ? this : globalObject;
  1006. if (!exports.is(esValue)) {
  1007. throw new globalObject.TypeError(
  1008. "'get characterSet' called on an object that is not a valid instance of Document."
  1009. );
  1010. }
  1011. return esValue[implSymbol]["characterSet"];
  1012. }
  1013. get charset() {
  1014. const esValue = this !== null && this !== undefined ? this : globalObject;
  1015. if (!exports.is(esValue)) {
  1016. throw new globalObject.TypeError("'get charset' called on an object that is not a valid instance of Document.");
  1017. }
  1018. return esValue[implSymbol]["charset"];
  1019. }
  1020. get inputEncoding() {
  1021. const esValue = this !== null && this !== undefined ? this : globalObject;
  1022. if (!exports.is(esValue)) {
  1023. throw new globalObject.TypeError(
  1024. "'get inputEncoding' called on an object that is not a valid instance of Document."
  1025. );
  1026. }
  1027. return esValue[implSymbol]["inputEncoding"];
  1028. }
  1029. get contentType() {
  1030. const esValue = this !== null && this !== undefined ? this : globalObject;
  1031. if (!exports.is(esValue)) {
  1032. throw new globalObject.TypeError(
  1033. "'get contentType' called on an object that is not a valid instance of Document."
  1034. );
  1035. }
  1036. return esValue[implSymbol]["contentType"];
  1037. }
  1038. get doctype() {
  1039. const esValue = this !== null && this !== undefined ? this : globalObject;
  1040. if (!exports.is(esValue)) {
  1041. throw new globalObject.TypeError("'get doctype' called on an object that is not a valid instance of Document.");
  1042. }
  1043. return utils.tryWrapperForImpl(esValue[implSymbol]["doctype"]);
  1044. }
  1045. get documentElement() {
  1046. const esValue = this !== null && this !== undefined ? this : globalObject;
  1047. if (!exports.is(esValue)) {
  1048. throw new globalObject.TypeError(
  1049. "'get documentElement' called on an object that is not a valid instance of Document."
  1050. );
  1051. }
  1052. return utils.tryWrapperForImpl(esValue[implSymbol]["documentElement"]);
  1053. }
  1054. get referrer() {
  1055. const esValue = this !== null && this !== undefined ? this : globalObject;
  1056. if (!exports.is(esValue)) {
  1057. throw new globalObject.TypeError(
  1058. "'get referrer' called on an object that is not a valid instance of Document."
  1059. );
  1060. }
  1061. return esValue[implSymbol]["referrer"];
  1062. }
  1063. get cookie() {
  1064. const esValue = this !== null && this !== undefined ? this : globalObject;
  1065. if (!exports.is(esValue)) {
  1066. throw new globalObject.TypeError("'get cookie' called on an object that is not a valid instance of Document.");
  1067. }
  1068. return esValue[implSymbol]["cookie"];
  1069. }
  1070. set cookie(V) {
  1071. const esValue = this !== null && this !== undefined ? this : globalObject;
  1072. if (!exports.is(esValue)) {
  1073. throw new globalObject.TypeError("'set cookie' called on an object that is not a valid instance of Document.");
  1074. }
  1075. V = conversions["USVString"](V, {
  1076. context: "Failed to set the 'cookie' property on 'Document': The provided value",
  1077. globals: globalObject
  1078. });
  1079. esValue[implSymbol]["cookie"] = V;
  1080. }
  1081. get lastModified() {
  1082. const esValue = this !== null && this !== undefined ? this : globalObject;
  1083. if (!exports.is(esValue)) {
  1084. throw new globalObject.TypeError(
  1085. "'get lastModified' called on an object that is not a valid instance of Document."
  1086. );
  1087. }
  1088. return esValue[implSymbol]["lastModified"];
  1089. }
  1090. get readyState() {
  1091. const esValue = this !== null && this !== undefined ? this : globalObject;
  1092. if (!exports.is(esValue)) {
  1093. throw new globalObject.TypeError(
  1094. "'get readyState' called on an object that is not a valid instance of Document."
  1095. );
  1096. }
  1097. return utils.tryWrapperForImpl(esValue[implSymbol]["readyState"]);
  1098. }
  1099. get title() {
  1100. const esValue = this !== null && this !== undefined ? this : globalObject;
  1101. if (!exports.is(esValue)) {
  1102. throw new globalObject.TypeError("'get title' called on an object that is not a valid instance of Document.");
  1103. }
  1104. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  1105. try {
  1106. return esValue[implSymbol]["title"];
  1107. } finally {
  1108. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  1109. }
  1110. }
  1111. set title(V) {
  1112. const esValue = this !== null && this !== undefined ? this : globalObject;
  1113. if (!exports.is(esValue)) {
  1114. throw new globalObject.TypeError("'set title' called on an object that is not a valid instance of Document.");
  1115. }
  1116. V = conversions["DOMString"](V, {
  1117. context: "Failed to set the 'title' property on 'Document': The provided value",
  1118. globals: globalObject
  1119. });
  1120. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  1121. try {
  1122. esValue[implSymbol]["title"] = V;
  1123. } finally {
  1124. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  1125. }
  1126. }
  1127. get dir() {
  1128. const esValue = this !== null && this !== undefined ? this : globalObject;
  1129. if (!exports.is(esValue)) {
  1130. throw new globalObject.TypeError("'get dir' called on an object that is not a valid instance of Document.");
  1131. }
  1132. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  1133. try {
  1134. return esValue[implSymbol]["dir"];
  1135. } finally {
  1136. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  1137. }
  1138. }
  1139. set dir(V) {
  1140. const esValue = this !== null && this !== undefined ? this : globalObject;
  1141. if (!exports.is(esValue)) {
  1142. throw new globalObject.TypeError("'set dir' called on an object that is not a valid instance of Document.");
  1143. }
  1144. V = conversions["DOMString"](V, {
  1145. context: "Failed to set the 'dir' property on 'Document': The provided value",
  1146. globals: globalObject
  1147. });
  1148. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  1149. try {
  1150. esValue[implSymbol]["dir"] = V;
  1151. } finally {
  1152. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  1153. }
  1154. }
  1155. get body() {
  1156. const esValue = this !== null && this !== undefined ? this : globalObject;
  1157. if (!exports.is(esValue)) {
  1158. throw new globalObject.TypeError("'get body' called on an object that is not a valid instance of Document.");
  1159. }
  1160. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  1161. try {
  1162. return utils.tryWrapperForImpl(esValue[implSymbol]["body"]);
  1163. } finally {
  1164. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  1165. }
  1166. }
  1167. set body(V) {
  1168. const esValue = this !== null && this !== undefined ? this : globalObject;
  1169. if (!exports.is(esValue)) {
  1170. throw new globalObject.TypeError("'set body' called on an object that is not a valid instance of Document.");
  1171. }
  1172. if (V === null || V === undefined) {
  1173. V = null;
  1174. } else {
  1175. V = HTMLElement.convert(globalObject, V, {
  1176. context: "Failed to set the 'body' property on 'Document': The provided value"
  1177. });
  1178. }
  1179. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  1180. try {
  1181. esValue[implSymbol]["body"] = V;
  1182. } finally {
  1183. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  1184. }
  1185. }
  1186. get head() {
  1187. const esValue = this !== null && this !== undefined ? this : globalObject;
  1188. if (!exports.is(esValue)) {
  1189. throw new globalObject.TypeError("'get head' called on an object that is not a valid instance of Document.");
  1190. }
  1191. return utils.tryWrapperForImpl(esValue[implSymbol]["head"]);
  1192. }
  1193. get images() {
  1194. const esValue = this !== null && this !== undefined ? this : globalObject;
  1195. if (!exports.is(esValue)) {
  1196. throw new globalObject.TypeError("'get images' called on an object that is not a valid instance of Document.");
  1197. }
  1198. return utils.getSameObject(this, "images", () => {
  1199. return utils.tryWrapperForImpl(esValue[implSymbol]["images"]);
  1200. });
  1201. }
  1202. get embeds() {
  1203. const esValue = this !== null && this !== undefined ? this : globalObject;
  1204. if (!exports.is(esValue)) {
  1205. throw new globalObject.TypeError("'get embeds' called on an object that is not a valid instance of Document.");
  1206. }
  1207. return utils.getSameObject(this, "embeds", () => {
  1208. return utils.tryWrapperForImpl(esValue[implSymbol]["embeds"]);
  1209. });
  1210. }
  1211. get plugins() {
  1212. const esValue = this !== null && this !== undefined ? this : globalObject;
  1213. if (!exports.is(esValue)) {
  1214. throw new globalObject.TypeError("'get plugins' called on an object that is not a valid instance of Document.");
  1215. }
  1216. return utils.getSameObject(this, "plugins", () => {
  1217. return utils.tryWrapperForImpl(esValue[implSymbol]["plugins"]);
  1218. });
  1219. }
  1220. get links() {
  1221. const esValue = this !== null && this !== undefined ? this : globalObject;
  1222. if (!exports.is(esValue)) {
  1223. throw new globalObject.TypeError("'get links' called on an object that is not a valid instance of Document.");
  1224. }
  1225. return utils.getSameObject(this, "links", () => {
  1226. return utils.tryWrapperForImpl(esValue[implSymbol]["links"]);
  1227. });
  1228. }
  1229. get forms() {
  1230. const esValue = this !== null && this !== undefined ? this : globalObject;
  1231. if (!exports.is(esValue)) {
  1232. throw new globalObject.TypeError("'get forms' called on an object that is not a valid instance of Document.");
  1233. }
  1234. return utils.getSameObject(this, "forms", () => {
  1235. return utils.tryWrapperForImpl(esValue[implSymbol]["forms"]);
  1236. });
  1237. }
  1238. get scripts() {
  1239. const esValue = this !== null && this !== undefined ? this : globalObject;
  1240. if (!exports.is(esValue)) {
  1241. throw new globalObject.TypeError("'get scripts' called on an object that is not a valid instance of Document.");
  1242. }
  1243. return utils.getSameObject(this, "scripts", () => {
  1244. return utils.tryWrapperForImpl(esValue[implSymbol]["scripts"]);
  1245. });
  1246. }
  1247. get currentScript() {
  1248. const esValue = this !== null && this !== undefined ? this : globalObject;
  1249. if (!exports.is(esValue)) {
  1250. throw new globalObject.TypeError(
  1251. "'get currentScript' called on an object that is not a valid instance of Document."
  1252. );
  1253. }
  1254. return utils.tryWrapperForImpl(esValue[implSymbol]["currentScript"]);
  1255. }
  1256. get defaultView() {
  1257. const esValue = this !== null && this !== undefined ? this : globalObject;
  1258. if (!exports.is(esValue)) {
  1259. throw new globalObject.TypeError(
  1260. "'get defaultView' called on an object that is not a valid instance of Document."
  1261. );
  1262. }
  1263. return utils.tryWrapperForImpl(esValue[implSymbol]["defaultView"]);
  1264. }
  1265. get onreadystatechange() {
  1266. const esValue = this !== null && this !== undefined ? this : globalObject;
  1267. if (!exports.is(esValue)) {
  1268. return;
  1269. }
  1270. return utils.tryWrapperForImpl(esValue[implSymbol]["onreadystatechange"]);
  1271. }
  1272. set onreadystatechange(V) {
  1273. const esValue = this !== null && this !== undefined ? this : globalObject;
  1274. if (!exports.is(esValue)) {
  1275. return;
  1276. }
  1277. if (!utils.isObject(V)) {
  1278. V = null;
  1279. } else {
  1280. V = EventHandlerNonNull.convert(globalObject, V, {
  1281. context: "Failed to set the 'onreadystatechange' property on 'Document': The provided value"
  1282. });
  1283. }
  1284. esValue[implSymbol]["onreadystatechange"] = V;
  1285. }
  1286. get anchors() {
  1287. const esValue = this !== null && this !== undefined ? this : globalObject;
  1288. if (!exports.is(esValue)) {
  1289. throw new globalObject.TypeError("'get anchors' called on an object that is not a valid instance of Document.");
  1290. }
  1291. return utils.getSameObject(this, "anchors", () => {
  1292. return utils.tryWrapperForImpl(esValue[implSymbol]["anchors"]);
  1293. });
  1294. }
  1295. get applets() {
  1296. const esValue = this !== null && this !== undefined ? this : globalObject;
  1297. if (!exports.is(esValue)) {
  1298. throw new globalObject.TypeError("'get applets' called on an object that is not a valid instance of Document.");
  1299. }
  1300. return utils.getSameObject(this, "applets", () => {
  1301. return utils.tryWrapperForImpl(esValue[implSymbol]["applets"]);
  1302. });
  1303. }
  1304. get styleSheets() {
  1305. const esValue = this !== null && this !== undefined ? this : globalObject;
  1306. if (!exports.is(esValue)) {
  1307. throw new globalObject.TypeError(
  1308. "'get styleSheets' called on an object that is not a valid instance of Document."
  1309. );
  1310. }
  1311. return utils.getSameObject(this, "styleSheets", () => {
  1312. return utils.tryWrapperForImpl(esValue[implSymbol]["styleSheets"]);
  1313. });
  1314. }
  1315. get hidden() {
  1316. const esValue = this !== null && this !== undefined ? this : globalObject;
  1317. if (!exports.is(esValue)) {
  1318. throw new globalObject.TypeError("'get hidden' called on an object that is not a valid instance of Document.");
  1319. }
  1320. return esValue[implSymbol]["hidden"];
  1321. }
  1322. get visibilityState() {
  1323. const esValue = this !== null && this !== undefined ? this : globalObject;
  1324. if (!exports.is(esValue)) {
  1325. throw new globalObject.TypeError(
  1326. "'get visibilityState' called on an object that is not a valid instance of Document."
  1327. );
  1328. }
  1329. return utils.tryWrapperForImpl(esValue[implSymbol]["visibilityState"]);
  1330. }
  1331. get onvisibilitychange() {
  1332. const esValue = this !== null && this !== undefined ? this : globalObject;
  1333. if (!exports.is(esValue)) {
  1334. throw new globalObject.TypeError(
  1335. "'get onvisibilitychange' called on an object that is not a valid instance of Document."
  1336. );
  1337. }
  1338. return utils.tryWrapperForImpl(esValue[implSymbol]["onvisibilitychange"]);
  1339. }
  1340. set onvisibilitychange(V) {
  1341. const esValue = this !== null && this !== undefined ? this : globalObject;
  1342. if (!exports.is(esValue)) {
  1343. throw new globalObject.TypeError(
  1344. "'set onvisibilitychange' called on an object that is not a valid instance of Document."
  1345. );
  1346. }
  1347. if (!utils.isObject(V)) {
  1348. V = null;
  1349. } else {
  1350. V = EventHandlerNonNull.convert(globalObject, V, {
  1351. context: "Failed to set the 'onvisibilitychange' property on 'Document': The provided value"
  1352. });
  1353. }
  1354. esValue[implSymbol]["onvisibilitychange"] = V;
  1355. }
  1356. get onabort() {
  1357. const esValue = this !== null && this !== undefined ? this : globalObject;
  1358. if (!exports.is(esValue)) {
  1359. throw new globalObject.TypeError("'get onabort' called on an object that is not a valid instance of Document.");
  1360. }
  1361. return utils.tryWrapperForImpl(esValue[implSymbol]["onabort"]);
  1362. }
  1363. set onabort(V) {
  1364. const esValue = this !== null && this !== undefined ? this : globalObject;
  1365. if (!exports.is(esValue)) {
  1366. throw new globalObject.TypeError("'set onabort' called on an object that is not a valid instance of Document.");
  1367. }
  1368. if (!utils.isObject(V)) {
  1369. V = null;
  1370. } else {
  1371. V = EventHandlerNonNull.convert(globalObject, V, {
  1372. context: "Failed to set the 'onabort' property on 'Document': The provided value"
  1373. });
  1374. }
  1375. esValue[implSymbol]["onabort"] = V;
  1376. }
  1377. get onauxclick() {
  1378. const esValue = this !== null && this !== undefined ? this : globalObject;
  1379. if (!exports.is(esValue)) {
  1380. throw new globalObject.TypeError(
  1381. "'get onauxclick' called on an object that is not a valid instance of Document."
  1382. );
  1383. }
  1384. return utils.tryWrapperForImpl(esValue[implSymbol]["onauxclick"]);
  1385. }
  1386. set onauxclick(V) {
  1387. const esValue = this !== null && this !== undefined ? this : globalObject;
  1388. if (!exports.is(esValue)) {
  1389. throw new globalObject.TypeError(
  1390. "'set onauxclick' called on an object that is not a valid instance of Document."
  1391. );
  1392. }
  1393. if (!utils.isObject(V)) {
  1394. V = null;
  1395. } else {
  1396. V = EventHandlerNonNull.convert(globalObject, V, {
  1397. context: "Failed to set the 'onauxclick' property on 'Document': The provided value"
  1398. });
  1399. }
  1400. esValue[implSymbol]["onauxclick"] = V;
  1401. }
  1402. get onbeforeinput() {
  1403. const esValue = this !== null && this !== undefined ? this : globalObject;
  1404. if (!exports.is(esValue)) {
  1405. throw new globalObject.TypeError(
  1406. "'get onbeforeinput' called on an object that is not a valid instance of Document."
  1407. );
  1408. }
  1409. return utils.tryWrapperForImpl(esValue[implSymbol]["onbeforeinput"]);
  1410. }
  1411. set onbeforeinput(V) {
  1412. const esValue = this !== null && this !== undefined ? this : globalObject;
  1413. if (!exports.is(esValue)) {
  1414. throw new globalObject.TypeError(
  1415. "'set onbeforeinput' called on an object that is not a valid instance of Document."
  1416. );
  1417. }
  1418. if (!utils.isObject(V)) {
  1419. V = null;
  1420. } else {
  1421. V = EventHandlerNonNull.convert(globalObject, V, {
  1422. context: "Failed to set the 'onbeforeinput' property on 'Document': The provided value"
  1423. });
  1424. }
  1425. esValue[implSymbol]["onbeforeinput"] = V;
  1426. }
  1427. get onbeforematch() {
  1428. const esValue = this !== null && this !== undefined ? this : globalObject;
  1429. if (!exports.is(esValue)) {
  1430. throw new globalObject.TypeError(
  1431. "'get onbeforematch' called on an object that is not a valid instance of Document."
  1432. );
  1433. }
  1434. return utils.tryWrapperForImpl(esValue[implSymbol]["onbeforematch"]);
  1435. }
  1436. set onbeforematch(V) {
  1437. const esValue = this !== null && this !== undefined ? this : globalObject;
  1438. if (!exports.is(esValue)) {
  1439. throw new globalObject.TypeError(
  1440. "'set onbeforematch' called on an object that is not a valid instance of Document."
  1441. );
  1442. }
  1443. if (!utils.isObject(V)) {
  1444. V = null;
  1445. } else {
  1446. V = EventHandlerNonNull.convert(globalObject, V, {
  1447. context: "Failed to set the 'onbeforematch' property on 'Document': The provided value"
  1448. });
  1449. }
  1450. esValue[implSymbol]["onbeforematch"] = V;
  1451. }
  1452. get onbeforetoggle() {
  1453. const esValue = this !== null && this !== undefined ? this : globalObject;
  1454. if (!exports.is(esValue)) {
  1455. throw new globalObject.TypeError(
  1456. "'get onbeforetoggle' called on an object that is not a valid instance of Document."
  1457. );
  1458. }
  1459. return utils.tryWrapperForImpl(esValue[implSymbol]["onbeforetoggle"]);
  1460. }
  1461. set onbeforetoggle(V) {
  1462. const esValue = this !== null && this !== undefined ? this : globalObject;
  1463. if (!exports.is(esValue)) {
  1464. throw new globalObject.TypeError(
  1465. "'set onbeforetoggle' called on an object that is not a valid instance of Document."
  1466. );
  1467. }
  1468. if (!utils.isObject(V)) {
  1469. V = null;
  1470. } else {
  1471. V = EventHandlerNonNull.convert(globalObject, V, {
  1472. context: "Failed to set the 'onbeforetoggle' property on 'Document': The provided value"
  1473. });
  1474. }
  1475. esValue[implSymbol]["onbeforetoggle"] = V;
  1476. }
  1477. get onblur() {
  1478. const esValue = this !== null && this !== undefined ? this : globalObject;
  1479. if (!exports.is(esValue)) {
  1480. throw new globalObject.TypeError("'get onblur' called on an object that is not a valid instance of Document.");
  1481. }
  1482. return utils.tryWrapperForImpl(esValue[implSymbol]["onblur"]);
  1483. }
  1484. set onblur(V) {
  1485. const esValue = this !== null && this !== undefined ? this : globalObject;
  1486. if (!exports.is(esValue)) {
  1487. throw new globalObject.TypeError("'set onblur' called on an object that is not a valid instance of Document.");
  1488. }
  1489. if (!utils.isObject(V)) {
  1490. V = null;
  1491. } else {
  1492. V = EventHandlerNonNull.convert(globalObject, V, {
  1493. context: "Failed to set the 'onblur' property on 'Document': The provided value"
  1494. });
  1495. }
  1496. esValue[implSymbol]["onblur"] = V;
  1497. }
  1498. get oncancel() {
  1499. const esValue = this !== null && this !== undefined ? this : globalObject;
  1500. if (!exports.is(esValue)) {
  1501. throw new globalObject.TypeError(
  1502. "'get oncancel' called on an object that is not a valid instance of Document."
  1503. );
  1504. }
  1505. return utils.tryWrapperForImpl(esValue[implSymbol]["oncancel"]);
  1506. }
  1507. set oncancel(V) {
  1508. const esValue = this !== null && this !== undefined ? this : globalObject;
  1509. if (!exports.is(esValue)) {
  1510. throw new globalObject.TypeError(
  1511. "'set oncancel' called on an object that is not a valid instance of Document."
  1512. );
  1513. }
  1514. if (!utils.isObject(V)) {
  1515. V = null;
  1516. } else {
  1517. V = EventHandlerNonNull.convert(globalObject, V, {
  1518. context: "Failed to set the 'oncancel' property on 'Document': The provided value"
  1519. });
  1520. }
  1521. esValue[implSymbol]["oncancel"] = V;
  1522. }
  1523. get oncanplay() {
  1524. const esValue = this !== null && this !== undefined ? this : globalObject;
  1525. if (!exports.is(esValue)) {
  1526. throw new globalObject.TypeError(
  1527. "'get oncanplay' called on an object that is not a valid instance of Document."
  1528. );
  1529. }
  1530. return utils.tryWrapperForImpl(esValue[implSymbol]["oncanplay"]);
  1531. }
  1532. set oncanplay(V) {
  1533. const esValue = this !== null && this !== undefined ? this : globalObject;
  1534. if (!exports.is(esValue)) {
  1535. throw new globalObject.TypeError(
  1536. "'set oncanplay' called on an object that is not a valid instance of Document."
  1537. );
  1538. }
  1539. if (!utils.isObject(V)) {
  1540. V = null;
  1541. } else {
  1542. V = EventHandlerNonNull.convert(globalObject, V, {
  1543. context: "Failed to set the 'oncanplay' property on 'Document': The provided value"
  1544. });
  1545. }
  1546. esValue[implSymbol]["oncanplay"] = V;
  1547. }
  1548. get oncanplaythrough() {
  1549. const esValue = this !== null && this !== undefined ? this : globalObject;
  1550. if (!exports.is(esValue)) {
  1551. throw new globalObject.TypeError(
  1552. "'get oncanplaythrough' called on an object that is not a valid instance of Document."
  1553. );
  1554. }
  1555. return utils.tryWrapperForImpl(esValue[implSymbol]["oncanplaythrough"]);
  1556. }
  1557. set oncanplaythrough(V) {
  1558. const esValue = this !== null && this !== undefined ? this : globalObject;
  1559. if (!exports.is(esValue)) {
  1560. throw new globalObject.TypeError(
  1561. "'set oncanplaythrough' called on an object that is not a valid instance of Document."
  1562. );
  1563. }
  1564. if (!utils.isObject(V)) {
  1565. V = null;
  1566. } else {
  1567. V = EventHandlerNonNull.convert(globalObject, V, {
  1568. context: "Failed to set the 'oncanplaythrough' property on 'Document': The provided value"
  1569. });
  1570. }
  1571. esValue[implSymbol]["oncanplaythrough"] = V;
  1572. }
  1573. get onchange() {
  1574. const esValue = this !== null && this !== undefined ? this : globalObject;
  1575. if (!exports.is(esValue)) {
  1576. throw new globalObject.TypeError(
  1577. "'get onchange' called on an object that is not a valid instance of Document."
  1578. );
  1579. }
  1580. return utils.tryWrapperForImpl(esValue[implSymbol]["onchange"]);
  1581. }
  1582. set onchange(V) {
  1583. const esValue = this !== null && this !== undefined ? this : globalObject;
  1584. if (!exports.is(esValue)) {
  1585. throw new globalObject.TypeError(
  1586. "'set onchange' called on an object that is not a valid instance of Document."
  1587. );
  1588. }
  1589. if (!utils.isObject(V)) {
  1590. V = null;
  1591. } else {
  1592. V = EventHandlerNonNull.convert(globalObject, V, {
  1593. context: "Failed to set the 'onchange' property on 'Document': The provided value"
  1594. });
  1595. }
  1596. esValue[implSymbol]["onchange"] = V;
  1597. }
  1598. get onclick() {
  1599. const esValue = this !== null && this !== undefined ? this : globalObject;
  1600. if (!exports.is(esValue)) {
  1601. throw new globalObject.TypeError("'get onclick' called on an object that is not a valid instance of Document.");
  1602. }
  1603. return utils.tryWrapperForImpl(esValue[implSymbol]["onclick"]);
  1604. }
  1605. set onclick(V) {
  1606. const esValue = this !== null && this !== undefined ? this : globalObject;
  1607. if (!exports.is(esValue)) {
  1608. throw new globalObject.TypeError("'set onclick' called on an object that is not a valid instance of Document.");
  1609. }
  1610. if (!utils.isObject(V)) {
  1611. V = null;
  1612. } else {
  1613. V = EventHandlerNonNull.convert(globalObject, V, {
  1614. context: "Failed to set the 'onclick' property on 'Document': The provided value"
  1615. });
  1616. }
  1617. esValue[implSymbol]["onclick"] = V;
  1618. }
  1619. get onclose() {
  1620. const esValue = this !== null && this !== undefined ? this : globalObject;
  1621. if (!exports.is(esValue)) {
  1622. throw new globalObject.TypeError("'get onclose' called on an object that is not a valid instance of Document.");
  1623. }
  1624. return utils.tryWrapperForImpl(esValue[implSymbol]["onclose"]);
  1625. }
  1626. set onclose(V) {
  1627. const esValue = this !== null && this !== undefined ? this : globalObject;
  1628. if (!exports.is(esValue)) {
  1629. throw new globalObject.TypeError("'set onclose' called on an object that is not a valid instance of Document.");
  1630. }
  1631. if (!utils.isObject(V)) {
  1632. V = null;
  1633. } else {
  1634. V = EventHandlerNonNull.convert(globalObject, V, {
  1635. context: "Failed to set the 'onclose' property on 'Document': The provided value"
  1636. });
  1637. }
  1638. esValue[implSymbol]["onclose"] = V;
  1639. }
  1640. get oncontextlost() {
  1641. const esValue = this !== null && this !== undefined ? this : globalObject;
  1642. if (!exports.is(esValue)) {
  1643. throw new globalObject.TypeError(
  1644. "'get oncontextlost' called on an object that is not a valid instance of Document."
  1645. );
  1646. }
  1647. return utils.tryWrapperForImpl(esValue[implSymbol]["oncontextlost"]);
  1648. }
  1649. set oncontextlost(V) {
  1650. const esValue = this !== null && this !== undefined ? this : globalObject;
  1651. if (!exports.is(esValue)) {
  1652. throw new globalObject.TypeError(
  1653. "'set oncontextlost' called on an object that is not a valid instance of Document."
  1654. );
  1655. }
  1656. if (!utils.isObject(V)) {
  1657. V = null;
  1658. } else {
  1659. V = EventHandlerNonNull.convert(globalObject, V, {
  1660. context: "Failed to set the 'oncontextlost' property on 'Document': The provided value"
  1661. });
  1662. }
  1663. esValue[implSymbol]["oncontextlost"] = V;
  1664. }
  1665. get oncontextmenu() {
  1666. const esValue = this !== null && this !== undefined ? this : globalObject;
  1667. if (!exports.is(esValue)) {
  1668. throw new globalObject.TypeError(
  1669. "'get oncontextmenu' called on an object that is not a valid instance of Document."
  1670. );
  1671. }
  1672. return utils.tryWrapperForImpl(esValue[implSymbol]["oncontextmenu"]);
  1673. }
  1674. set oncontextmenu(V) {
  1675. const esValue = this !== null && this !== undefined ? this : globalObject;
  1676. if (!exports.is(esValue)) {
  1677. throw new globalObject.TypeError(
  1678. "'set oncontextmenu' called on an object that is not a valid instance of Document."
  1679. );
  1680. }
  1681. if (!utils.isObject(V)) {
  1682. V = null;
  1683. } else {
  1684. V = EventHandlerNonNull.convert(globalObject, V, {
  1685. context: "Failed to set the 'oncontextmenu' property on 'Document': The provided value"
  1686. });
  1687. }
  1688. esValue[implSymbol]["oncontextmenu"] = V;
  1689. }
  1690. get oncontextrestored() {
  1691. const esValue = this !== null && this !== undefined ? this : globalObject;
  1692. if (!exports.is(esValue)) {
  1693. throw new globalObject.TypeError(
  1694. "'get oncontextrestored' called on an object that is not a valid instance of Document."
  1695. );
  1696. }
  1697. return utils.tryWrapperForImpl(esValue[implSymbol]["oncontextrestored"]);
  1698. }
  1699. set oncontextrestored(V) {
  1700. const esValue = this !== null && this !== undefined ? this : globalObject;
  1701. if (!exports.is(esValue)) {
  1702. throw new globalObject.TypeError(
  1703. "'set oncontextrestored' called on an object that is not a valid instance of Document."
  1704. );
  1705. }
  1706. if (!utils.isObject(V)) {
  1707. V = null;
  1708. } else {
  1709. V = EventHandlerNonNull.convert(globalObject, V, {
  1710. context: "Failed to set the 'oncontextrestored' property on 'Document': The provided value"
  1711. });
  1712. }
  1713. esValue[implSymbol]["oncontextrestored"] = V;
  1714. }
  1715. get oncopy() {
  1716. const esValue = this !== null && this !== undefined ? this : globalObject;
  1717. if (!exports.is(esValue)) {
  1718. throw new globalObject.TypeError("'get oncopy' called on an object that is not a valid instance of Document.");
  1719. }
  1720. return utils.tryWrapperForImpl(esValue[implSymbol]["oncopy"]);
  1721. }
  1722. set oncopy(V) {
  1723. const esValue = this !== null && this !== undefined ? this : globalObject;
  1724. if (!exports.is(esValue)) {
  1725. throw new globalObject.TypeError("'set oncopy' called on an object that is not a valid instance of Document.");
  1726. }
  1727. if (!utils.isObject(V)) {
  1728. V = null;
  1729. } else {
  1730. V = EventHandlerNonNull.convert(globalObject, V, {
  1731. context: "Failed to set the 'oncopy' property on 'Document': The provided value"
  1732. });
  1733. }
  1734. esValue[implSymbol]["oncopy"] = V;
  1735. }
  1736. get oncuechange() {
  1737. const esValue = this !== null && this !== undefined ? this : globalObject;
  1738. if (!exports.is(esValue)) {
  1739. throw new globalObject.TypeError(
  1740. "'get oncuechange' called on an object that is not a valid instance of Document."
  1741. );
  1742. }
  1743. return utils.tryWrapperForImpl(esValue[implSymbol]["oncuechange"]);
  1744. }
  1745. set oncuechange(V) {
  1746. const esValue = this !== null && this !== undefined ? this : globalObject;
  1747. if (!exports.is(esValue)) {
  1748. throw new globalObject.TypeError(
  1749. "'set oncuechange' called on an object that is not a valid instance of Document."
  1750. );
  1751. }
  1752. if (!utils.isObject(V)) {
  1753. V = null;
  1754. } else {
  1755. V = EventHandlerNonNull.convert(globalObject, V, {
  1756. context: "Failed to set the 'oncuechange' property on 'Document': The provided value"
  1757. });
  1758. }
  1759. esValue[implSymbol]["oncuechange"] = V;
  1760. }
  1761. get oncut() {
  1762. const esValue = this !== null && this !== undefined ? this : globalObject;
  1763. if (!exports.is(esValue)) {
  1764. throw new globalObject.TypeError("'get oncut' called on an object that is not a valid instance of Document.");
  1765. }
  1766. return utils.tryWrapperForImpl(esValue[implSymbol]["oncut"]);
  1767. }
  1768. set oncut(V) {
  1769. const esValue = this !== null && this !== undefined ? this : globalObject;
  1770. if (!exports.is(esValue)) {
  1771. throw new globalObject.TypeError("'set oncut' called on an object that is not a valid instance of Document.");
  1772. }
  1773. if (!utils.isObject(V)) {
  1774. V = null;
  1775. } else {
  1776. V = EventHandlerNonNull.convert(globalObject, V, {
  1777. context: "Failed to set the 'oncut' property on 'Document': The provided value"
  1778. });
  1779. }
  1780. esValue[implSymbol]["oncut"] = V;
  1781. }
  1782. get ondblclick() {
  1783. const esValue = this !== null && this !== undefined ? this : globalObject;
  1784. if (!exports.is(esValue)) {
  1785. throw new globalObject.TypeError(
  1786. "'get ondblclick' called on an object that is not a valid instance of Document."
  1787. );
  1788. }
  1789. return utils.tryWrapperForImpl(esValue[implSymbol]["ondblclick"]);
  1790. }
  1791. set ondblclick(V) {
  1792. const esValue = this !== null && this !== undefined ? this : globalObject;
  1793. if (!exports.is(esValue)) {
  1794. throw new globalObject.TypeError(
  1795. "'set ondblclick' called on an object that is not a valid instance of Document."
  1796. );
  1797. }
  1798. if (!utils.isObject(V)) {
  1799. V = null;
  1800. } else {
  1801. V = EventHandlerNonNull.convert(globalObject, V, {
  1802. context: "Failed to set the 'ondblclick' property on 'Document': The provided value"
  1803. });
  1804. }
  1805. esValue[implSymbol]["ondblclick"] = V;
  1806. }
  1807. get ondrag() {
  1808. const esValue = this !== null && this !== undefined ? this : globalObject;
  1809. if (!exports.is(esValue)) {
  1810. throw new globalObject.TypeError("'get ondrag' called on an object that is not a valid instance of Document.");
  1811. }
  1812. return utils.tryWrapperForImpl(esValue[implSymbol]["ondrag"]);
  1813. }
  1814. set ondrag(V) {
  1815. const esValue = this !== null && this !== undefined ? this : globalObject;
  1816. if (!exports.is(esValue)) {
  1817. throw new globalObject.TypeError("'set ondrag' called on an object that is not a valid instance of Document.");
  1818. }
  1819. if (!utils.isObject(V)) {
  1820. V = null;
  1821. } else {
  1822. V = EventHandlerNonNull.convert(globalObject, V, {
  1823. context: "Failed to set the 'ondrag' property on 'Document': The provided value"
  1824. });
  1825. }
  1826. esValue[implSymbol]["ondrag"] = V;
  1827. }
  1828. get ondragend() {
  1829. const esValue = this !== null && this !== undefined ? this : globalObject;
  1830. if (!exports.is(esValue)) {
  1831. throw new globalObject.TypeError(
  1832. "'get ondragend' called on an object that is not a valid instance of Document."
  1833. );
  1834. }
  1835. return utils.tryWrapperForImpl(esValue[implSymbol]["ondragend"]);
  1836. }
  1837. set ondragend(V) {
  1838. const esValue = this !== null && this !== undefined ? this : globalObject;
  1839. if (!exports.is(esValue)) {
  1840. throw new globalObject.TypeError(
  1841. "'set ondragend' called on an object that is not a valid instance of Document."
  1842. );
  1843. }
  1844. if (!utils.isObject(V)) {
  1845. V = null;
  1846. } else {
  1847. V = EventHandlerNonNull.convert(globalObject, V, {
  1848. context: "Failed to set the 'ondragend' property on 'Document': The provided value"
  1849. });
  1850. }
  1851. esValue[implSymbol]["ondragend"] = V;
  1852. }
  1853. get ondragenter() {
  1854. const esValue = this !== null && this !== undefined ? this : globalObject;
  1855. if (!exports.is(esValue)) {
  1856. throw new globalObject.TypeError(
  1857. "'get ondragenter' called on an object that is not a valid instance of Document."
  1858. );
  1859. }
  1860. return utils.tryWrapperForImpl(esValue[implSymbol]["ondragenter"]);
  1861. }
  1862. set ondragenter(V) {
  1863. const esValue = this !== null && this !== undefined ? this : globalObject;
  1864. if (!exports.is(esValue)) {
  1865. throw new globalObject.TypeError(
  1866. "'set ondragenter' called on an object that is not a valid instance of Document."
  1867. );
  1868. }
  1869. if (!utils.isObject(V)) {
  1870. V = null;
  1871. } else {
  1872. V = EventHandlerNonNull.convert(globalObject, V, {
  1873. context: "Failed to set the 'ondragenter' property on 'Document': The provided value"
  1874. });
  1875. }
  1876. esValue[implSymbol]["ondragenter"] = V;
  1877. }
  1878. get ondragleave() {
  1879. const esValue = this !== null && this !== undefined ? this : globalObject;
  1880. if (!exports.is(esValue)) {
  1881. throw new globalObject.TypeError(
  1882. "'get ondragleave' called on an object that is not a valid instance of Document."
  1883. );
  1884. }
  1885. return utils.tryWrapperForImpl(esValue[implSymbol]["ondragleave"]);
  1886. }
  1887. set ondragleave(V) {
  1888. const esValue = this !== null && this !== undefined ? this : globalObject;
  1889. if (!exports.is(esValue)) {
  1890. throw new globalObject.TypeError(
  1891. "'set ondragleave' called on an object that is not a valid instance of Document."
  1892. );
  1893. }
  1894. if (!utils.isObject(V)) {
  1895. V = null;
  1896. } else {
  1897. V = EventHandlerNonNull.convert(globalObject, V, {
  1898. context: "Failed to set the 'ondragleave' property on 'Document': The provided value"
  1899. });
  1900. }
  1901. esValue[implSymbol]["ondragleave"] = V;
  1902. }
  1903. get ondragover() {
  1904. const esValue = this !== null && this !== undefined ? this : globalObject;
  1905. if (!exports.is(esValue)) {
  1906. throw new globalObject.TypeError(
  1907. "'get ondragover' called on an object that is not a valid instance of Document."
  1908. );
  1909. }
  1910. return utils.tryWrapperForImpl(esValue[implSymbol]["ondragover"]);
  1911. }
  1912. set ondragover(V) {
  1913. const esValue = this !== null && this !== undefined ? this : globalObject;
  1914. if (!exports.is(esValue)) {
  1915. throw new globalObject.TypeError(
  1916. "'set ondragover' called on an object that is not a valid instance of Document."
  1917. );
  1918. }
  1919. if (!utils.isObject(V)) {
  1920. V = null;
  1921. } else {
  1922. V = EventHandlerNonNull.convert(globalObject, V, {
  1923. context: "Failed to set the 'ondragover' property on 'Document': The provided value"
  1924. });
  1925. }
  1926. esValue[implSymbol]["ondragover"] = V;
  1927. }
  1928. get ondragstart() {
  1929. const esValue = this !== null && this !== undefined ? this : globalObject;
  1930. if (!exports.is(esValue)) {
  1931. throw new globalObject.TypeError(
  1932. "'get ondragstart' called on an object that is not a valid instance of Document."
  1933. );
  1934. }
  1935. return utils.tryWrapperForImpl(esValue[implSymbol]["ondragstart"]);
  1936. }
  1937. set ondragstart(V) {
  1938. const esValue = this !== null && this !== undefined ? this : globalObject;
  1939. if (!exports.is(esValue)) {
  1940. throw new globalObject.TypeError(
  1941. "'set ondragstart' called on an object that is not a valid instance of Document."
  1942. );
  1943. }
  1944. if (!utils.isObject(V)) {
  1945. V = null;
  1946. } else {
  1947. V = EventHandlerNonNull.convert(globalObject, V, {
  1948. context: "Failed to set the 'ondragstart' property on 'Document': The provided value"
  1949. });
  1950. }
  1951. esValue[implSymbol]["ondragstart"] = V;
  1952. }
  1953. get ondrop() {
  1954. const esValue = this !== null && this !== undefined ? this : globalObject;
  1955. if (!exports.is(esValue)) {
  1956. throw new globalObject.TypeError("'get ondrop' called on an object that is not a valid instance of Document.");
  1957. }
  1958. return utils.tryWrapperForImpl(esValue[implSymbol]["ondrop"]);
  1959. }
  1960. set ondrop(V) {
  1961. const esValue = this !== null && this !== undefined ? this : globalObject;
  1962. if (!exports.is(esValue)) {
  1963. throw new globalObject.TypeError("'set ondrop' called on an object that is not a valid instance of Document.");
  1964. }
  1965. if (!utils.isObject(V)) {
  1966. V = null;
  1967. } else {
  1968. V = EventHandlerNonNull.convert(globalObject, V, {
  1969. context: "Failed to set the 'ondrop' property on 'Document': The provided value"
  1970. });
  1971. }
  1972. esValue[implSymbol]["ondrop"] = V;
  1973. }
  1974. get ondurationchange() {
  1975. const esValue = this !== null && this !== undefined ? this : globalObject;
  1976. if (!exports.is(esValue)) {
  1977. throw new globalObject.TypeError(
  1978. "'get ondurationchange' called on an object that is not a valid instance of Document."
  1979. );
  1980. }
  1981. return utils.tryWrapperForImpl(esValue[implSymbol]["ondurationchange"]);
  1982. }
  1983. set ondurationchange(V) {
  1984. const esValue = this !== null && this !== undefined ? this : globalObject;
  1985. if (!exports.is(esValue)) {
  1986. throw new globalObject.TypeError(
  1987. "'set ondurationchange' called on an object that is not a valid instance of Document."
  1988. );
  1989. }
  1990. if (!utils.isObject(V)) {
  1991. V = null;
  1992. } else {
  1993. V = EventHandlerNonNull.convert(globalObject, V, {
  1994. context: "Failed to set the 'ondurationchange' property on 'Document': The provided value"
  1995. });
  1996. }
  1997. esValue[implSymbol]["ondurationchange"] = V;
  1998. }
  1999. get onemptied() {
  2000. const esValue = this !== null && this !== undefined ? this : globalObject;
  2001. if (!exports.is(esValue)) {
  2002. throw new globalObject.TypeError(
  2003. "'get onemptied' called on an object that is not a valid instance of Document."
  2004. );
  2005. }
  2006. return utils.tryWrapperForImpl(esValue[implSymbol]["onemptied"]);
  2007. }
  2008. set onemptied(V) {
  2009. const esValue = this !== null && this !== undefined ? this : globalObject;
  2010. if (!exports.is(esValue)) {
  2011. throw new globalObject.TypeError(
  2012. "'set onemptied' called on an object that is not a valid instance of Document."
  2013. );
  2014. }
  2015. if (!utils.isObject(V)) {
  2016. V = null;
  2017. } else {
  2018. V = EventHandlerNonNull.convert(globalObject, V, {
  2019. context: "Failed to set the 'onemptied' property on 'Document': The provided value"
  2020. });
  2021. }
  2022. esValue[implSymbol]["onemptied"] = V;
  2023. }
  2024. get onended() {
  2025. const esValue = this !== null && this !== undefined ? this : globalObject;
  2026. if (!exports.is(esValue)) {
  2027. throw new globalObject.TypeError("'get onended' called on an object that is not a valid instance of Document.");
  2028. }
  2029. return utils.tryWrapperForImpl(esValue[implSymbol]["onended"]);
  2030. }
  2031. set onended(V) {
  2032. const esValue = this !== null && this !== undefined ? this : globalObject;
  2033. if (!exports.is(esValue)) {
  2034. throw new globalObject.TypeError("'set onended' called on an object that is not a valid instance of Document.");
  2035. }
  2036. if (!utils.isObject(V)) {
  2037. V = null;
  2038. } else {
  2039. V = EventHandlerNonNull.convert(globalObject, V, {
  2040. context: "Failed to set the 'onended' property on 'Document': The provided value"
  2041. });
  2042. }
  2043. esValue[implSymbol]["onended"] = V;
  2044. }
  2045. get onerror() {
  2046. const esValue = this !== null && this !== undefined ? this : globalObject;
  2047. if (!exports.is(esValue)) {
  2048. throw new globalObject.TypeError("'get onerror' called on an object that is not a valid instance of Document.");
  2049. }
  2050. return utils.tryWrapperForImpl(esValue[implSymbol]["onerror"]);
  2051. }
  2052. set onerror(V) {
  2053. const esValue = this !== null && this !== undefined ? this : globalObject;
  2054. if (!exports.is(esValue)) {
  2055. throw new globalObject.TypeError("'set onerror' called on an object that is not a valid instance of Document.");
  2056. }
  2057. if (!utils.isObject(V)) {
  2058. V = null;
  2059. } else {
  2060. V = OnErrorEventHandlerNonNull.convert(globalObject, V, {
  2061. context: "Failed to set the 'onerror' property on 'Document': The provided value"
  2062. });
  2063. }
  2064. esValue[implSymbol]["onerror"] = V;
  2065. }
  2066. get onfocus() {
  2067. const esValue = this !== null && this !== undefined ? this : globalObject;
  2068. if (!exports.is(esValue)) {
  2069. throw new globalObject.TypeError("'get onfocus' called on an object that is not a valid instance of Document.");
  2070. }
  2071. return utils.tryWrapperForImpl(esValue[implSymbol]["onfocus"]);
  2072. }
  2073. set onfocus(V) {
  2074. const esValue = this !== null && this !== undefined ? this : globalObject;
  2075. if (!exports.is(esValue)) {
  2076. throw new globalObject.TypeError("'set onfocus' called on an object that is not a valid instance of Document.");
  2077. }
  2078. if (!utils.isObject(V)) {
  2079. V = null;
  2080. } else {
  2081. V = EventHandlerNonNull.convert(globalObject, V, {
  2082. context: "Failed to set the 'onfocus' property on 'Document': The provided value"
  2083. });
  2084. }
  2085. esValue[implSymbol]["onfocus"] = V;
  2086. }
  2087. get onformdata() {
  2088. const esValue = this !== null && this !== undefined ? this : globalObject;
  2089. if (!exports.is(esValue)) {
  2090. throw new globalObject.TypeError(
  2091. "'get onformdata' called on an object that is not a valid instance of Document."
  2092. );
  2093. }
  2094. return utils.tryWrapperForImpl(esValue[implSymbol]["onformdata"]);
  2095. }
  2096. set onformdata(V) {
  2097. const esValue = this !== null && this !== undefined ? this : globalObject;
  2098. if (!exports.is(esValue)) {
  2099. throw new globalObject.TypeError(
  2100. "'set onformdata' called on an object that is not a valid instance of Document."
  2101. );
  2102. }
  2103. if (!utils.isObject(V)) {
  2104. V = null;
  2105. } else {
  2106. V = EventHandlerNonNull.convert(globalObject, V, {
  2107. context: "Failed to set the 'onformdata' property on 'Document': The provided value"
  2108. });
  2109. }
  2110. esValue[implSymbol]["onformdata"] = V;
  2111. }
  2112. get oninput() {
  2113. const esValue = this !== null && this !== undefined ? this : globalObject;
  2114. if (!exports.is(esValue)) {
  2115. throw new globalObject.TypeError("'get oninput' called on an object that is not a valid instance of Document.");
  2116. }
  2117. return utils.tryWrapperForImpl(esValue[implSymbol]["oninput"]);
  2118. }
  2119. set oninput(V) {
  2120. const esValue = this !== null && this !== undefined ? this : globalObject;
  2121. if (!exports.is(esValue)) {
  2122. throw new globalObject.TypeError("'set oninput' called on an object that is not a valid instance of Document.");
  2123. }
  2124. if (!utils.isObject(V)) {
  2125. V = null;
  2126. } else {
  2127. V = EventHandlerNonNull.convert(globalObject, V, {
  2128. context: "Failed to set the 'oninput' property on 'Document': The provided value"
  2129. });
  2130. }
  2131. esValue[implSymbol]["oninput"] = V;
  2132. }
  2133. get oninvalid() {
  2134. const esValue = this !== null && this !== undefined ? this : globalObject;
  2135. if (!exports.is(esValue)) {
  2136. throw new globalObject.TypeError(
  2137. "'get oninvalid' called on an object that is not a valid instance of Document."
  2138. );
  2139. }
  2140. return utils.tryWrapperForImpl(esValue[implSymbol]["oninvalid"]);
  2141. }
  2142. set oninvalid(V) {
  2143. const esValue = this !== null && this !== undefined ? this : globalObject;
  2144. if (!exports.is(esValue)) {
  2145. throw new globalObject.TypeError(
  2146. "'set oninvalid' called on an object that is not a valid instance of Document."
  2147. );
  2148. }
  2149. if (!utils.isObject(V)) {
  2150. V = null;
  2151. } else {
  2152. V = EventHandlerNonNull.convert(globalObject, V, {
  2153. context: "Failed to set the 'oninvalid' property on 'Document': The provided value"
  2154. });
  2155. }
  2156. esValue[implSymbol]["oninvalid"] = V;
  2157. }
  2158. get onkeydown() {
  2159. const esValue = this !== null && this !== undefined ? this : globalObject;
  2160. if (!exports.is(esValue)) {
  2161. throw new globalObject.TypeError(
  2162. "'get onkeydown' called on an object that is not a valid instance of Document."
  2163. );
  2164. }
  2165. return utils.tryWrapperForImpl(esValue[implSymbol]["onkeydown"]);
  2166. }
  2167. set onkeydown(V) {
  2168. const esValue = this !== null && this !== undefined ? this : globalObject;
  2169. if (!exports.is(esValue)) {
  2170. throw new globalObject.TypeError(
  2171. "'set onkeydown' called on an object that is not a valid instance of Document."
  2172. );
  2173. }
  2174. if (!utils.isObject(V)) {
  2175. V = null;
  2176. } else {
  2177. V = EventHandlerNonNull.convert(globalObject, V, {
  2178. context: "Failed to set the 'onkeydown' property on 'Document': The provided value"
  2179. });
  2180. }
  2181. esValue[implSymbol]["onkeydown"] = V;
  2182. }
  2183. get onkeypress() {
  2184. const esValue = this !== null && this !== undefined ? this : globalObject;
  2185. if (!exports.is(esValue)) {
  2186. throw new globalObject.TypeError(
  2187. "'get onkeypress' called on an object that is not a valid instance of Document."
  2188. );
  2189. }
  2190. return utils.tryWrapperForImpl(esValue[implSymbol]["onkeypress"]);
  2191. }
  2192. set onkeypress(V) {
  2193. const esValue = this !== null && this !== undefined ? this : globalObject;
  2194. if (!exports.is(esValue)) {
  2195. throw new globalObject.TypeError(
  2196. "'set onkeypress' called on an object that is not a valid instance of Document."
  2197. );
  2198. }
  2199. if (!utils.isObject(V)) {
  2200. V = null;
  2201. } else {
  2202. V = EventHandlerNonNull.convert(globalObject, V, {
  2203. context: "Failed to set the 'onkeypress' property on 'Document': The provided value"
  2204. });
  2205. }
  2206. esValue[implSymbol]["onkeypress"] = V;
  2207. }
  2208. get onkeyup() {
  2209. const esValue = this !== null && this !== undefined ? this : globalObject;
  2210. if (!exports.is(esValue)) {
  2211. throw new globalObject.TypeError("'get onkeyup' called on an object that is not a valid instance of Document.");
  2212. }
  2213. return utils.tryWrapperForImpl(esValue[implSymbol]["onkeyup"]);
  2214. }
  2215. set onkeyup(V) {
  2216. const esValue = this !== null && this !== undefined ? this : globalObject;
  2217. if (!exports.is(esValue)) {
  2218. throw new globalObject.TypeError("'set onkeyup' called on an object that is not a valid instance of Document.");
  2219. }
  2220. if (!utils.isObject(V)) {
  2221. V = null;
  2222. } else {
  2223. V = EventHandlerNonNull.convert(globalObject, V, {
  2224. context: "Failed to set the 'onkeyup' property on 'Document': The provided value"
  2225. });
  2226. }
  2227. esValue[implSymbol]["onkeyup"] = V;
  2228. }
  2229. get onload() {
  2230. const esValue = this !== null && this !== undefined ? this : globalObject;
  2231. if (!exports.is(esValue)) {
  2232. throw new globalObject.TypeError("'get onload' called on an object that is not a valid instance of Document.");
  2233. }
  2234. return utils.tryWrapperForImpl(esValue[implSymbol]["onload"]);
  2235. }
  2236. set onload(V) {
  2237. const esValue = this !== null && this !== undefined ? this : globalObject;
  2238. if (!exports.is(esValue)) {
  2239. throw new globalObject.TypeError("'set onload' called on an object that is not a valid instance of Document.");
  2240. }
  2241. if (!utils.isObject(V)) {
  2242. V = null;
  2243. } else {
  2244. V = EventHandlerNonNull.convert(globalObject, V, {
  2245. context: "Failed to set the 'onload' property on 'Document': The provided value"
  2246. });
  2247. }
  2248. esValue[implSymbol]["onload"] = V;
  2249. }
  2250. get onloadeddata() {
  2251. const esValue = this !== null && this !== undefined ? this : globalObject;
  2252. if (!exports.is(esValue)) {
  2253. throw new globalObject.TypeError(
  2254. "'get onloadeddata' called on an object that is not a valid instance of Document."
  2255. );
  2256. }
  2257. return utils.tryWrapperForImpl(esValue[implSymbol]["onloadeddata"]);
  2258. }
  2259. set onloadeddata(V) {
  2260. const esValue = this !== null && this !== undefined ? this : globalObject;
  2261. if (!exports.is(esValue)) {
  2262. throw new globalObject.TypeError(
  2263. "'set onloadeddata' called on an object that is not a valid instance of Document."
  2264. );
  2265. }
  2266. if (!utils.isObject(V)) {
  2267. V = null;
  2268. } else {
  2269. V = EventHandlerNonNull.convert(globalObject, V, {
  2270. context: "Failed to set the 'onloadeddata' property on 'Document': The provided value"
  2271. });
  2272. }
  2273. esValue[implSymbol]["onloadeddata"] = V;
  2274. }
  2275. get onloadedmetadata() {
  2276. const esValue = this !== null && this !== undefined ? this : globalObject;
  2277. if (!exports.is(esValue)) {
  2278. throw new globalObject.TypeError(
  2279. "'get onloadedmetadata' called on an object that is not a valid instance of Document."
  2280. );
  2281. }
  2282. return utils.tryWrapperForImpl(esValue[implSymbol]["onloadedmetadata"]);
  2283. }
  2284. set onloadedmetadata(V) {
  2285. const esValue = this !== null && this !== undefined ? this : globalObject;
  2286. if (!exports.is(esValue)) {
  2287. throw new globalObject.TypeError(
  2288. "'set onloadedmetadata' called on an object that is not a valid instance of Document."
  2289. );
  2290. }
  2291. if (!utils.isObject(V)) {
  2292. V = null;
  2293. } else {
  2294. V = EventHandlerNonNull.convert(globalObject, V, {
  2295. context: "Failed to set the 'onloadedmetadata' property on 'Document': The provided value"
  2296. });
  2297. }
  2298. esValue[implSymbol]["onloadedmetadata"] = V;
  2299. }
  2300. get onloadstart() {
  2301. const esValue = this !== null && this !== undefined ? this : globalObject;
  2302. if (!exports.is(esValue)) {
  2303. throw new globalObject.TypeError(
  2304. "'get onloadstart' called on an object that is not a valid instance of Document."
  2305. );
  2306. }
  2307. return utils.tryWrapperForImpl(esValue[implSymbol]["onloadstart"]);
  2308. }
  2309. set onloadstart(V) {
  2310. const esValue = this !== null && this !== undefined ? this : globalObject;
  2311. if (!exports.is(esValue)) {
  2312. throw new globalObject.TypeError(
  2313. "'set onloadstart' called on an object that is not a valid instance of Document."
  2314. );
  2315. }
  2316. if (!utils.isObject(V)) {
  2317. V = null;
  2318. } else {
  2319. V = EventHandlerNonNull.convert(globalObject, V, {
  2320. context: "Failed to set the 'onloadstart' property on 'Document': The provided value"
  2321. });
  2322. }
  2323. esValue[implSymbol]["onloadstart"] = V;
  2324. }
  2325. get onmousedown() {
  2326. const esValue = this !== null && this !== undefined ? this : globalObject;
  2327. if (!exports.is(esValue)) {
  2328. throw new globalObject.TypeError(
  2329. "'get onmousedown' called on an object that is not a valid instance of Document."
  2330. );
  2331. }
  2332. return utils.tryWrapperForImpl(esValue[implSymbol]["onmousedown"]);
  2333. }
  2334. set onmousedown(V) {
  2335. const esValue = this !== null && this !== undefined ? this : globalObject;
  2336. if (!exports.is(esValue)) {
  2337. throw new globalObject.TypeError(
  2338. "'set onmousedown' called on an object that is not a valid instance of Document."
  2339. );
  2340. }
  2341. if (!utils.isObject(V)) {
  2342. V = null;
  2343. } else {
  2344. V = EventHandlerNonNull.convert(globalObject, V, {
  2345. context: "Failed to set the 'onmousedown' property on 'Document': The provided value"
  2346. });
  2347. }
  2348. esValue[implSymbol]["onmousedown"] = V;
  2349. }
  2350. get onmouseenter() {
  2351. const esValue = this !== null && this !== undefined ? this : globalObject;
  2352. if (!exports.is(esValue)) {
  2353. return;
  2354. }
  2355. return utils.tryWrapperForImpl(esValue[implSymbol]["onmouseenter"]);
  2356. }
  2357. set onmouseenter(V) {
  2358. const esValue = this !== null && this !== undefined ? this : globalObject;
  2359. if (!exports.is(esValue)) {
  2360. return;
  2361. }
  2362. if (!utils.isObject(V)) {
  2363. V = null;
  2364. } else {
  2365. V = EventHandlerNonNull.convert(globalObject, V, {
  2366. context: "Failed to set the 'onmouseenter' property on 'Document': The provided value"
  2367. });
  2368. }
  2369. esValue[implSymbol]["onmouseenter"] = V;
  2370. }
  2371. get onmouseleave() {
  2372. const esValue = this !== null && this !== undefined ? this : globalObject;
  2373. if (!exports.is(esValue)) {
  2374. return;
  2375. }
  2376. return utils.tryWrapperForImpl(esValue[implSymbol]["onmouseleave"]);
  2377. }
  2378. set onmouseleave(V) {
  2379. const esValue = this !== null && this !== undefined ? this : globalObject;
  2380. if (!exports.is(esValue)) {
  2381. return;
  2382. }
  2383. if (!utils.isObject(V)) {
  2384. V = null;
  2385. } else {
  2386. V = EventHandlerNonNull.convert(globalObject, V, {
  2387. context: "Failed to set the 'onmouseleave' property on 'Document': The provided value"
  2388. });
  2389. }
  2390. esValue[implSymbol]["onmouseleave"] = V;
  2391. }
  2392. get onmousemove() {
  2393. const esValue = this !== null && this !== undefined ? this : globalObject;
  2394. if (!exports.is(esValue)) {
  2395. throw new globalObject.TypeError(
  2396. "'get onmousemove' called on an object that is not a valid instance of Document."
  2397. );
  2398. }
  2399. return utils.tryWrapperForImpl(esValue[implSymbol]["onmousemove"]);
  2400. }
  2401. set onmousemove(V) {
  2402. const esValue = this !== null && this !== undefined ? this : globalObject;
  2403. if (!exports.is(esValue)) {
  2404. throw new globalObject.TypeError(
  2405. "'set onmousemove' called on an object that is not a valid instance of Document."
  2406. );
  2407. }
  2408. if (!utils.isObject(V)) {
  2409. V = null;
  2410. } else {
  2411. V = EventHandlerNonNull.convert(globalObject, V, {
  2412. context: "Failed to set the 'onmousemove' property on 'Document': The provided value"
  2413. });
  2414. }
  2415. esValue[implSymbol]["onmousemove"] = V;
  2416. }
  2417. get onmouseout() {
  2418. const esValue = this !== null && this !== undefined ? this : globalObject;
  2419. if (!exports.is(esValue)) {
  2420. throw new globalObject.TypeError(
  2421. "'get onmouseout' called on an object that is not a valid instance of Document."
  2422. );
  2423. }
  2424. return utils.tryWrapperForImpl(esValue[implSymbol]["onmouseout"]);
  2425. }
  2426. set onmouseout(V) {
  2427. const esValue = this !== null && this !== undefined ? this : globalObject;
  2428. if (!exports.is(esValue)) {
  2429. throw new globalObject.TypeError(
  2430. "'set onmouseout' called on an object that is not a valid instance of Document."
  2431. );
  2432. }
  2433. if (!utils.isObject(V)) {
  2434. V = null;
  2435. } else {
  2436. V = EventHandlerNonNull.convert(globalObject, V, {
  2437. context: "Failed to set the 'onmouseout' property on 'Document': The provided value"
  2438. });
  2439. }
  2440. esValue[implSymbol]["onmouseout"] = V;
  2441. }
  2442. get onmouseover() {
  2443. const esValue = this !== null && this !== undefined ? this : globalObject;
  2444. if (!exports.is(esValue)) {
  2445. throw new globalObject.TypeError(
  2446. "'get onmouseover' called on an object that is not a valid instance of Document."
  2447. );
  2448. }
  2449. return utils.tryWrapperForImpl(esValue[implSymbol]["onmouseover"]);
  2450. }
  2451. set onmouseover(V) {
  2452. const esValue = this !== null && this !== undefined ? this : globalObject;
  2453. if (!exports.is(esValue)) {
  2454. throw new globalObject.TypeError(
  2455. "'set onmouseover' called on an object that is not a valid instance of Document."
  2456. );
  2457. }
  2458. if (!utils.isObject(V)) {
  2459. V = null;
  2460. } else {
  2461. V = EventHandlerNonNull.convert(globalObject, V, {
  2462. context: "Failed to set the 'onmouseover' property on 'Document': The provided value"
  2463. });
  2464. }
  2465. esValue[implSymbol]["onmouseover"] = V;
  2466. }
  2467. get onmouseup() {
  2468. const esValue = this !== null && this !== undefined ? this : globalObject;
  2469. if (!exports.is(esValue)) {
  2470. throw new globalObject.TypeError(
  2471. "'get onmouseup' called on an object that is not a valid instance of Document."
  2472. );
  2473. }
  2474. return utils.tryWrapperForImpl(esValue[implSymbol]["onmouseup"]);
  2475. }
  2476. set onmouseup(V) {
  2477. const esValue = this !== null && this !== undefined ? this : globalObject;
  2478. if (!exports.is(esValue)) {
  2479. throw new globalObject.TypeError(
  2480. "'set onmouseup' called on an object that is not a valid instance of Document."
  2481. );
  2482. }
  2483. if (!utils.isObject(V)) {
  2484. V = null;
  2485. } else {
  2486. V = EventHandlerNonNull.convert(globalObject, V, {
  2487. context: "Failed to set the 'onmouseup' property on 'Document': The provided value"
  2488. });
  2489. }
  2490. esValue[implSymbol]["onmouseup"] = V;
  2491. }
  2492. get onpaste() {
  2493. const esValue = this !== null && this !== undefined ? this : globalObject;
  2494. if (!exports.is(esValue)) {
  2495. throw new globalObject.TypeError("'get onpaste' called on an object that is not a valid instance of Document.");
  2496. }
  2497. return utils.tryWrapperForImpl(esValue[implSymbol]["onpaste"]);
  2498. }
  2499. set onpaste(V) {
  2500. const esValue = this !== null && this !== undefined ? this : globalObject;
  2501. if (!exports.is(esValue)) {
  2502. throw new globalObject.TypeError("'set onpaste' called on an object that is not a valid instance of Document.");
  2503. }
  2504. if (!utils.isObject(V)) {
  2505. V = null;
  2506. } else {
  2507. V = EventHandlerNonNull.convert(globalObject, V, {
  2508. context: "Failed to set the 'onpaste' property on 'Document': The provided value"
  2509. });
  2510. }
  2511. esValue[implSymbol]["onpaste"] = V;
  2512. }
  2513. get onpause() {
  2514. const esValue = this !== null && this !== undefined ? this : globalObject;
  2515. if (!exports.is(esValue)) {
  2516. throw new globalObject.TypeError("'get onpause' called on an object that is not a valid instance of Document.");
  2517. }
  2518. return utils.tryWrapperForImpl(esValue[implSymbol]["onpause"]);
  2519. }
  2520. set onpause(V) {
  2521. const esValue = this !== null && this !== undefined ? this : globalObject;
  2522. if (!exports.is(esValue)) {
  2523. throw new globalObject.TypeError("'set onpause' called on an object that is not a valid instance of Document.");
  2524. }
  2525. if (!utils.isObject(V)) {
  2526. V = null;
  2527. } else {
  2528. V = EventHandlerNonNull.convert(globalObject, V, {
  2529. context: "Failed to set the 'onpause' property on 'Document': The provided value"
  2530. });
  2531. }
  2532. esValue[implSymbol]["onpause"] = V;
  2533. }
  2534. get onplay() {
  2535. const esValue = this !== null && this !== undefined ? this : globalObject;
  2536. if (!exports.is(esValue)) {
  2537. throw new globalObject.TypeError("'get onplay' called on an object that is not a valid instance of Document.");
  2538. }
  2539. return utils.tryWrapperForImpl(esValue[implSymbol]["onplay"]);
  2540. }
  2541. set onplay(V) {
  2542. const esValue = this !== null && this !== undefined ? this : globalObject;
  2543. if (!exports.is(esValue)) {
  2544. throw new globalObject.TypeError("'set onplay' called on an object that is not a valid instance of Document.");
  2545. }
  2546. if (!utils.isObject(V)) {
  2547. V = null;
  2548. } else {
  2549. V = EventHandlerNonNull.convert(globalObject, V, {
  2550. context: "Failed to set the 'onplay' property on 'Document': The provided value"
  2551. });
  2552. }
  2553. esValue[implSymbol]["onplay"] = V;
  2554. }
  2555. get onplaying() {
  2556. const esValue = this !== null && this !== undefined ? this : globalObject;
  2557. if (!exports.is(esValue)) {
  2558. throw new globalObject.TypeError(
  2559. "'get onplaying' called on an object that is not a valid instance of Document."
  2560. );
  2561. }
  2562. return utils.tryWrapperForImpl(esValue[implSymbol]["onplaying"]);
  2563. }
  2564. set onplaying(V) {
  2565. const esValue = this !== null && this !== undefined ? this : globalObject;
  2566. if (!exports.is(esValue)) {
  2567. throw new globalObject.TypeError(
  2568. "'set onplaying' called on an object that is not a valid instance of Document."
  2569. );
  2570. }
  2571. if (!utils.isObject(V)) {
  2572. V = null;
  2573. } else {
  2574. V = EventHandlerNonNull.convert(globalObject, V, {
  2575. context: "Failed to set the 'onplaying' property on 'Document': The provided value"
  2576. });
  2577. }
  2578. esValue[implSymbol]["onplaying"] = V;
  2579. }
  2580. get onprogress() {
  2581. const esValue = this !== null && this !== undefined ? this : globalObject;
  2582. if (!exports.is(esValue)) {
  2583. throw new globalObject.TypeError(
  2584. "'get onprogress' called on an object that is not a valid instance of Document."
  2585. );
  2586. }
  2587. return utils.tryWrapperForImpl(esValue[implSymbol]["onprogress"]);
  2588. }
  2589. set onprogress(V) {
  2590. const esValue = this !== null && this !== undefined ? this : globalObject;
  2591. if (!exports.is(esValue)) {
  2592. throw new globalObject.TypeError(
  2593. "'set onprogress' called on an object that is not a valid instance of Document."
  2594. );
  2595. }
  2596. if (!utils.isObject(V)) {
  2597. V = null;
  2598. } else {
  2599. V = EventHandlerNonNull.convert(globalObject, V, {
  2600. context: "Failed to set the 'onprogress' property on 'Document': The provided value"
  2601. });
  2602. }
  2603. esValue[implSymbol]["onprogress"] = V;
  2604. }
  2605. get onratechange() {
  2606. const esValue = this !== null && this !== undefined ? this : globalObject;
  2607. if (!exports.is(esValue)) {
  2608. throw new globalObject.TypeError(
  2609. "'get onratechange' called on an object that is not a valid instance of Document."
  2610. );
  2611. }
  2612. return utils.tryWrapperForImpl(esValue[implSymbol]["onratechange"]);
  2613. }
  2614. set onratechange(V) {
  2615. const esValue = this !== null && this !== undefined ? this : globalObject;
  2616. if (!exports.is(esValue)) {
  2617. throw new globalObject.TypeError(
  2618. "'set onratechange' called on an object that is not a valid instance of Document."
  2619. );
  2620. }
  2621. if (!utils.isObject(V)) {
  2622. V = null;
  2623. } else {
  2624. V = EventHandlerNonNull.convert(globalObject, V, {
  2625. context: "Failed to set the 'onratechange' property on 'Document': The provided value"
  2626. });
  2627. }
  2628. esValue[implSymbol]["onratechange"] = V;
  2629. }
  2630. get onreset() {
  2631. const esValue = this !== null && this !== undefined ? this : globalObject;
  2632. if (!exports.is(esValue)) {
  2633. throw new globalObject.TypeError("'get onreset' called on an object that is not a valid instance of Document.");
  2634. }
  2635. return utils.tryWrapperForImpl(esValue[implSymbol]["onreset"]);
  2636. }
  2637. set onreset(V) {
  2638. const esValue = this !== null && this !== undefined ? this : globalObject;
  2639. if (!exports.is(esValue)) {
  2640. throw new globalObject.TypeError("'set onreset' called on an object that is not a valid instance of Document.");
  2641. }
  2642. if (!utils.isObject(V)) {
  2643. V = null;
  2644. } else {
  2645. V = EventHandlerNonNull.convert(globalObject, V, {
  2646. context: "Failed to set the 'onreset' property on 'Document': The provided value"
  2647. });
  2648. }
  2649. esValue[implSymbol]["onreset"] = V;
  2650. }
  2651. get onresize() {
  2652. const esValue = this !== null && this !== undefined ? this : globalObject;
  2653. if (!exports.is(esValue)) {
  2654. throw new globalObject.TypeError(
  2655. "'get onresize' called on an object that is not a valid instance of Document."
  2656. );
  2657. }
  2658. return utils.tryWrapperForImpl(esValue[implSymbol]["onresize"]);
  2659. }
  2660. set onresize(V) {
  2661. const esValue = this !== null && this !== undefined ? this : globalObject;
  2662. if (!exports.is(esValue)) {
  2663. throw new globalObject.TypeError(
  2664. "'set onresize' called on an object that is not a valid instance of Document."
  2665. );
  2666. }
  2667. if (!utils.isObject(V)) {
  2668. V = null;
  2669. } else {
  2670. V = EventHandlerNonNull.convert(globalObject, V, {
  2671. context: "Failed to set the 'onresize' property on 'Document': The provided value"
  2672. });
  2673. }
  2674. esValue[implSymbol]["onresize"] = V;
  2675. }
  2676. get onscroll() {
  2677. const esValue = this !== null && this !== undefined ? this : globalObject;
  2678. if (!exports.is(esValue)) {
  2679. throw new globalObject.TypeError(
  2680. "'get onscroll' called on an object that is not a valid instance of Document."
  2681. );
  2682. }
  2683. return utils.tryWrapperForImpl(esValue[implSymbol]["onscroll"]);
  2684. }
  2685. set onscroll(V) {
  2686. const esValue = this !== null && this !== undefined ? this : globalObject;
  2687. if (!exports.is(esValue)) {
  2688. throw new globalObject.TypeError(
  2689. "'set onscroll' called on an object that is not a valid instance of Document."
  2690. );
  2691. }
  2692. if (!utils.isObject(V)) {
  2693. V = null;
  2694. } else {
  2695. V = EventHandlerNonNull.convert(globalObject, V, {
  2696. context: "Failed to set the 'onscroll' property on 'Document': The provided value"
  2697. });
  2698. }
  2699. esValue[implSymbol]["onscroll"] = V;
  2700. }
  2701. get onscrollend() {
  2702. const esValue = this !== null && this !== undefined ? this : globalObject;
  2703. if (!exports.is(esValue)) {
  2704. throw new globalObject.TypeError(
  2705. "'get onscrollend' called on an object that is not a valid instance of Document."
  2706. );
  2707. }
  2708. return utils.tryWrapperForImpl(esValue[implSymbol]["onscrollend"]);
  2709. }
  2710. set onscrollend(V) {
  2711. const esValue = this !== null && this !== undefined ? this : globalObject;
  2712. if (!exports.is(esValue)) {
  2713. throw new globalObject.TypeError(
  2714. "'set onscrollend' called on an object that is not a valid instance of Document."
  2715. );
  2716. }
  2717. if (!utils.isObject(V)) {
  2718. V = null;
  2719. } else {
  2720. V = EventHandlerNonNull.convert(globalObject, V, {
  2721. context: "Failed to set the 'onscrollend' property on 'Document': The provided value"
  2722. });
  2723. }
  2724. esValue[implSymbol]["onscrollend"] = V;
  2725. }
  2726. get onsecuritypolicyviolation() {
  2727. const esValue = this !== null && this !== undefined ? this : globalObject;
  2728. if (!exports.is(esValue)) {
  2729. throw new globalObject.TypeError(
  2730. "'get onsecuritypolicyviolation' called on an object that is not a valid instance of Document."
  2731. );
  2732. }
  2733. return utils.tryWrapperForImpl(esValue[implSymbol]["onsecuritypolicyviolation"]);
  2734. }
  2735. set onsecuritypolicyviolation(V) {
  2736. const esValue = this !== null && this !== undefined ? this : globalObject;
  2737. if (!exports.is(esValue)) {
  2738. throw new globalObject.TypeError(
  2739. "'set onsecuritypolicyviolation' called on an object that is not a valid instance of Document."
  2740. );
  2741. }
  2742. if (!utils.isObject(V)) {
  2743. V = null;
  2744. } else {
  2745. V = EventHandlerNonNull.convert(globalObject, V, {
  2746. context: "Failed to set the 'onsecuritypolicyviolation' property on 'Document': The provided value"
  2747. });
  2748. }
  2749. esValue[implSymbol]["onsecuritypolicyviolation"] = V;
  2750. }
  2751. get onseeked() {
  2752. const esValue = this !== null && this !== undefined ? this : globalObject;
  2753. if (!exports.is(esValue)) {
  2754. throw new globalObject.TypeError(
  2755. "'get onseeked' called on an object that is not a valid instance of Document."
  2756. );
  2757. }
  2758. return utils.tryWrapperForImpl(esValue[implSymbol]["onseeked"]);
  2759. }
  2760. set onseeked(V) {
  2761. const esValue = this !== null && this !== undefined ? this : globalObject;
  2762. if (!exports.is(esValue)) {
  2763. throw new globalObject.TypeError(
  2764. "'set onseeked' called on an object that is not a valid instance of Document."
  2765. );
  2766. }
  2767. if (!utils.isObject(V)) {
  2768. V = null;
  2769. } else {
  2770. V = EventHandlerNonNull.convert(globalObject, V, {
  2771. context: "Failed to set the 'onseeked' property on 'Document': The provided value"
  2772. });
  2773. }
  2774. esValue[implSymbol]["onseeked"] = V;
  2775. }
  2776. get onseeking() {
  2777. const esValue = this !== null && this !== undefined ? this : globalObject;
  2778. if (!exports.is(esValue)) {
  2779. throw new globalObject.TypeError(
  2780. "'get onseeking' called on an object that is not a valid instance of Document."
  2781. );
  2782. }
  2783. return utils.tryWrapperForImpl(esValue[implSymbol]["onseeking"]);
  2784. }
  2785. set onseeking(V) {
  2786. const esValue = this !== null && this !== undefined ? this : globalObject;
  2787. if (!exports.is(esValue)) {
  2788. throw new globalObject.TypeError(
  2789. "'set onseeking' called on an object that is not a valid instance of Document."
  2790. );
  2791. }
  2792. if (!utils.isObject(V)) {
  2793. V = null;
  2794. } else {
  2795. V = EventHandlerNonNull.convert(globalObject, V, {
  2796. context: "Failed to set the 'onseeking' property on 'Document': The provided value"
  2797. });
  2798. }
  2799. esValue[implSymbol]["onseeking"] = V;
  2800. }
  2801. get onselect() {
  2802. const esValue = this !== null && this !== undefined ? this : globalObject;
  2803. if (!exports.is(esValue)) {
  2804. throw new globalObject.TypeError(
  2805. "'get onselect' called on an object that is not a valid instance of Document."
  2806. );
  2807. }
  2808. return utils.tryWrapperForImpl(esValue[implSymbol]["onselect"]);
  2809. }
  2810. set onselect(V) {
  2811. const esValue = this !== null && this !== undefined ? this : globalObject;
  2812. if (!exports.is(esValue)) {
  2813. throw new globalObject.TypeError(
  2814. "'set onselect' called on an object that is not a valid instance of Document."
  2815. );
  2816. }
  2817. if (!utils.isObject(V)) {
  2818. V = null;
  2819. } else {
  2820. V = EventHandlerNonNull.convert(globalObject, V, {
  2821. context: "Failed to set the 'onselect' property on 'Document': The provided value"
  2822. });
  2823. }
  2824. esValue[implSymbol]["onselect"] = V;
  2825. }
  2826. get onslotchange() {
  2827. const esValue = this !== null && this !== undefined ? this : globalObject;
  2828. if (!exports.is(esValue)) {
  2829. throw new globalObject.TypeError(
  2830. "'get onslotchange' called on an object that is not a valid instance of Document."
  2831. );
  2832. }
  2833. return utils.tryWrapperForImpl(esValue[implSymbol]["onslotchange"]);
  2834. }
  2835. set onslotchange(V) {
  2836. const esValue = this !== null && this !== undefined ? this : globalObject;
  2837. if (!exports.is(esValue)) {
  2838. throw new globalObject.TypeError(
  2839. "'set onslotchange' called on an object that is not a valid instance of Document."
  2840. );
  2841. }
  2842. if (!utils.isObject(V)) {
  2843. V = null;
  2844. } else {
  2845. V = EventHandlerNonNull.convert(globalObject, V, {
  2846. context: "Failed to set the 'onslotchange' property on 'Document': The provided value"
  2847. });
  2848. }
  2849. esValue[implSymbol]["onslotchange"] = V;
  2850. }
  2851. get onstalled() {
  2852. const esValue = this !== null && this !== undefined ? this : globalObject;
  2853. if (!exports.is(esValue)) {
  2854. throw new globalObject.TypeError(
  2855. "'get onstalled' called on an object that is not a valid instance of Document."
  2856. );
  2857. }
  2858. return utils.tryWrapperForImpl(esValue[implSymbol]["onstalled"]);
  2859. }
  2860. set onstalled(V) {
  2861. const esValue = this !== null && this !== undefined ? this : globalObject;
  2862. if (!exports.is(esValue)) {
  2863. throw new globalObject.TypeError(
  2864. "'set onstalled' called on an object that is not a valid instance of Document."
  2865. );
  2866. }
  2867. if (!utils.isObject(V)) {
  2868. V = null;
  2869. } else {
  2870. V = EventHandlerNonNull.convert(globalObject, V, {
  2871. context: "Failed to set the 'onstalled' property on 'Document': The provided value"
  2872. });
  2873. }
  2874. esValue[implSymbol]["onstalled"] = V;
  2875. }
  2876. get onsubmit() {
  2877. const esValue = this !== null && this !== undefined ? this : globalObject;
  2878. if (!exports.is(esValue)) {
  2879. throw new globalObject.TypeError(
  2880. "'get onsubmit' called on an object that is not a valid instance of Document."
  2881. );
  2882. }
  2883. return utils.tryWrapperForImpl(esValue[implSymbol]["onsubmit"]);
  2884. }
  2885. set onsubmit(V) {
  2886. const esValue = this !== null && this !== undefined ? this : globalObject;
  2887. if (!exports.is(esValue)) {
  2888. throw new globalObject.TypeError(
  2889. "'set onsubmit' called on an object that is not a valid instance of Document."
  2890. );
  2891. }
  2892. if (!utils.isObject(V)) {
  2893. V = null;
  2894. } else {
  2895. V = EventHandlerNonNull.convert(globalObject, V, {
  2896. context: "Failed to set the 'onsubmit' property on 'Document': The provided value"
  2897. });
  2898. }
  2899. esValue[implSymbol]["onsubmit"] = V;
  2900. }
  2901. get onsuspend() {
  2902. const esValue = this !== null && this !== undefined ? this : globalObject;
  2903. if (!exports.is(esValue)) {
  2904. throw new globalObject.TypeError(
  2905. "'get onsuspend' called on an object that is not a valid instance of Document."
  2906. );
  2907. }
  2908. return utils.tryWrapperForImpl(esValue[implSymbol]["onsuspend"]);
  2909. }
  2910. set onsuspend(V) {
  2911. const esValue = this !== null && this !== undefined ? this : globalObject;
  2912. if (!exports.is(esValue)) {
  2913. throw new globalObject.TypeError(
  2914. "'set onsuspend' called on an object that is not a valid instance of Document."
  2915. );
  2916. }
  2917. if (!utils.isObject(V)) {
  2918. V = null;
  2919. } else {
  2920. V = EventHandlerNonNull.convert(globalObject, V, {
  2921. context: "Failed to set the 'onsuspend' property on 'Document': The provided value"
  2922. });
  2923. }
  2924. esValue[implSymbol]["onsuspend"] = V;
  2925. }
  2926. get ontimeupdate() {
  2927. const esValue = this !== null && this !== undefined ? this : globalObject;
  2928. if (!exports.is(esValue)) {
  2929. throw new globalObject.TypeError(
  2930. "'get ontimeupdate' called on an object that is not a valid instance of Document."
  2931. );
  2932. }
  2933. return utils.tryWrapperForImpl(esValue[implSymbol]["ontimeupdate"]);
  2934. }
  2935. set ontimeupdate(V) {
  2936. const esValue = this !== null && this !== undefined ? this : globalObject;
  2937. if (!exports.is(esValue)) {
  2938. throw new globalObject.TypeError(
  2939. "'set ontimeupdate' called on an object that is not a valid instance of Document."
  2940. );
  2941. }
  2942. if (!utils.isObject(V)) {
  2943. V = null;
  2944. } else {
  2945. V = EventHandlerNonNull.convert(globalObject, V, {
  2946. context: "Failed to set the 'ontimeupdate' property on 'Document': The provided value"
  2947. });
  2948. }
  2949. esValue[implSymbol]["ontimeupdate"] = V;
  2950. }
  2951. get ontoggle() {
  2952. const esValue = this !== null && this !== undefined ? this : globalObject;
  2953. if (!exports.is(esValue)) {
  2954. throw new globalObject.TypeError(
  2955. "'get ontoggle' called on an object that is not a valid instance of Document."
  2956. );
  2957. }
  2958. return utils.tryWrapperForImpl(esValue[implSymbol]["ontoggle"]);
  2959. }
  2960. set ontoggle(V) {
  2961. const esValue = this !== null && this !== undefined ? this : globalObject;
  2962. if (!exports.is(esValue)) {
  2963. throw new globalObject.TypeError(
  2964. "'set ontoggle' called on an object that is not a valid instance of Document."
  2965. );
  2966. }
  2967. if (!utils.isObject(V)) {
  2968. V = null;
  2969. } else {
  2970. V = EventHandlerNonNull.convert(globalObject, V, {
  2971. context: "Failed to set the 'ontoggle' property on 'Document': The provided value"
  2972. });
  2973. }
  2974. esValue[implSymbol]["ontoggle"] = V;
  2975. }
  2976. get onvolumechange() {
  2977. const esValue = this !== null && this !== undefined ? this : globalObject;
  2978. if (!exports.is(esValue)) {
  2979. throw new globalObject.TypeError(
  2980. "'get onvolumechange' called on an object that is not a valid instance of Document."
  2981. );
  2982. }
  2983. return utils.tryWrapperForImpl(esValue[implSymbol]["onvolumechange"]);
  2984. }
  2985. set onvolumechange(V) {
  2986. const esValue = this !== null && this !== undefined ? this : globalObject;
  2987. if (!exports.is(esValue)) {
  2988. throw new globalObject.TypeError(
  2989. "'set onvolumechange' called on an object that is not a valid instance of Document."
  2990. );
  2991. }
  2992. if (!utils.isObject(V)) {
  2993. V = null;
  2994. } else {
  2995. V = EventHandlerNonNull.convert(globalObject, V, {
  2996. context: "Failed to set the 'onvolumechange' property on 'Document': The provided value"
  2997. });
  2998. }
  2999. esValue[implSymbol]["onvolumechange"] = V;
  3000. }
  3001. get onwaiting() {
  3002. const esValue = this !== null && this !== undefined ? this : globalObject;
  3003. if (!exports.is(esValue)) {
  3004. throw new globalObject.TypeError(
  3005. "'get onwaiting' called on an object that is not a valid instance of Document."
  3006. );
  3007. }
  3008. return utils.tryWrapperForImpl(esValue[implSymbol]["onwaiting"]);
  3009. }
  3010. set onwaiting(V) {
  3011. const esValue = this !== null && this !== undefined ? this : globalObject;
  3012. if (!exports.is(esValue)) {
  3013. throw new globalObject.TypeError(
  3014. "'set onwaiting' called on an object that is not a valid instance of Document."
  3015. );
  3016. }
  3017. if (!utils.isObject(V)) {
  3018. V = null;
  3019. } else {
  3020. V = EventHandlerNonNull.convert(globalObject, V, {
  3021. context: "Failed to set the 'onwaiting' property on 'Document': The provided value"
  3022. });
  3023. }
  3024. esValue[implSymbol]["onwaiting"] = V;
  3025. }
  3026. get onwebkitanimationend() {
  3027. const esValue = this !== null && this !== undefined ? this : globalObject;
  3028. if (!exports.is(esValue)) {
  3029. throw new globalObject.TypeError(
  3030. "'get onwebkitanimationend' called on an object that is not a valid instance of Document."
  3031. );
  3032. }
  3033. return utils.tryWrapperForImpl(esValue[implSymbol]["onwebkitanimationend"]);
  3034. }
  3035. set onwebkitanimationend(V) {
  3036. const esValue = this !== null && this !== undefined ? this : globalObject;
  3037. if (!exports.is(esValue)) {
  3038. throw new globalObject.TypeError(
  3039. "'set onwebkitanimationend' called on an object that is not a valid instance of Document."
  3040. );
  3041. }
  3042. if (!utils.isObject(V)) {
  3043. V = null;
  3044. } else {
  3045. V = EventHandlerNonNull.convert(globalObject, V, {
  3046. context: "Failed to set the 'onwebkitanimationend' property on 'Document': The provided value"
  3047. });
  3048. }
  3049. esValue[implSymbol]["onwebkitanimationend"] = V;
  3050. }
  3051. get onwebkitanimationiteration() {
  3052. const esValue = this !== null && this !== undefined ? this : globalObject;
  3053. if (!exports.is(esValue)) {
  3054. throw new globalObject.TypeError(
  3055. "'get onwebkitanimationiteration' called on an object that is not a valid instance of Document."
  3056. );
  3057. }
  3058. return utils.tryWrapperForImpl(esValue[implSymbol]["onwebkitanimationiteration"]);
  3059. }
  3060. set onwebkitanimationiteration(V) {
  3061. const esValue = this !== null && this !== undefined ? this : globalObject;
  3062. if (!exports.is(esValue)) {
  3063. throw new globalObject.TypeError(
  3064. "'set onwebkitanimationiteration' called on an object that is not a valid instance of Document."
  3065. );
  3066. }
  3067. if (!utils.isObject(V)) {
  3068. V = null;
  3069. } else {
  3070. V = EventHandlerNonNull.convert(globalObject, V, {
  3071. context: "Failed to set the 'onwebkitanimationiteration' property on 'Document': The provided value"
  3072. });
  3073. }
  3074. esValue[implSymbol]["onwebkitanimationiteration"] = V;
  3075. }
  3076. get onwebkitanimationstart() {
  3077. const esValue = this !== null && this !== undefined ? this : globalObject;
  3078. if (!exports.is(esValue)) {
  3079. throw new globalObject.TypeError(
  3080. "'get onwebkitanimationstart' called on an object that is not a valid instance of Document."
  3081. );
  3082. }
  3083. return utils.tryWrapperForImpl(esValue[implSymbol]["onwebkitanimationstart"]);
  3084. }
  3085. set onwebkitanimationstart(V) {
  3086. const esValue = this !== null && this !== undefined ? this : globalObject;
  3087. if (!exports.is(esValue)) {
  3088. throw new globalObject.TypeError(
  3089. "'set onwebkitanimationstart' called on an object that is not a valid instance of Document."
  3090. );
  3091. }
  3092. if (!utils.isObject(V)) {
  3093. V = null;
  3094. } else {
  3095. V = EventHandlerNonNull.convert(globalObject, V, {
  3096. context: "Failed to set the 'onwebkitanimationstart' property on 'Document': The provided value"
  3097. });
  3098. }
  3099. esValue[implSymbol]["onwebkitanimationstart"] = V;
  3100. }
  3101. get onwebkittransitionend() {
  3102. const esValue = this !== null && this !== undefined ? this : globalObject;
  3103. if (!exports.is(esValue)) {
  3104. throw new globalObject.TypeError(
  3105. "'get onwebkittransitionend' called on an object that is not a valid instance of Document."
  3106. );
  3107. }
  3108. return utils.tryWrapperForImpl(esValue[implSymbol]["onwebkittransitionend"]);
  3109. }
  3110. set onwebkittransitionend(V) {
  3111. const esValue = this !== null && this !== undefined ? this : globalObject;
  3112. if (!exports.is(esValue)) {
  3113. throw new globalObject.TypeError(
  3114. "'set onwebkittransitionend' called on an object that is not a valid instance of Document."
  3115. );
  3116. }
  3117. if (!utils.isObject(V)) {
  3118. V = null;
  3119. } else {
  3120. V = EventHandlerNonNull.convert(globalObject, V, {
  3121. context: "Failed to set the 'onwebkittransitionend' property on 'Document': The provided value"
  3122. });
  3123. }
  3124. esValue[implSymbol]["onwebkittransitionend"] = V;
  3125. }
  3126. get onwheel() {
  3127. const esValue = this !== null && this !== undefined ? this : globalObject;
  3128. if (!exports.is(esValue)) {
  3129. throw new globalObject.TypeError("'get onwheel' called on an object that is not a valid instance of Document.");
  3130. }
  3131. return utils.tryWrapperForImpl(esValue[implSymbol]["onwheel"]);
  3132. }
  3133. set onwheel(V) {
  3134. const esValue = this !== null && this !== undefined ? this : globalObject;
  3135. if (!exports.is(esValue)) {
  3136. throw new globalObject.TypeError("'set onwheel' called on an object that is not a valid instance of Document.");
  3137. }
  3138. if (!utils.isObject(V)) {
  3139. V = null;
  3140. } else {
  3141. V = EventHandlerNonNull.convert(globalObject, V, {
  3142. context: "Failed to set the 'onwheel' property on 'Document': The provided value"
  3143. });
  3144. }
  3145. esValue[implSymbol]["onwheel"] = V;
  3146. }
  3147. get ontouchstart() {
  3148. const esValue = this !== null && this !== undefined ? this : globalObject;
  3149. if (!exports.is(esValue)) {
  3150. throw new globalObject.TypeError(
  3151. "'get ontouchstart' called on an object that is not a valid instance of Document."
  3152. );
  3153. }
  3154. return utils.tryWrapperForImpl(esValue[implSymbol]["ontouchstart"]);
  3155. }
  3156. set ontouchstart(V) {
  3157. const esValue = this !== null && this !== undefined ? this : globalObject;
  3158. if (!exports.is(esValue)) {
  3159. throw new globalObject.TypeError(
  3160. "'set ontouchstart' called on an object that is not a valid instance of Document."
  3161. );
  3162. }
  3163. if (!utils.isObject(V)) {
  3164. V = null;
  3165. } else {
  3166. V = EventHandlerNonNull.convert(globalObject, V, {
  3167. context: "Failed to set the 'ontouchstart' property on 'Document': The provided value"
  3168. });
  3169. }
  3170. esValue[implSymbol]["ontouchstart"] = V;
  3171. }
  3172. get ontouchend() {
  3173. const esValue = this !== null && this !== undefined ? this : globalObject;
  3174. if (!exports.is(esValue)) {
  3175. throw new globalObject.TypeError(
  3176. "'get ontouchend' called on an object that is not a valid instance of Document."
  3177. );
  3178. }
  3179. return utils.tryWrapperForImpl(esValue[implSymbol]["ontouchend"]);
  3180. }
  3181. set ontouchend(V) {
  3182. const esValue = this !== null && this !== undefined ? this : globalObject;
  3183. if (!exports.is(esValue)) {
  3184. throw new globalObject.TypeError(
  3185. "'set ontouchend' called on an object that is not a valid instance of Document."
  3186. );
  3187. }
  3188. if (!utils.isObject(V)) {
  3189. V = null;
  3190. } else {
  3191. V = EventHandlerNonNull.convert(globalObject, V, {
  3192. context: "Failed to set the 'ontouchend' property on 'Document': The provided value"
  3193. });
  3194. }
  3195. esValue[implSymbol]["ontouchend"] = V;
  3196. }
  3197. get ontouchmove() {
  3198. const esValue = this !== null && this !== undefined ? this : globalObject;
  3199. if (!exports.is(esValue)) {
  3200. throw new globalObject.TypeError(
  3201. "'get ontouchmove' called on an object that is not a valid instance of Document."
  3202. );
  3203. }
  3204. return utils.tryWrapperForImpl(esValue[implSymbol]["ontouchmove"]);
  3205. }
  3206. set ontouchmove(V) {
  3207. const esValue = this !== null && this !== undefined ? this : globalObject;
  3208. if (!exports.is(esValue)) {
  3209. throw new globalObject.TypeError(
  3210. "'set ontouchmove' called on an object that is not a valid instance of Document."
  3211. );
  3212. }
  3213. if (!utils.isObject(V)) {
  3214. V = null;
  3215. } else {
  3216. V = EventHandlerNonNull.convert(globalObject, V, {
  3217. context: "Failed to set the 'ontouchmove' property on 'Document': The provided value"
  3218. });
  3219. }
  3220. esValue[implSymbol]["ontouchmove"] = V;
  3221. }
  3222. get ontouchcancel() {
  3223. const esValue = this !== null && this !== undefined ? this : globalObject;
  3224. if (!exports.is(esValue)) {
  3225. throw new globalObject.TypeError(
  3226. "'get ontouchcancel' called on an object that is not a valid instance of Document."
  3227. );
  3228. }
  3229. return utils.tryWrapperForImpl(esValue[implSymbol]["ontouchcancel"]);
  3230. }
  3231. set ontouchcancel(V) {
  3232. const esValue = this !== null && this !== undefined ? this : globalObject;
  3233. if (!exports.is(esValue)) {
  3234. throw new globalObject.TypeError(
  3235. "'set ontouchcancel' called on an object that is not a valid instance of Document."
  3236. );
  3237. }
  3238. if (!utils.isObject(V)) {
  3239. V = null;
  3240. } else {
  3241. V = EventHandlerNonNull.convert(globalObject, V, {
  3242. context: "Failed to set the 'ontouchcancel' property on 'Document': The provided value"
  3243. });
  3244. }
  3245. esValue[implSymbol]["ontouchcancel"] = V;
  3246. }
  3247. get onpointerover() {
  3248. const esValue = this !== null && this !== undefined ? this : globalObject;
  3249. if (!exports.is(esValue)) {
  3250. throw new globalObject.TypeError(
  3251. "'get onpointerover' called on an object that is not a valid instance of Document."
  3252. );
  3253. }
  3254. return utils.tryWrapperForImpl(esValue[implSymbol]["onpointerover"]);
  3255. }
  3256. set onpointerover(V) {
  3257. const esValue = this !== null && this !== undefined ? this : globalObject;
  3258. if (!exports.is(esValue)) {
  3259. throw new globalObject.TypeError(
  3260. "'set onpointerover' called on an object that is not a valid instance of Document."
  3261. );
  3262. }
  3263. if (!utils.isObject(V)) {
  3264. V = null;
  3265. } else {
  3266. V = EventHandlerNonNull.convert(globalObject, V, {
  3267. context: "Failed to set the 'onpointerover' property on 'Document': The provided value"
  3268. });
  3269. }
  3270. esValue[implSymbol]["onpointerover"] = V;
  3271. }
  3272. get onpointerenter() {
  3273. const esValue = this !== null && this !== undefined ? this : globalObject;
  3274. if (!exports.is(esValue)) {
  3275. throw new globalObject.TypeError(
  3276. "'get onpointerenter' called on an object that is not a valid instance of Document."
  3277. );
  3278. }
  3279. return utils.tryWrapperForImpl(esValue[implSymbol]["onpointerenter"]);
  3280. }
  3281. set onpointerenter(V) {
  3282. const esValue = this !== null && this !== undefined ? this : globalObject;
  3283. if (!exports.is(esValue)) {
  3284. throw new globalObject.TypeError(
  3285. "'set onpointerenter' called on an object that is not a valid instance of Document."
  3286. );
  3287. }
  3288. if (!utils.isObject(V)) {
  3289. V = null;
  3290. } else {
  3291. V = EventHandlerNonNull.convert(globalObject, V, {
  3292. context: "Failed to set the 'onpointerenter' property on 'Document': The provided value"
  3293. });
  3294. }
  3295. esValue[implSymbol]["onpointerenter"] = V;
  3296. }
  3297. get onpointerdown() {
  3298. const esValue = this !== null && this !== undefined ? this : globalObject;
  3299. if (!exports.is(esValue)) {
  3300. throw new globalObject.TypeError(
  3301. "'get onpointerdown' called on an object that is not a valid instance of Document."
  3302. );
  3303. }
  3304. return utils.tryWrapperForImpl(esValue[implSymbol]["onpointerdown"]);
  3305. }
  3306. set onpointerdown(V) {
  3307. const esValue = this !== null && this !== undefined ? this : globalObject;
  3308. if (!exports.is(esValue)) {
  3309. throw new globalObject.TypeError(
  3310. "'set onpointerdown' called on an object that is not a valid instance of Document."
  3311. );
  3312. }
  3313. if (!utils.isObject(V)) {
  3314. V = null;
  3315. } else {
  3316. V = EventHandlerNonNull.convert(globalObject, V, {
  3317. context: "Failed to set the 'onpointerdown' property on 'Document': The provided value"
  3318. });
  3319. }
  3320. esValue[implSymbol]["onpointerdown"] = V;
  3321. }
  3322. get onpointermove() {
  3323. const esValue = this !== null && this !== undefined ? this : globalObject;
  3324. if (!exports.is(esValue)) {
  3325. throw new globalObject.TypeError(
  3326. "'get onpointermove' called on an object that is not a valid instance of Document."
  3327. );
  3328. }
  3329. return utils.tryWrapperForImpl(esValue[implSymbol]["onpointermove"]);
  3330. }
  3331. set onpointermove(V) {
  3332. const esValue = this !== null && this !== undefined ? this : globalObject;
  3333. if (!exports.is(esValue)) {
  3334. throw new globalObject.TypeError(
  3335. "'set onpointermove' called on an object that is not a valid instance of Document."
  3336. );
  3337. }
  3338. if (!utils.isObject(V)) {
  3339. V = null;
  3340. } else {
  3341. V = EventHandlerNonNull.convert(globalObject, V, {
  3342. context: "Failed to set the 'onpointermove' property on 'Document': The provided value"
  3343. });
  3344. }
  3345. esValue[implSymbol]["onpointermove"] = V;
  3346. }
  3347. get onpointerrawupdate() {
  3348. const esValue = this !== null && this !== undefined ? this : globalObject;
  3349. if (!exports.is(esValue)) {
  3350. throw new globalObject.TypeError(
  3351. "'get onpointerrawupdate' called on an object that is not a valid instance of Document."
  3352. );
  3353. }
  3354. return utils.tryWrapperForImpl(esValue[implSymbol]["onpointerrawupdate"]);
  3355. }
  3356. set onpointerrawupdate(V) {
  3357. const esValue = this !== null && this !== undefined ? this : globalObject;
  3358. if (!exports.is(esValue)) {
  3359. throw new globalObject.TypeError(
  3360. "'set onpointerrawupdate' called on an object that is not a valid instance of Document."
  3361. );
  3362. }
  3363. if (!utils.isObject(V)) {
  3364. V = null;
  3365. } else {
  3366. V = EventHandlerNonNull.convert(globalObject, V, {
  3367. context: "Failed to set the 'onpointerrawupdate' property on 'Document': The provided value"
  3368. });
  3369. }
  3370. esValue[implSymbol]["onpointerrawupdate"] = V;
  3371. }
  3372. get onpointerup() {
  3373. const esValue = this !== null && this !== undefined ? this : globalObject;
  3374. if (!exports.is(esValue)) {
  3375. throw new globalObject.TypeError(
  3376. "'get onpointerup' called on an object that is not a valid instance of Document."
  3377. );
  3378. }
  3379. return utils.tryWrapperForImpl(esValue[implSymbol]["onpointerup"]);
  3380. }
  3381. set onpointerup(V) {
  3382. const esValue = this !== null && this !== undefined ? this : globalObject;
  3383. if (!exports.is(esValue)) {
  3384. throw new globalObject.TypeError(
  3385. "'set onpointerup' called on an object that is not a valid instance of Document."
  3386. );
  3387. }
  3388. if (!utils.isObject(V)) {
  3389. V = null;
  3390. } else {
  3391. V = EventHandlerNonNull.convert(globalObject, V, {
  3392. context: "Failed to set the 'onpointerup' property on 'Document': The provided value"
  3393. });
  3394. }
  3395. esValue[implSymbol]["onpointerup"] = V;
  3396. }
  3397. get onpointercancel() {
  3398. const esValue = this !== null && this !== undefined ? this : globalObject;
  3399. if (!exports.is(esValue)) {
  3400. throw new globalObject.TypeError(
  3401. "'get onpointercancel' called on an object that is not a valid instance of Document."
  3402. );
  3403. }
  3404. return utils.tryWrapperForImpl(esValue[implSymbol]["onpointercancel"]);
  3405. }
  3406. set onpointercancel(V) {
  3407. const esValue = this !== null && this !== undefined ? this : globalObject;
  3408. if (!exports.is(esValue)) {
  3409. throw new globalObject.TypeError(
  3410. "'set onpointercancel' called on an object that is not a valid instance of Document."
  3411. );
  3412. }
  3413. if (!utils.isObject(V)) {
  3414. V = null;
  3415. } else {
  3416. V = EventHandlerNonNull.convert(globalObject, V, {
  3417. context: "Failed to set the 'onpointercancel' property on 'Document': The provided value"
  3418. });
  3419. }
  3420. esValue[implSymbol]["onpointercancel"] = V;
  3421. }
  3422. get onpointerout() {
  3423. const esValue = this !== null && this !== undefined ? this : globalObject;
  3424. if (!exports.is(esValue)) {
  3425. throw new globalObject.TypeError(
  3426. "'get onpointerout' called on an object that is not a valid instance of Document."
  3427. );
  3428. }
  3429. return utils.tryWrapperForImpl(esValue[implSymbol]["onpointerout"]);
  3430. }
  3431. set onpointerout(V) {
  3432. const esValue = this !== null && this !== undefined ? this : globalObject;
  3433. if (!exports.is(esValue)) {
  3434. throw new globalObject.TypeError(
  3435. "'set onpointerout' called on an object that is not a valid instance of Document."
  3436. );
  3437. }
  3438. if (!utils.isObject(V)) {
  3439. V = null;
  3440. } else {
  3441. V = EventHandlerNonNull.convert(globalObject, V, {
  3442. context: "Failed to set the 'onpointerout' property on 'Document': The provided value"
  3443. });
  3444. }
  3445. esValue[implSymbol]["onpointerout"] = V;
  3446. }
  3447. get onpointerleave() {
  3448. const esValue = this !== null && this !== undefined ? this : globalObject;
  3449. if (!exports.is(esValue)) {
  3450. throw new globalObject.TypeError(
  3451. "'get onpointerleave' called on an object that is not a valid instance of Document."
  3452. );
  3453. }
  3454. return utils.tryWrapperForImpl(esValue[implSymbol]["onpointerleave"]);
  3455. }
  3456. set onpointerleave(V) {
  3457. const esValue = this !== null && this !== undefined ? this : globalObject;
  3458. if (!exports.is(esValue)) {
  3459. throw new globalObject.TypeError(
  3460. "'set onpointerleave' called on an object that is not a valid instance of Document."
  3461. );
  3462. }
  3463. if (!utils.isObject(V)) {
  3464. V = null;
  3465. } else {
  3466. V = EventHandlerNonNull.convert(globalObject, V, {
  3467. context: "Failed to set the 'onpointerleave' property on 'Document': The provided value"
  3468. });
  3469. }
  3470. esValue[implSymbol]["onpointerleave"] = V;
  3471. }
  3472. get ongotpointercapture() {
  3473. const esValue = this !== null && this !== undefined ? this : globalObject;
  3474. if (!exports.is(esValue)) {
  3475. throw new globalObject.TypeError(
  3476. "'get ongotpointercapture' called on an object that is not a valid instance of Document."
  3477. );
  3478. }
  3479. return utils.tryWrapperForImpl(esValue[implSymbol]["ongotpointercapture"]);
  3480. }
  3481. set ongotpointercapture(V) {
  3482. const esValue = this !== null && this !== undefined ? this : globalObject;
  3483. if (!exports.is(esValue)) {
  3484. throw new globalObject.TypeError(
  3485. "'set ongotpointercapture' called on an object that is not a valid instance of Document."
  3486. );
  3487. }
  3488. if (!utils.isObject(V)) {
  3489. V = null;
  3490. } else {
  3491. V = EventHandlerNonNull.convert(globalObject, V, {
  3492. context: "Failed to set the 'ongotpointercapture' property on 'Document': The provided value"
  3493. });
  3494. }
  3495. esValue[implSymbol]["ongotpointercapture"] = V;
  3496. }
  3497. get onlostpointercapture() {
  3498. const esValue = this !== null && this !== undefined ? this : globalObject;
  3499. if (!exports.is(esValue)) {
  3500. throw new globalObject.TypeError(
  3501. "'get onlostpointercapture' called on an object that is not a valid instance of Document."
  3502. );
  3503. }
  3504. return utils.tryWrapperForImpl(esValue[implSymbol]["onlostpointercapture"]);
  3505. }
  3506. set onlostpointercapture(V) {
  3507. const esValue = this !== null && this !== undefined ? this : globalObject;
  3508. if (!exports.is(esValue)) {
  3509. throw new globalObject.TypeError(
  3510. "'set onlostpointercapture' called on an object that is not a valid instance of Document."
  3511. );
  3512. }
  3513. if (!utils.isObject(V)) {
  3514. V = null;
  3515. } else {
  3516. V = EventHandlerNonNull.convert(globalObject, V, {
  3517. context: "Failed to set the 'onlostpointercapture' property on 'Document': The provided value"
  3518. });
  3519. }
  3520. esValue[implSymbol]["onlostpointercapture"] = V;
  3521. }
  3522. get activeElement() {
  3523. const esValue = this !== null && this !== undefined ? this : globalObject;
  3524. if (!exports.is(esValue)) {
  3525. throw new globalObject.TypeError(
  3526. "'get activeElement' called on an object that is not a valid instance of Document."
  3527. );
  3528. }
  3529. return utils.tryWrapperForImpl(esValue[implSymbol]["activeElement"]);
  3530. }
  3531. get children() {
  3532. const esValue = this !== null && this !== undefined ? this : globalObject;
  3533. if (!exports.is(esValue)) {
  3534. throw new globalObject.TypeError(
  3535. "'get children' called on an object that is not a valid instance of Document."
  3536. );
  3537. }
  3538. return utils.getSameObject(this, "children", () => {
  3539. return utils.tryWrapperForImpl(esValue[implSymbol]["children"]);
  3540. });
  3541. }
  3542. get firstElementChild() {
  3543. const esValue = this !== null && this !== undefined ? this : globalObject;
  3544. if (!exports.is(esValue)) {
  3545. throw new globalObject.TypeError(
  3546. "'get firstElementChild' called on an object that is not a valid instance of Document."
  3547. );
  3548. }
  3549. return utils.tryWrapperForImpl(esValue[implSymbol]["firstElementChild"]);
  3550. }
  3551. get lastElementChild() {
  3552. const esValue = this !== null && this !== undefined ? this : globalObject;
  3553. if (!exports.is(esValue)) {
  3554. throw new globalObject.TypeError(
  3555. "'get lastElementChild' called on an object that is not a valid instance of Document."
  3556. );
  3557. }
  3558. return utils.tryWrapperForImpl(esValue[implSymbol]["lastElementChild"]);
  3559. }
  3560. get childElementCount() {
  3561. const esValue = this !== null && this !== undefined ? this : globalObject;
  3562. if (!exports.is(esValue)) {
  3563. throw new globalObject.TypeError(
  3564. "'get childElementCount' called on an object that is not a valid instance of Document."
  3565. );
  3566. }
  3567. return esValue[implSymbol]["childElementCount"];
  3568. }
  3569. }
  3570. Object.defineProperties(Document.prototype, {
  3571. getElementsByTagName: { enumerable: true },
  3572. getElementsByTagNameNS: { enumerable: true },
  3573. getElementsByClassName: { enumerable: true },
  3574. createElement: { enumerable: true },
  3575. createElementNS: { enumerable: true },
  3576. createDocumentFragment: { enumerable: true },
  3577. createTextNode: { enumerable: true },
  3578. createCDATASection: { enumerable: true },
  3579. createComment: { enumerable: true },
  3580. createProcessingInstruction: { enumerable: true },
  3581. importNode: { enumerable: true },
  3582. adoptNode: { enumerable: true },
  3583. createAttribute: { enumerable: true },
  3584. createAttributeNS: { enumerable: true },
  3585. createEvent: { enumerable: true },
  3586. createRange: { enumerable: true },
  3587. createNodeIterator: { enumerable: true },
  3588. createTreeWalker: { enumerable: true },
  3589. getElementsByName: { enumerable: true },
  3590. open: { enumerable: true },
  3591. close: { enumerable: true },
  3592. write: { enumerable: true },
  3593. writeln: { enumerable: true },
  3594. hasFocus: { enumerable: true },
  3595. clear: { enumerable: true },
  3596. captureEvents: { enumerable: true },
  3597. releaseEvents: { enumerable: true },
  3598. getSelection: { enumerable: true },
  3599. getElementById: { enumerable: true },
  3600. prepend: { enumerable: true },
  3601. append: { enumerable: true },
  3602. replaceChildren: { enumerable: true },
  3603. querySelector: { enumerable: true },
  3604. querySelectorAll: { enumerable: true },
  3605. implementation: { enumerable: true },
  3606. URL: { enumerable: true },
  3607. documentURI: { enumerable: true },
  3608. compatMode: { enumerable: true },
  3609. characterSet: { enumerable: true },
  3610. charset: { enumerable: true },
  3611. inputEncoding: { enumerable: true },
  3612. contentType: { enumerable: true },
  3613. doctype: { enumerable: true },
  3614. documentElement: { enumerable: true },
  3615. referrer: { enumerable: true },
  3616. cookie: { enumerable: true },
  3617. lastModified: { enumerable: true },
  3618. readyState: { enumerable: true },
  3619. title: { enumerable: true },
  3620. dir: { enumerable: true },
  3621. body: { enumerable: true },
  3622. head: { enumerable: true },
  3623. images: { enumerable: true },
  3624. embeds: { enumerable: true },
  3625. plugins: { enumerable: true },
  3626. links: { enumerable: true },
  3627. forms: { enumerable: true },
  3628. scripts: { enumerable: true },
  3629. currentScript: { enumerable: true },
  3630. defaultView: { enumerable: true },
  3631. onreadystatechange: { enumerable: true },
  3632. anchors: { enumerable: true },
  3633. applets: { enumerable: true },
  3634. styleSheets: { enumerable: true },
  3635. hidden: { enumerable: true },
  3636. visibilityState: { enumerable: true },
  3637. onvisibilitychange: { enumerable: true },
  3638. onabort: { enumerable: true },
  3639. onauxclick: { enumerable: true },
  3640. onbeforeinput: { enumerable: true },
  3641. onbeforematch: { enumerable: true },
  3642. onbeforetoggle: { enumerable: true },
  3643. onblur: { enumerable: true },
  3644. oncancel: { enumerable: true },
  3645. oncanplay: { enumerable: true },
  3646. oncanplaythrough: { enumerable: true },
  3647. onchange: { enumerable: true },
  3648. onclick: { enumerable: true },
  3649. onclose: { enumerable: true },
  3650. oncontextlost: { enumerable: true },
  3651. oncontextmenu: { enumerable: true },
  3652. oncontextrestored: { enumerable: true },
  3653. oncopy: { enumerable: true },
  3654. oncuechange: { enumerable: true },
  3655. oncut: { enumerable: true },
  3656. ondblclick: { enumerable: true },
  3657. ondrag: { enumerable: true },
  3658. ondragend: { enumerable: true },
  3659. ondragenter: { enumerable: true },
  3660. ondragleave: { enumerable: true },
  3661. ondragover: { enumerable: true },
  3662. ondragstart: { enumerable: true },
  3663. ondrop: { enumerable: true },
  3664. ondurationchange: { enumerable: true },
  3665. onemptied: { enumerable: true },
  3666. onended: { enumerable: true },
  3667. onerror: { enumerable: true },
  3668. onfocus: { enumerable: true },
  3669. onformdata: { enumerable: true },
  3670. oninput: { enumerable: true },
  3671. oninvalid: { enumerable: true },
  3672. onkeydown: { enumerable: true },
  3673. onkeypress: { enumerable: true },
  3674. onkeyup: { enumerable: true },
  3675. onload: { enumerable: true },
  3676. onloadeddata: { enumerable: true },
  3677. onloadedmetadata: { enumerable: true },
  3678. onloadstart: { enumerable: true },
  3679. onmousedown: { enumerable: true },
  3680. onmouseenter: { enumerable: true },
  3681. onmouseleave: { enumerable: true },
  3682. onmousemove: { enumerable: true },
  3683. onmouseout: { enumerable: true },
  3684. onmouseover: { enumerable: true },
  3685. onmouseup: { enumerable: true },
  3686. onpaste: { enumerable: true },
  3687. onpause: { enumerable: true },
  3688. onplay: { enumerable: true },
  3689. onplaying: { enumerable: true },
  3690. onprogress: { enumerable: true },
  3691. onratechange: { enumerable: true },
  3692. onreset: { enumerable: true },
  3693. onresize: { enumerable: true },
  3694. onscroll: { enumerable: true },
  3695. onscrollend: { enumerable: true },
  3696. onsecuritypolicyviolation: { enumerable: true },
  3697. onseeked: { enumerable: true },
  3698. onseeking: { enumerable: true },
  3699. onselect: { enumerable: true },
  3700. onslotchange: { enumerable: true },
  3701. onstalled: { enumerable: true },
  3702. onsubmit: { enumerable: true },
  3703. onsuspend: { enumerable: true },
  3704. ontimeupdate: { enumerable: true },
  3705. ontoggle: { enumerable: true },
  3706. onvolumechange: { enumerable: true },
  3707. onwaiting: { enumerable: true },
  3708. onwebkitanimationend: { enumerable: true },
  3709. onwebkitanimationiteration: { enumerable: true },
  3710. onwebkitanimationstart: { enumerable: true },
  3711. onwebkittransitionend: { enumerable: true },
  3712. onwheel: { enumerable: true },
  3713. ontouchstart: { enumerable: true },
  3714. ontouchend: { enumerable: true },
  3715. ontouchmove: { enumerable: true },
  3716. ontouchcancel: { enumerable: true },
  3717. onpointerover: { enumerable: true },
  3718. onpointerenter: { enumerable: true },
  3719. onpointerdown: { enumerable: true },
  3720. onpointermove: { enumerable: true },
  3721. onpointerrawupdate: { enumerable: true },
  3722. onpointerup: { enumerable: true },
  3723. onpointercancel: { enumerable: true },
  3724. onpointerout: { enumerable: true },
  3725. onpointerleave: { enumerable: true },
  3726. ongotpointercapture: { enumerable: true },
  3727. onlostpointercapture: { enumerable: true },
  3728. activeElement: { enumerable: true },
  3729. children: { enumerable: true },
  3730. firstElementChild: { enumerable: true },
  3731. lastElementChild: { enumerable: true },
  3732. childElementCount: { enumerable: true },
  3733. [Symbol.toStringTag]: { value: "Document", configurable: true },
  3734. [Symbol.unscopables]: {
  3735. value: { prepend: true, append: true, replaceChildren: true, __proto__: null },
  3736. configurable: true
  3737. }
  3738. });
  3739. ctorRegistry[interfaceName] = Document;
  3740. Object.defineProperty(globalObject, interfaceName, {
  3741. configurable: true,
  3742. writable: true,
  3743. value: Document
  3744. });
  3745. };
  3746. const Impl = require("../../jsdom/living/nodes/Document-impl.js");