HTMLIFrameElement.js 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689
  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 serializeURLwhatwg_url = require("whatwg-url").serializeURL;
  7. const ceReactionsPreSteps_jsdom_living_helpers_custom_elements =
  8. require("../../jsdom/living/helpers/custom-elements.js").ceReactionsPreSteps;
  9. const ceReactionsPostSteps_jsdom_living_helpers_custom_elements =
  10. require("../../jsdom/living/helpers/custom-elements.js").ceReactionsPostSteps;
  11. const implSymbol = utils.implSymbol;
  12. const ctorRegistrySymbol = utils.ctorRegistrySymbol;
  13. const HTMLElement = require("./HTMLElement.js");
  14. const interfaceName = "HTMLIFrameElement";
  15. exports.is = value => {
  16. return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation;
  17. };
  18. exports.isImpl = value => {
  19. return utils.isObject(value) && value instanceof Impl.implementation;
  20. };
  21. exports.convert = (globalObject, value, { context = "The provided value" } = {}) => {
  22. if (exports.is(value)) {
  23. return utils.implForWrapper(value);
  24. }
  25. throw new globalObject.TypeError(`${context} is not of type 'HTMLIFrameElement'.`);
  26. };
  27. function makeWrapper(globalObject, newTarget) {
  28. let proto;
  29. if (newTarget !== undefined) {
  30. proto = newTarget.prototype;
  31. }
  32. if (!utils.isObject(proto)) {
  33. proto = globalObject[ctorRegistrySymbol]["HTMLIFrameElement"].prototype;
  34. }
  35. return Object.create(proto);
  36. }
  37. exports.create = (globalObject, constructorArgs, privateData) => {
  38. const wrapper = makeWrapper(globalObject);
  39. return exports.setup(wrapper, globalObject, constructorArgs, privateData);
  40. };
  41. exports.createImpl = (globalObject, constructorArgs, privateData) => {
  42. const wrapper = exports.create(globalObject, constructorArgs, privateData);
  43. return utils.implForWrapper(wrapper);
  44. };
  45. exports._internalSetup = (wrapper, globalObject) => {
  46. HTMLElement._internalSetup(wrapper, globalObject);
  47. };
  48. exports.setup = (wrapper, globalObject, constructorArgs = [], privateData = {}) => {
  49. privateData.wrapper = wrapper;
  50. exports._internalSetup(wrapper, globalObject);
  51. Object.defineProperty(wrapper, implSymbol, {
  52. value: new Impl.implementation(globalObject, constructorArgs, privateData),
  53. configurable: true
  54. });
  55. wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
  56. if (Impl.init) {
  57. Impl.init(wrapper[implSymbol]);
  58. }
  59. return wrapper;
  60. };
  61. exports.new = (globalObject, newTarget) => {
  62. const wrapper = makeWrapper(globalObject, newTarget);
  63. exports._internalSetup(wrapper, globalObject);
  64. Object.defineProperty(wrapper, implSymbol, {
  65. value: Object.create(Impl.implementation.prototype),
  66. configurable: true
  67. });
  68. wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
  69. if (Impl.init) {
  70. Impl.init(wrapper[implSymbol]);
  71. }
  72. return wrapper[implSymbol];
  73. };
  74. const exposed = new Set(["Window"]);
  75. exports.install = (globalObject, globalNames) => {
  76. if (!globalNames.some(globalName => exposed.has(globalName))) {
  77. return;
  78. }
  79. const ctorRegistry = utils.initCtorRegistry(globalObject);
  80. class HTMLIFrameElement extends globalObject.HTMLElement {
  81. constructor() {
  82. return HTMLConstructor_jsdom_living_helpers_html_constructor(globalObject, interfaceName, new.target);
  83. }
  84. getSVGDocument() {
  85. const esValue = this !== null && this !== undefined ? this : globalObject;
  86. if (!exports.is(esValue)) {
  87. throw new globalObject.TypeError(
  88. "'getSVGDocument' called on an object that is not a valid instance of HTMLIFrameElement."
  89. );
  90. }
  91. return utils.tryWrapperForImpl(esValue[implSymbol].getSVGDocument());
  92. }
  93. get src() {
  94. const esValue = this !== null && this !== undefined ? this : globalObject;
  95. if (!exports.is(esValue)) {
  96. throw new globalObject.TypeError(
  97. "'get src' called on an object that is not a valid instance of HTMLIFrameElement."
  98. );
  99. }
  100. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  101. try {
  102. const impl = esValue[implSymbol];
  103. const value = impl._reflectGetTheContentAttribute("src");
  104. if (value === null) {
  105. return "";
  106. }
  107. const document = impl._ownerDocument;
  108. if (this._srcURLCacheKey === value && this._baseURLCache === document._baseURLCache) {
  109. return this._srcURLCache;
  110. }
  111. this._srcURLCacheKey = value;
  112. this._baseURLCache = document._baseURLCache;
  113. const urlRecord = document.encodingParseAURL(value);
  114. if (urlRecord !== null) {
  115. this._srcURLCache = serializeURLwhatwg_url(urlRecord);
  116. return this._srcURLCache;
  117. }
  118. this._srcURLCache = conversions.USVString(value);
  119. return this._srcURLCache;
  120. } finally {
  121. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  122. }
  123. }
  124. set src(V) {
  125. const esValue = this !== null && this !== undefined ? this : globalObject;
  126. if (!exports.is(esValue)) {
  127. throw new globalObject.TypeError(
  128. "'set src' called on an object that is not a valid instance of HTMLIFrameElement."
  129. );
  130. }
  131. V = conversions["USVString"](V, {
  132. context: "Failed to set the 'src' property on 'HTMLIFrameElement': The provided value",
  133. globals: globalObject
  134. });
  135. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  136. try {
  137. esValue[implSymbol]._reflectSetTheContentAttribute("src", V);
  138. } finally {
  139. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  140. }
  141. }
  142. get srcdoc() {
  143. const esValue = this !== null && this !== undefined ? this : globalObject;
  144. if (!exports.is(esValue)) {
  145. throw new globalObject.TypeError(
  146. "'get srcdoc' called on an object that is not a valid instance of HTMLIFrameElement."
  147. );
  148. }
  149. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  150. try {
  151. const value = esValue[implSymbol]._reflectGetTheContentAttribute("srcdoc");
  152. return value === null ? "" : value;
  153. } finally {
  154. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  155. }
  156. }
  157. set srcdoc(V) {
  158. const esValue = this !== null && this !== undefined ? this : globalObject;
  159. if (!exports.is(esValue)) {
  160. throw new globalObject.TypeError(
  161. "'set srcdoc' called on an object that is not a valid instance of HTMLIFrameElement."
  162. );
  163. }
  164. V = conversions["DOMString"](V, {
  165. context: "Failed to set the 'srcdoc' property on 'HTMLIFrameElement': The provided value",
  166. globals: globalObject
  167. });
  168. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  169. try {
  170. esValue[implSymbol]._reflectSetTheContentAttribute("srcdoc", V);
  171. } finally {
  172. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  173. }
  174. }
  175. get name() {
  176. const esValue = this !== null && this !== undefined ? this : globalObject;
  177. if (!exports.is(esValue)) {
  178. throw new globalObject.TypeError(
  179. "'get name' called on an object that is not a valid instance of HTMLIFrameElement."
  180. );
  181. }
  182. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  183. try {
  184. const value = esValue[implSymbol]._reflectGetTheContentAttribute("name");
  185. return value === null ? "" : value;
  186. } finally {
  187. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  188. }
  189. }
  190. set name(V) {
  191. const esValue = this !== null && this !== undefined ? this : globalObject;
  192. if (!exports.is(esValue)) {
  193. throw new globalObject.TypeError(
  194. "'set name' called on an object that is not a valid instance of HTMLIFrameElement."
  195. );
  196. }
  197. V = conversions["DOMString"](V, {
  198. context: "Failed to set the 'name' property on 'HTMLIFrameElement': The provided value",
  199. globals: globalObject
  200. });
  201. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  202. try {
  203. esValue[implSymbol]._reflectSetTheContentAttribute("name", V);
  204. } finally {
  205. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  206. }
  207. }
  208. get allowFullscreen() {
  209. const esValue = this !== null && this !== undefined ? this : globalObject;
  210. if (!exports.is(esValue)) {
  211. throw new globalObject.TypeError(
  212. "'get allowFullscreen' called on an object that is not a valid instance of HTMLIFrameElement."
  213. );
  214. }
  215. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  216. try {
  217. return esValue[implSymbol]._reflectGetTheContentAttribute("allowfullscreen") !== null;
  218. } finally {
  219. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  220. }
  221. }
  222. set allowFullscreen(V) {
  223. const esValue = this !== null && this !== undefined ? this : globalObject;
  224. if (!exports.is(esValue)) {
  225. throw new globalObject.TypeError(
  226. "'set allowFullscreen' called on an object that is not a valid instance of HTMLIFrameElement."
  227. );
  228. }
  229. V = conversions["boolean"](V, {
  230. context: "Failed to set the 'allowFullscreen' property on 'HTMLIFrameElement': The provided value",
  231. globals: globalObject
  232. });
  233. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  234. try {
  235. if (V) {
  236. esValue[implSymbol]._reflectSetTheContentAttribute("allowfullscreen", "");
  237. } else {
  238. esValue[implSymbol]._reflectDeleteTheContentAttribute("allowfullscreen");
  239. }
  240. } finally {
  241. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  242. }
  243. }
  244. get width() {
  245. const esValue = this !== null && this !== undefined ? this : globalObject;
  246. if (!exports.is(esValue)) {
  247. throw new globalObject.TypeError(
  248. "'get width' called on an object that is not a valid instance of HTMLIFrameElement."
  249. );
  250. }
  251. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  252. try {
  253. const value = esValue[implSymbol]._reflectGetTheContentAttribute("width");
  254. return value === null ? "" : value;
  255. } finally {
  256. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  257. }
  258. }
  259. set width(V) {
  260. const esValue = this !== null && this !== undefined ? this : globalObject;
  261. if (!exports.is(esValue)) {
  262. throw new globalObject.TypeError(
  263. "'set width' called on an object that is not a valid instance of HTMLIFrameElement."
  264. );
  265. }
  266. V = conversions["DOMString"](V, {
  267. context: "Failed to set the 'width' property on 'HTMLIFrameElement': The provided value",
  268. globals: globalObject
  269. });
  270. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  271. try {
  272. esValue[implSymbol]._reflectSetTheContentAttribute("width", V);
  273. } finally {
  274. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  275. }
  276. }
  277. get height() {
  278. const esValue = this !== null && this !== undefined ? this : globalObject;
  279. if (!exports.is(esValue)) {
  280. throw new globalObject.TypeError(
  281. "'get height' called on an object that is not a valid instance of HTMLIFrameElement."
  282. );
  283. }
  284. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  285. try {
  286. const value = esValue[implSymbol]._reflectGetTheContentAttribute("height");
  287. return value === null ? "" : value;
  288. } finally {
  289. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  290. }
  291. }
  292. set height(V) {
  293. const esValue = this !== null && this !== undefined ? this : globalObject;
  294. if (!exports.is(esValue)) {
  295. throw new globalObject.TypeError(
  296. "'set height' called on an object that is not a valid instance of HTMLIFrameElement."
  297. );
  298. }
  299. V = conversions["DOMString"](V, {
  300. context: "Failed to set the 'height' property on 'HTMLIFrameElement': The provided value",
  301. globals: globalObject
  302. });
  303. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  304. try {
  305. esValue[implSymbol]._reflectSetTheContentAttribute("height", V);
  306. } finally {
  307. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  308. }
  309. }
  310. get contentDocument() {
  311. const esValue = this !== null && this !== undefined ? this : globalObject;
  312. if (!exports.is(esValue)) {
  313. throw new globalObject.TypeError(
  314. "'get contentDocument' called on an object that is not a valid instance of HTMLIFrameElement."
  315. );
  316. }
  317. return utils.tryWrapperForImpl(esValue[implSymbol]["contentDocument"]);
  318. }
  319. get contentWindow() {
  320. const esValue = this !== null && this !== undefined ? this : globalObject;
  321. if (!exports.is(esValue)) {
  322. throw new globalObject.TypeError(
  323. "'get contentWindow' called on an object that is not a valid instance of HTMLIFrameElement."
  324. );
  325. }
  326. return utils.tryWrapperForImpl(esValue[implSymbol]["contentWindow"]);
  327. }
  328. get align() {
  329. const esValue = this !== null && this !== undefined ? this : globalObject;
  330. if (!exports.is(esValue)) {
  331. throw new globalObject.TypeError(
  332. "'get align' called on an object that is not a valid instance of HTMLIFrameElement."
  333. );
  334. }
  335. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  336. try {
  337. const value = esValue[implSymbol]._reflectGetTheContentAttribute("align");
  338. return value === null ? "" : value;
  339. } finally {
  340. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  341. }
  342. }
  343. set align(V) {
  344. const esValue = this !== null && this !== undefined ? this : globalObject;
  345. if (!exports.is(esValue)) {
  346. throw new globalObject.TypeError(
  347. "'set align' called on an object that is not a valid instance of HTMLIFrameElement."
  348. );
  349. }
  350. V = conversions["DOMString"](V, {
  351. context: "Failed to set the 'align' property on 'HTMLIFrameElement': The provided value",
  352. globals: globalObject
  353. });
  354. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  355. try {
  356. esValue[implSymbol]._reflectSetTheContentAttribute("align", V);
  357. } finally {
  358. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  359. }
  360. }
  361. get scrolling() {
  362. const esValue = this !== null && this !== undefined ? this : globalObject;
  363. if (!exports.is(esValue)) {
  364. throw new globalObject.TypeError(
  365. "'get scrolling' called on an object that is not a valid instance of HTMLIFrameElement."
  366. );
  367. }
  368. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  369. try {
  370. const value = esValue[implSymbol]._reflectGetTheContentAttribute("scrolling");
  371. return value === null ? "" : value;
  372. } finally {
  373. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  374. }
  375. }
  376. set scrolling(V) {
  377. const esValue = this !== null && this !== undefined ? this : globalObject;
  378. if (!exports.is(esValue)) {
  379. throw new globalObject.TypeError(
  380. "'set scrolling' called on an object that is not a valid instance of HTMLIFrameElement."
  381. );
  382. }
  383. V = conversions["DOMString"](V, {
  384. context: "Failed to set the 'scrolling' property on 'HTMLIFrameElement': The provided value",
  385. globals: globalObject
  386. });
  387. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  388. try {
  389. esValue[implSymbol]._reflectSetTheContentAttribute("scrolling", V);
  390. } finally {
  391. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  392. }
  393. }
  394. get frameBorder() {
  395. const esValue = this !== null && this !== undefined ? this : globalObject;
  396. if (!exports.is(esValue)) {
  397. throw new globalObject.TypeError(
  398. "'get frameBorder' called on an object that is not a valid instance of HTMLIFrameElement."
  399. );
  400. }
  401. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  402. try {
  403. const value = esValue[implSymbol]._reflectGetTheContentAttribute("frameborder");
  404. return value === null ? "" : value;
  405. } finally {
  406. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  407. }
  408. }
  409. set frameBorder(V) {
  410. const esValue = this !== null && this !== undefined ? this : globalObject;
  411. if (!exports.is(esValue)) {
  412. throw new globalObject.TypeError(
  413. "'set frameBorder' called on an object that is not a valid instance of HTMLIFrameElement."
  414. );
  415. }
  416. V = conversions["DOMString"](V, {
  417. context: "Failed to set the 'frameBorder' property on 'HTMLIFrameElement': The provided value",
  418. globals: globalObject
  419. });
  420. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  421. try {
  422. esValue[implSymbol]._reflectSetTheContentAttribute("frameborder", V);
  423. } finally {
  424. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  425. }
  426. }
  427. get longDesc() {
  428. const esValue = this !== null && this !== undefined ? this : globalObject;
  429. if (!exports.is(esValue)) {
  430. throw new globalObject.TypeError(
  431. "'get longDesc' called on an object that is not a valid instance of HTMLIFrameElement."
  432. );
  433. }
  434. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  435. try {
  436. const impl = esValue[implSymbol];
  437. const value = impl._reflectGetTheContentAttribute("longdesc");
  438. if (value === null) {
  439. return "";
  440. }
  441. const document = impl._ownerDocument;
  442. if (this._longdescURLCacheKey === value && this._baseURLCache === document._baseURLCache) {
  443. return this._longdescURLCache;
  444. }
  445. this._longdescURLCacheKey = value;
  446. this._baseURLCache = document._baseURLCache;
  447. const urlRecord = document.encodingParseAURL(value);
  448. if (urlRecord !== null) {
  449. this._longdescURLCache = serializeURLwhatwg_url(urlRecord);
  450. return this._longdescURLCache;
  451. }
  452. this._longdescURLCache = conversions.USVString(value);
  453. return this._longdescURLCache;
  454. } finally {
  455. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  456. }
  457. }
  458. set longDesc(V) {
  459. const esValue = this !== null && this !== undefined ? this : globalObject;
  460. if (!exports.is(esValue)) {
  461. throw new globalObject.TypeError(
  462. "'set longDesc' called on an object that is not a valid instance of HTMLIFrameElement."
  463. );
  464. }
  465. V = conversions["USVString"](V, {
  466. context: "Failed to set the 'longDesc' property on 'HTMLIFrameElement': The provided value",
  467. globals: globalObject
  468. });
  469. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  470. try {
  471. esValue[implSymbol]._reflectSetTheContentAttribute("longdesc", V);
  472. } finally {
  473. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  474. }
  475. }
  476. get marginHeight() {
  477. const esValue = this !== null && this !== undefined ? this : globalObject;
  478. if (!exports.is(esValue)) {
  479. throw new globalObject.TypeError(
  480. "'get marginHeight' called on an object that is not a valid instance of HTMLIFrameElement."
  481. );
  482. }
  483. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  484. try {
  485. const value = esValue[implSymbol]._reflectGetTheContentAttribute("marginheight");
  486. return value === null ? "" : value;
  487. } finally {
  488. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  489. }
  490. }
  491. set marginHeight(V) {
  492. const esValue = this !== null && this !== undefined ? this : globalObject;
  493. if (!exports.is(esValue)) {
  494. throw new globalObject.TypeError(
  495. "'set marginHeight' called on an object that is not a valid instance of HTMLIFrameElement."
  496. );
  497. }
  498. V = conversions["DOMString"](V, {
  499. context: "Failed to set the 'marginHeight' property on 'HTMLIFrameElement': The provided value",
  500. globals: globalObject,
  501. treatNullAsEmptyString: true
  502. });
  503. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  504. try {
  505. esValue[implSymbol]._reflectSetTheContentAttribute("marginheight", V);
  506. } finally {
  507. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  508. }
  509. }
  510. get marginWidth() {
  511. const esValue = this !== null && this !== undefined ? this : globalObject;
  512. if (!exports.is(esValue)) {
  513. throw new globalObject.TypeError(
  514. "'get marginWidth' called on an object that is not a valid instance of HTMLIFrameElement."
  515. );
  516. }
  517. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  518. try {
  519. const value = esValue[implSymbol]._reflectGetTheContentAttribute("marginwidth");
  520. return value === null ? "" : value;
  521. } finally {
  522. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  523. }
  524. }
  525. set marginWidth(V) {
  526. const esValue = this !== null && this !== undefined ? this : globalObject;
  527. if (!exports.is(esValue)) {
  528. throw new globalObject.TypeError(
  529. "'set marginWidth' called on an object that is not a valid instance of HTMLIFrameElement."
  530. );
  531. }
  532. V = conversions["DOMString"](V, {
  533. context: "Failed to set the 'marginWidth' property on 'HTMLIFrameElement': The provided value",
  534. globals: globalObject,
  535. treatNullAsEmptyString: true
  536. });
  537. ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
  538. try {
  539. esValue[implSymbol]._reflectSetTheContentAttribute("marginwidth", V);
  540. } finally {
  541. ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
  542. }
  543. }
  544. }
  545. Object.defineProperties(HTMLIFrameElement.prototype, {
  546. getSVGDocument: { enumerable: true },
  547. src: { enumerable: true },
  548. srcdoc: { enumerable: true },
  549. name: { enumerable: true },
  550. allowFullscreen: { enumerable: true },
  551. width: { enumerable: true },
  552. height: { enumerable: true },
  553. contentDocument: { enumerable: true },
  554. contentWindow: { enumerable: true },
  555. align: { enumerable: true },
  556. scrolling: { enumerable: true },
  557. frameBorder: { enumerable: true },
  558. longDesc: { enumerable: true },
  559. marginHeight: { enumerable: true },
  560. marginWidth: { enumerable: true },
  561. [Symbol.toStringTag]: { value: "HTMLIFrameElement", configurable: true }
  562. });
  563. ctorRegistry[interfaceName] = HTMLIFrameElement;
  564. Object.defineProperty(globalObject, interfaceName, {
  565. configurable: true,
  566. writable: true,
  567. value: HTMLIFrameElement
  568. });
  569. };
  570. const Impl = require("../../jsdom/living/nodes/HTMLIFrameElement-impl.js");