HTMLTableElement.js 26 KB

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