HTMLAreaElement.js 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825
  1. "use strict";
  2. const conversions = require("webidl-conversions");
  3. const utils = require("./utils.js");
  4. const HTMLConstructor_jsdom_living_helpers_html_constructor =
  5. require("../../jsdom/living/helpers/html-constructor.js").HTMLConstructor;
  6. const ceReactionsPreSteps_jsdom_living_helpers_custom_elements =
  7. require("../../jsdom/living/helpers/custom-elements.js").ceReactionsPreSteps;
  8. const ceReactionsPostSteps_jsdom_living_helpers_custom_elements =
  9. require("../../jsdom/living/helpers/custom-elements.js").ceReactionsPostSteps;
  10. const implSymbol = utils.implSymbol;
  11. const ctorRegistrySymbol = utils.ctorRegistrySymbol;
  12. const HTMLElement = require("./HTMLElement.js");
  13. const interfaceName = "HTMLAreaElement";
  14. exports.is = value => {
  15. return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation;
  16. };
  17. exports.isImpl = value => {
  18. return utils.isObject(value) && value instanceof Impl.implementation;
  19. };
  20. exports.convert = (globalObject, value, { context = "The provided value" } = {}) => {
  21. if (exports.is(value)) {
  22. return utils.implForWrapper(value);
  23. }
  24. throw new globalObject.TypeError(`${context} is not of type 'HTMLAreaElement'.`);
  25. };
  26. function makeWrapper(globalObject, newTarget) {
  27. let proto;
  28. if (newTarget !== undefined) {
  29. proto = newTarget.prototype;
  30. }
  31. if (!utils.isObject(proto)) {
  32. proto = globalObject[ctorRegistrySymbol]["HTMLAreaElement"].prototype;
  33. }
  34. return Object.create(proto);
  35. }
  36. exports.create = (globalObject, constructorArgs, privateData) => {
  37. const wrapper = makeWrapper(globalObject);
  38. return exports.setup(wrapper, globalObject, constructorArgs, privateData);
  39. };
  40. exports.createImpl = (globalObject, constructorArgs, privateData) => {
  41. const wrapper = exports.create(globalObject, constructorArgs, privateData);
  42. return utils.implForWrapper(wrapper);
  43. };
  44. exports._internalSetup = (wrapper, globalObject) => {
  45. HTMLElement._internalSetup(wrapper, globalObject);
  46. };
  47. exports.setup = (wrapper, globalObject, constructorArgs = [], privateData = {}) => {
  48. privateData.wrapper = wrapper;
  49. exports._internalSetup(wrapper, globalObject);
  50. Object.defineProperty(wrapper, implSymbol, {
  51. value: new Impl.implementation(globalObject, constructorArgs, privateData),
  52. configurable: true
  53. });
  54. wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
  55. if (Impl.init) {
  56. Impl.init(wrapper[implSymbol]);
  57. }
  58. return wrapper;
  59. };
  60. exports.new = (globalObject, newTarget) => {
  61. const wrapper = makeWrapper(globalObject, newTarget);
  62. exports._internalSetup(wrapper, globalObject);
  63. Object.defineProperty(wrapper, implSymbol, {
  64. value: Object.create(Impl.implementation.prototype),
  65. configurable: true
  66. });
  67. wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
  68. if (Impl.init) {
  69. Impl.init(wrapper[implSymbol]);
  70. }
  71. return wrapper[implSymbol];
  72. };
  73. const exposed = new Set(["Window"]);
  74. exports.install = (globalObject, globalNames) => {
  75. if (!globalNames.some(globalName => exposed.has(globalName))) {
  76. return;
  77. }
  78. const ctorRegistry = utils.initCtorRegistry(globalObject);
  79. class HTMLAreaElement extends globalObject.HTMLElement {
  80. constructor() {
  81. return HTMLConstructor_jsdom_living_helpers_html_constructor(globalObject, interfaceName, new.target);
  82. }
  83. get alt() {
  84. const esValue = this !== null && this !== undefined ? this : globalObject;
  85. if (!exports.is(esValue)) {
  86. throw new globalObject.TypeError(
  87. "'get alt' called on an object that is not a valid instance of HTMLAreaElement."
  88. );
  89. }
  90. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  91. try {
  92. const value = esValue[implSymbol]._reflectGetTheContentAttribute("alt");
  93. return value === null ? "" : value;
  94. } finally {
  95. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  96. }
  97. }
  98. set alt(V) {
  99. const esValue = this !== null && this !== undefined ? this : globalObject;
  100. if (!exports.is(esValue)) {
  101. throw new globalObject.TypeError(
  102. "'set alt' called on an object that is not a valid instance of HTMLAreaElement."
  103. );
  104. }
  105. V = conversions["DOMString"](V, {
  106. context: "Failed to set the 'alt' property on 'HTMLAreaElement': The provided value",
  107. globals: globalObject
  108. });
  109. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  110. try {
  111. esValue[implSymbol]._reflectSetTheContentAttribute("alt", V);
  112. } finally {
  113. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  114. }
  115. }
  116. get coords() {
  117. const esValue = this !== null && this !== undefined ? this : globalObject;
  118. if (!exports.is(esValue)) {
  119. throw new globalObject.TypeError(
  120. "'get coords' called on an object that is not a valid instance of HTMLAreaElement."
  121. );
  122. }
  123. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  124. try {
  125. const value = esValue[implSymbol]._reflectGetTheContentAttribute("coords");
  126. return value === null ? "" : value;
  127. } finally {
  128. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  129. }
  130. }
  131. set coords(V) {
  132. const esValue = this !== null && this !== undefined ? this : globalObject;
  133. if (!exports.is(esValue)) {
  134. throw new globalObject.TypeError(
  135. "'set coords' called on an object that is not a valid instance of HTMLAreaElement."
  136. );
  137. }
  138. V = conversions["DOMString"](V, {
  139. context: "Failed to set the 'coords' property on 'HTMLAreaElement': The provided value",
  140. globals: globalObject
  141. });
  142. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  143. try {
  144. esValue[implSymbol]._reflectSetTheContentAttribute("coords", V);
  145. } finally {
  146. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  147. }
  148. }
  149. get shape() {
  150. const esValue = this !== null && this !== undefined ? this : globalObject;
  151. if (!exports.is(esValue)) {
  152. throw new globalObject.TypeError(
  153. "'get shape' called on an object that is not a valid instance of HTMLAreaElement."
  154. );
  155. }
  156. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  157. try {
  158. const value = esValue[implSymbol]._reflectGetTheContentAttribute("shape");
  159. return value === null ? "" : value;
  160. } finally {
  161. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  162. }
  163. }
  164. set shape(V) {
  165. const esValue = this !== null && this !== undefined ? this : globalObject;
  166. if (!exports.is(esValue)) {
  167. throw new globalObject.TypeError(
  168. "'set shape' called on an object that is not a valid instance of HTMLAreaElement."
  169. );
  170. }
  171. V = conversions["DOMString"](V, {
  172. context: "Failed to set the 'shape' property on 'HTMLAreaElement': The provided value",
  173. globals: globalObject
  174. });
  175. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  176. try {
  177. esValue[implSymbol]._reflectSetTheContentAttribute("shape", V);
  178. } finally {
  179. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  180. }
  181. }
  182. get target() {
  183. const esValue = this !== null && this !== undefined ? this : globalObject;
  184. if (!exports.is(esValue)) {
  185. throw new globalObject.TypeError(
  186. "'get target' called on an object that is not a valid instance of HTMLAreaElement."
  187. );
  188. }
  189. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  190. try {
  191. const value = esValue[implSymbol]._reflectGetTheContentAttribute("target");
  192. return value === null ? "" : value;
  193. } finally {
  194. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  195. }
  196. }
  197. set target(V) {
  198. const esValue = this !== null && this !== undefined ? this : globalObject;
  199. if (!exports.is(esValue)) {
  200. throw new globalObject.TypeError(
  201. "'set target' called on an object that is not a valid instance of HTMLAreaElement."
  202. );
  203. }
  204. V = conversions["DOMString"](V, {
  205. context: "Failed to set the 'target' property on 'HTMLAreaElement': The provided value",
  206. globals: globalObject
  207. });
  208. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  209. try {
  210. esValue[implSymbol]._reflectSetTheContentAttribute("target", V);
  211. } finally {
  212. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  213. }
  214. }
  215. get rel() {
  216. const esValue = this !== null && this !== undefined ? this : globalObject;
  217. if (!exports.is(esValue)) {
  218. throw new globalObject.TypeError(
  219. "'get rel' called on an object that is not a valid instance of HTMLAreaElement."
  220. );
  221. }
  222. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  223. try {
  224. const value = esValue[implSymbol]._reflectGetTheContentAttribute("rel");
  225. return value === null ? "" : value;
  226. } finally {
  227. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  228. }
  229. }
  230. set rel(V) {
  231. const esValue = this !== null && this !== undefined ? this : globalObject;
  232. if (!exports.is(esValue)) {
  233. throw new globalObject.TypeError(
  234. "'set rel' called on an object that is not a valid instance of HTMLAreaElement."
  235. );
  236. }
  237. V = conversions["DOMString"](V, {
  238. context: "Failed to set the 'rel' property on 'HTMLAreaElement': The provided value",
  239. globals: globalObject
  240. });
  241. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  242. try {
  243. esValue[implSymbol]._reflectSetTheContentAttribute("rel", V);
  244. } finally {
  245. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  246. }
  247. }
  248. get relList() {
  249. const esValue = this !== null && this !== undefined ? this : globalObject;
  250. if (!exports.is(esValue)) {
  251. throw new globalObject.TypeError(
  252. "'get relList' called on an object that is not a valid instance of HTMLAreaElement."
  253. );
  254. }
  255. return utils.getSameObject(this, "relList", () => {
  256. return utils.tryWrapperForImpl(esValue[implSymbol]["relList"]);
  257. });
  258. }
  259. set relList(V) {
  260. const esValue = this !== null && this !== undefined ? this : globalObject;
  261. if (!exports.is(esValue)) {
  262. throw new globalObject.TypeError(
  263. "'set relList' called on an object that is not a valid instance of HTMLAreaElement."
  264. );
  265. }
  266. const Q = esValue["relList"];
  267. if (!utils.isObject(Q)) {
  268. throw new globalObject.TypeError("Property 'relList' is not an object");
  269. }
  270. Reflect.set(Q, "value", V);
  271. }
  272. get noHref() {
  273. const esValue = this !== null && this !== undefined ? this : globalObject;
  274. if (!exports.is(esValue)) {
  275. throw new globalObject.TypeError(
  276. "'get noHref' called on an object that is not a valid instance of HTMLAreaElement."
  277. );
  278. }
  279. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  280. try {
  281. return esValue[implSymbol]._reflectGetTheContentAttribute("nohref") !== null;
  282. } finally {
  283. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  284. }
  285. }
  286. set noHref(V) {
  287. const esValue = this !== null && this !== undefined ? this : globalObject;
  288. if (!exports.is(esValue)) {
  289. throw new globalObject.TypeError(
  290. "'set noHref' called on an object that is not a valid instance of HTMLAreaElement."
  291. );
  292. }
  293. V = conversions["boolean"](V, {
  294. context: "Failed to set the 'noHref' property on 'HTMLAreaElement': The provided value",
  295. globals: globalObject
  296. });
  297. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  298. try {
  299. if (V) {
  300. esValue[implSymbol]._reflectSetTheContentAttribute("nohref", "");
  301. } else {
  302. esValue[implSymbol]._reflectDeleteTheContentAttribute("nohref");
  303. }
  304. } finally {
  305. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  306. }
  307. }
  308. get href() {
  309. const esValue = this !== null && this !== undefined ? this : globalObject;
  310. if (!exports.is(esValue)) {
  311. throw new globalObject.TypeError(
  312. "'get href' called on an object that is not a valid instance of HTMLAreaElement."
  313. );
  314. }
  315. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  316. try {
  317. return esValue[implSymbol]["href"];
  318. } finally {
  319. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  320. }
  321. }
  322. set href(V) {
  323. const esValue = this !== null && this !== undefined ? this : globalObject;
  324. if (!exports.is(esValue)) {
  325. throw new globalObject.TypeError(
  326. "'set href' called on an object that is not a valid instance of HTMLAreaElement."
  327. );
  328. }
  329. V = conversions["USVString"](V, {
  330. context: "Failed to set the 'href' property on 'HTMLAreaElement': The provided value",
  331. globals: globalObject
  332. });
  333. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  334. try {
  335. esValue[implSymbol]["href"] = V;
  336. } finally {
  337. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  338. }
  339. }
  340. toString() {
  341. const esValue = this;
  342. if (!exports.is(esValue)) {
  343. throw new globalObject.TypeError(
  344. "'toString' called on an object that is not a valid instance of HTMLAreaElement."
  345. );
  346. }
  347. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  348. try {
  349. return esValue[implSymbol]["href"];
  350. } finally {
  351. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  352. }
  353. }
  354. get origin() {
  355. const esValue = this !== null && this !== undefined ? this : globalObject;
  356. if (!exports.is(esValue)) {
  357. throw new globalObject.TypeError(
  358. "'get origin' called on an object that is not a valid instance of HTMLAreaElement."
  359. );
  360. }
  361. return esValue[implSymbol]["origin"];
  362. }
  363. get protocol() {
  364. const esValue = this !== null && this !== undefined ? this : globalObject;
  365. if (!exports.is(esValue)) {
  366. throw new globalObject.TypeError(
  367. "'get protocol' called on an object that is not a valid instance of HTMLAreaElement."
  368. );
  369. }
  370. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  371. try {
  372. return esValue[implSymbol]["protocol"];
  373. } finally {
  374. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  375. }
  376. }
  377. set protocol(V) {
  378. const esValue = this !== null && this !== undefined ? this : globalObject;
  379. if (!exports.is(esValue)) {
  380. throw new globalObject.TypeError(
  381. "'set protocol' called on an object that is not a valid instance of HTMLAreaElement."
  382. );
  383. }
  384. V = conversions["USVString"](V, {
  385. context: "Failed to set the 'protocol' property on 'HTMLAreaElement': The provided value",
  386. globals: globalObject
  387. });
  388. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  389. try {
  390. esValue[implSymbol]["protocol"] = V;
  391. } finally {
  392. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  393. }
  394. }
  395. get username() {
  396. const esValue = this !== null && this !== undefined ? this : globalObject;
  397. if (!exports.is(esValue)) {
  398. throw new globalObject.TypeError(
  399. "'get username' called on an object that is not a valid instance of HTMLAreaElement."
  400. );
  401. }
  402. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  403. try {
  404. return esValue[implSymbol]["username"];
  405. } finally {
  406. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  407. }
  408. }
  409. set username(V) {
  410. const esValue = this !== null && this !== undefined ? this : globalObject;
  411. if (!exports.is(esValue)) {
  412. throw new globalObject.TypeError(
  413. "'set username' called on an object that is not a valid instance of HTMLAreaElement."
  414. );
  415. }
  416. V = conversions["USVString"](V, {
  417. context: "Failed to set the 'username' property on 'HTMLAreaElement': The provided value",
  418. globals: globalObject
  419. });
  420. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  421. try {
  422. esValue[implSymbol]["username"] = V;
  423. } finally {
  424. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  425. }
  426. }
  427. get password() {
  428. const esValue = this !== null && this !== undefined ? this : globalObject;
  429. if (!exports.is(esValue)) {
  430. throw new globalObject.TypeError(
  431. "'get password' called on an object that is not a valid instance of HTMLAreaElement."
  432. );
  433. }
  434. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  435. try {
  436. return esValue[implSymbol]["password"];
  437. } finally {
  438. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  439. }
  440. }
  441. set password(V) {
  442. const esValue = this !== null && this !== undefined ? this : globalObject;
  443. if (!exports.is(esValue)) {
  444. throw new globalObject.TypeError(
  445. "'set password' called on an object that is not a valid instance of HTMLAreaElement."
  446. );
  447. }
  448. V = conversions["USVString"](V, {
  449. context: "Failed to set the 'password' property on 'HTMLAreaElement': The provided value",
  450. globals: globalObject
  451. });
  452. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  453. try {
  454. esValue[implSymbol]["password"] = V;
  455. } finally {
  456. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  457. }
  458. }
  459. get host() {
  460. const esValue = this !== null && this !== undefined ? this : globalObject;
  461. if (!exports.is(esValue)) {
  462. throw new globalObject.TypeError(
  463. "'get host' called on an object that is not a valid instance of HTMLAreaElement."
  464. );
  465. }
  466. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  467. try {
  468. return esValue[implSymbol]["host"];
  469. } finally {
  470. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  471. }
  472. }
  473. set host(V) {
  474. const esValue = this !== null && this !== undefined ? this : globalObject;
  475. if (!exports.is(esValue)) {
  476. throw new globalObject.TypeError(
  477. "'set host' called on an object that is not a valid instance of HTMLAreaElement."
  478. );
  479. }
  480. V = conversions["USVString"](V, {
  481. context: "Failed to set the 'host' property on 'HTMLAreaElement': The provided value",
  482. globals: globalObject
  483. });
  484. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  485. try {
  486. esValue[implSymbol]["host"] = V;
  487. } finally {
  488. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  489. }
  490. }
  491. get hostname() {
  492. const esValue = this !== null && this !== undefined ? this : globalObject;
  493. if (!exports.is(esValue)) {
  494. throw new globalObject.TypeError(
  495. "'get hostname' called on an object that is not a valid instance of HTMLAreaElement."
  496. );
  497. }
  498. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  499. try {
  500. return esValue[implSymbol]["hostname"];
  501. } finally {
  502. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  503. }
  504. }
  505. set hostname(V) {
  506. const esValue = this !== null && this !== undefined ? this : globalObject;
  507. if (!exports.is(esValue)) {
  508. throw new globalObject.TypeError(
  509. "'set hostname' called on an object that is not a valid instance of HTMLAreaElement."
  510. );
  511. }
  512. V = conversions["USVString"](V, {
  513. context: "Failed to set the 'hostname' property on 'HTMLAreaElement': The provided value",
  514. globals: globalObject
  515. });
  516. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  517. try {
  518. esValue[implSymbol]["hostname"] = V;
  519. } finally {
  520. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  521. }
  522. }
  523. get port() {
  524. const esValue = this !== null && this !== undefined ? this : globalObject;
  525. if (!exports.is(esValue)) {
  526. throw new globalObject.TypeError(
  527. "'get port' called on an object that is not a valid instance of HTMLAreaElement."
  528. );
  529. }
  530. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  531. try {
  532. return esValue[implSymbol]["port"];
  533. } finally {
  534. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  535. }
  536. }
  537. set port(V) {
  538. const esValue = this !== null && this !== undefined ? this : globalObject;
  539. if (!exports.is(esValue)) {
  540. throw new globalObject.TypeError(
  541. "'set port' called on an object that is not a valid instance of HTMLAreaElement."
  542. );
  543. }
  544. V = conversions["USVString"](V, {
  545. context: "Failed to set the 'port' property on 'HTMLAreaElement': The provided value",
  546. globals: globalObject
  547. });
  548. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  549. try {
  550. esValue[implSymbol]["port"] = V;
  551. } finally {
  552. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  553. }
  554. }
  555. get pathname() {
  556. const esValue = this !== null && this !== undefined ? this : globalObject;
  557. if (!exports.is(esValue)) {
  558. throw new globalObject.TypeError(
  559. "'get pathname' called on an object that is not a valid instance of HTMLAreaElement."
  560. );
  561. }
  562. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  563. try {
  564. return esValue[implSymbol]["pathname"];
  565. } finally {
  566. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  567. }
  568. }
  569. set pathname(V) {
  570. const esValue = this !== null && this !== undefined ? this : globalObject;
  571. if (!exports.is(esValue)) {
  572. throw new globalObject.TypeError(
  573. "'set pathname' called on an object that is not a valid instance of HTMLAreaElement."
  574. );
  575. }
  576. V = conversions["USVString"](V, {
  577. context: "Failed to set the 'pathname' property on 'HTMLAreaElement': The provided value",
  578. globals: globalObject
  579. });
  580. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  581. try {
  582. esValue[implSymbol]["pathname"] = V;
  583. } finally {
  584. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  585. }
  586. }
  587. get search() {
  588. const esValue = this !== null && this !== undefined ? this : globalObject;
  589. if (!exports.is(esValue)) {
  590. throw new globalObject.TypeError(
  591. "'get search' called on an object that is not a valid instance of HTMLAreaElement."
  592. );
  593. }
  594. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  595. try {
  596. return esValue[implSymbol]["search"];
  597. } finally {
  598. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  599. }
  600. }
  601. set search(V) {
  602. const esValue = this !== null && this !== undefined ? this : globalObject;
  603. if (!exports.is(esValue)) {
  604. throw new globalObject.TypeError(
  605. "'set search' called on an object that is not a valid instance of HTMLAreaElement."
  606. );
  607. }
  608. V = conversions["USVString"](V, {
  609. context: "Failed to set the 'search' property on 'HTMLAreaElement': The provided value",
  610. globals: globalObject
  611. });
  612. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  613. try {
  614. esValue[implSymbol]["search"] = V;
  615. } finally {
  616. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  617. }
  618. }
  619. get hash() {
  620. const esValue = this !== null && this !== undefined ? this : globalObject;
  621. if (!exports.is(esValue)) {
  622. throw new globalObject.TypeError(
  623. "'get hash' called on an object that is not a valid instance of HTMLAreaElement."
  624. );
  625. }
  626. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  627. try {
  628. return esValue[implSymbol]["hash"];
  629. } finally {
  630. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  631. }
  632. }
  633. set hash(V) {
  634. const esValue = this !== null && this !== undefined ? this : globalObject;
  635. if (!exports.is(esValue)) {
  636. throw new globalObject.TypeError(
  637. "'set hash' called on an object that is not a valid instance of HTMLAreaElement."
  638. );
  639. }
  640. V = conversions["USVString"](V, {
  641. context: "Failed to set the 'hash' property on 'HTMLAreaElement': The provided value",
  642. globals: globalObject
  643. });
  644. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  645. try {
  646. esValue[implSymbol]["hash"] = V;
  647. } finally {
  648. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  649. }
  650. }
  651. }
  652. Object.defineProperties(HTMLAreaElement.prototype, {
  653. alt: { enumerable: true },
  654. coords: { enumerable: true },
  655. shape: { enumerable: true },
  656. target: { enumerable: true },
  657. rel: { enumerable: true },
  658. relList: { enumerable: true },
  659. noHref: { enumerable: true },
  660. href: { enumerable: true },
  661. toString: { enumerable: true },
  662. origin: { enumerable: true },
  663. protocol: { enumerable: true },
  664. username: { enumerable: true },
  665. password: { enumerable: true },
  666. host: { enumerable: true },
  667. hostname: { enumerable: true },
  668. port: { enumerable: true },
  669. pathname: { enumerable: true },
  670. search: { enumerable: true },
  671. hash: { enumerable: true },
  672. [Symbol.toStringTag]: { value: "HTMLAreaElement", configurable: true }
  673. });
  674. ctorRegistry[interfaceName] = HTMLAreaElement;
  675. Object.defineProperty(globalObject, interfaceName, {
  676. configurable: true,
  677. writable: true,
  678. value: HTMLAreaElement
  679. });
  680. };
  681. const Impl = require("../../jsdom/living/nodes/HTMLAreaElement-impl.js");