/ cloudformation-templates / node_modules / jsdom / lib / jsdom / living / generated / HTMLTableRowElement.js
HTMLTableRowElement.js
1 "use strict"; 2 3 const conversions = require("webidl-conversions"); 4 const utils = require("./utils.js"); 5 6 const HTMLConstructor_helpers_html_constructor = require("../helpers/html-constructor.js").HTMLConstructor; 7 const ceReactionsPreSteps_helpers_custom_elements = require("../helpers/custom-elements.js").ceReactionsPreSteps; 8 const ceReactionsPostSteps_helpers_custom_elements = require("../helpers/custom-elements.js").ceReactionsPostSteps; 9 const implSymbol = utils.implSymbol; 10 const ctorRegistrySymbol = utils.ctorRegistrySymbol; 11 const HTMLElement = require("./HTMLElement.js"); 12 13 const interfaceName = "HTMLTableRowElement"; 14 15 exports.is = value => { 16 return utils.isObject(value) && utils.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 = (value, { context = "The provided value" } = {}) => { 22 if (exports.is(value)) { 23 return utils.implForWrapper(value); 24 } 25 throw new TypeError(`${context} is not of type 'HTMLTableRowElement'.`); 26 }; 27 28 function makeWrapper(globalObject) { 29 if (globalObject[ctorRegistrySymbol] === undefined) { 30 throw new Error("Internal error: invalid global object"); 31 } 32 33 const ctor = globalObject[ctorRegistrySymbol]["HTMLTableRowElement"]; 34 if (ctor === undefined) { 35 throw new Error("Internal error: constructor HTMLTableRowElement is not installed on the passed global object"); 36 } 37 38 return Object.create(ctor.prototype); 39 } 40 41 exports.create = (globalObject, constructorArgs, privateData) => { 42 const wrapper = makeWrapper(globalObject); 43 return exports.setup(wrapper, globalObject, constructorArgs, privateData); 44 }; 45 46 exports.createImpl = (globalObject, constructorArgs, privateData) => { 47 const wrapper = exports.create(globalObject, constructorArgs, privateData); 48 return utils.implForWrapper(wrapper); 49 }; 50 51 exports._internalSetup = (wrapper, globalObject) => { 52 HTMLElement._internalSetup(wrapper, globalObject); 53 }; 54 55 exports.setup = (wrapper, globalObject, constructorArgs = [], privateData = {}) => { 56 privateData.wrapper = wrapper; 57 58 exports._internalSetup(wrapper, globalObject); 59 Object.defineProperty(wrapper, implSymbol, { 60 value: new Impl.implementation(globalObject, constructorArgs, privateData), 61 configurable: true 62 }); 63 64 wrapper[implSymbol][utils.wrapperSymbol] = wrapper; 65 if (Impl.init) { 66 Impl.init(wrapper[implSymbol]); 67 } 68 return wrapper; 69 }; 70 71 exports.new = globalObject => { 72 const wrapper = makeWrapper(globalObject); 73 74 exports._internalSetup(wrapper, globalObject); 75 Object.defineProperty(wrapper, implSymbol, { 76 value: Object.create(Impl.implementation.prototype), 77 configurable: true 78 }); 79 80 wrapper[implSymbol][utils.wrapperSymbol] = wrapper; 81 if (Impl.init) { 82 Impl.init(wrapper[implSymbol]); 83 } 84 return wrapper[implSymbol]; 85 }; 86 87 const exposed = new Set(["Window"]); 88 89 exports.install = (globalObject, globalNames) => { 90 if (!globalNames.some(globalName => exposed.has(globalName))) { 91 return; 92 } 93 94 if (globalObject.HTMLElement === undefined) { 95 throw new Error("Internal error: attempting to evaluate HTMLTableRowElement before HTMLElement"); 96 } 97 class HTMLTableRowElement extends globalObject.HTMLElement { 98 constructor() { 99 return HTMLConstructor_helpers_html_constructor(globalObject, interfaceName, new.target); 100 } 101 102 insertCell() { 103 const esValue = this !== null && this !== undefined ? this : globalObject; 104 if (!exports.is(esValue)) { 105 throw new TypeError("'insertCell' called on an object that is not a valid instance of HTMLTableRowElement."); 106 } 107 const args = []; 108 { 109 let curArg = arguments[0]; 110 if (curArg !== undefined) { 111 curArg = conversions["long"](curArg, { 112 context: "Failed to execute 'insertCell' on 'HTMLTableRowElement': parameter 1" 113 }); 114 } else { 115 curArg = -1; 116 } 117 args.push(curArg); 118 } 119 return utils.tryWrapperForImpl(esValue[implSymbol].insertCell(...args)); 120 } 121 122 deleteCell(index) { 123 const esValue = this !== null && this !== undefined ? this : globalObject; 124 if (!exports.is(esValue)) { 125 throw new TypeError("'deleteCell' called on an object that is not a valid instance of HTMLTableRowElement."); 126 } 127 128 if (arguments.length < 1) { 129 throw new TypeError( 130 "Failed to execute 'deleteCell' on 'HTMLTableRowElement': 1 argument required, but only " + 131 arguments.length + 132 " present." 133 ); 134 } 135 const args = []; 136 { 137 let curArg = arguments[0]; 138 curArg = conversions["long"](curArg, { 139 context: "Failed to execute 'deleteCell' on 'HTMLTableRowElement': parameter 1" 140 }); 141 args.push(curArg); 142 } 143 ceReactionsPreSteps_helpers_custom_elements(globalObject); 144 try { 145 return esValue[implSymbol].deleteCell(...args); 146 } finally { 147 ceReactionsPostSteps_helpers_custom_elements(globalObject); 148 } 149 } 150 151 get rowIndex() { 152 const esValue = this !== null && this !== undefined ? this : globalObject; 153 154 if (!exports.is(esValue)) { 155 throw new TypeError("'get rowIndex' called on an object that is not a valid instance of HTMLTableRowElement."); 156 } 157 158 return esValue[implSymbol]["rowIndex"]; 159 } 160 161 get sectionRowIndex() { 162 const esValue = this !== null && this !== undefined ? this : globalObject; 163 164 if (!exports.is(esValue)) { 165 throw new TypeError( 166 "'get sectionRowIndex' called on an object that is not a valid instance of HTMLTableRowElement." 167 ); 168 } 169 170 return esValue[implSymbol]["sectionRowIndex"]; 171 } 172 173 get cells() { 174 const esValue = this !== null && this !== undefined ? this : globalObject; 175 176 if (!exports.is(esValue)) { 177 throw new TypeError("'get cells' called on an object that is not a valid instance of HTMLTableRowElement."); 178 } 179 180 return utils.getSameObject(this, "cells", () => { 181 return utils.tryWrapperForImpl(esValue[implSymbol]["cells"]); 182 }); 183 } 184 185 get align() { 186 const esValue = this !== null && this !== undefined ? this : globalObject; 187 188 if (!exports.is(esValue)) { 189 throw new TypeError("'get align' called on an object that is not a valid instance of HTMLTableRowElement."); 190 } 191 192 ceReactionsPreSteps_helpers_custom_elements(globalObject); 193 try { 194 const value = esValue[implSymbol].getAttributeNS(null, "align"); 195 return value === null ? "" : value; 196 } finally { 197 ceReactionsPostSteps_helpers_custom_elements(globalObject); 198 } 199 } 200 201 set align(V) { 202 const esValue = this !== null && this !== undefined ? this : globalObject; 203 204 if (!exports.is(esValue)) { 205 throw new TypeError("'set align' called on an object that is not a valid instance of HTMLTableRowElement."); 206 } 207 208 V = conversions["DOMString"](V, { 209 context: "Failed to set the 'align' property on 'HTMLTableRowElement': The provided value" 210 }); 211 212 ceReactionsPreSteps_helpers_custom_elements(globalObject); 213 try { 214 esValue[implSymbol].setAttributeNS(null, "align", V); 215 } finally { 216 ceReactionsPostSteps_helpers_custom_elements(globalObject); 217 } 218 } 219 220 get ch() { 221 const esValue = this !== null && this !== undefined ? this : globalObject; 222 223 if (!exports.is(esValue)) { 224 throw new TypeError("'get ch' called on an object that is not a valid instance of HTMLTableRowElement."); 225 } 226 227 ceReactionsPreSteps_helpers_custom_elements(globalObject); 228 try { 229 const value = esValue[implSymbol].getAttributeNS(null, "char"); 230 return value === null ? "" : value; 231 } finally { 232 ceReactionsPostSteps_helpers_custom_elements(globalObject); 233 } 234 } 235 236 set ch(V) { 237 const esValue = this !== null && this !== undefined ? this : globalObject; 238 239 if (!exports.is(esValue)) { 240 throw new TypeError("'set ch' called on an object that is not a valid instance of HTMLTableRowElement."); 241 } 242 243 V = conversions["DOMString"](V, { 244 context: "Failed to set the 'ch' property on 'HTMLTableRowElement': The provided value" 245 }); 246 247 ceReactionsPreSteps_helpers_custom_elements(globalObject); 248 try { 249 esValue[implSymbol].setAttributeNS(null, "char", V); 250 } finally { 251 ceReactionsPostSteps_helpers_custom_elements(globalObject); 252 } 253 } 254 255 get chOff() { 256 const esValue = this !== null && this !== undefined ? this : globalObject; 257 258 if (!exports.is(esValue)) { 259 throw new TypeError("'get chOff' called on an object that is not a valid instance of HTMLTableRowElement."); 260 } 261 262 ceReactionsPreSteps_helpers_custom_elements(globalObject); 263 try { 264 const value = esValue[implSymbol].getAttributeNS(null, "charoff"); 265 return value === null ? "" : value; 266 } finally { 267 ceReactionsPostSteps_helpers_custom_elements(globalObject); 268 } 269 } 270 271 set chOff(V) { 272 const esValue = this !== null && this !== undefined ? this : globalObject; 273 274 if (!exports.is(esValue)) { 275 throw new TypeError("'set chOff' called on an object that is not a valid instance of HTMLTableRowElement."); 276 } 277 278 V = conversions["DOMString"](V, { 279 context: "Failed to set the 'chOff' property on 'HTMLTableRowElement': The provided value" 280 }); 281 282 ceReactionsPreSteps_helpers_custom_elements(globalObject); 283 try { 284 esValue[implSymbol].setAttributeNS(null, "charoff", V); 285 } finally { 286 ceReactionsPostSteps_helpers_custom_elements(globalObject); 287 } 288 } 289 290 get vAlign() { 291 const esValue = this !== null && this !== undefined ? this : globalObject; 292 293 if (!exports.is(esValue)) { 294 throw new TypeError("'get vAlign' called on an object that is not a valid instance of HTMLTableRowElement."); 295 } 296 297 ceReactionsPreSteps_helpers_custom_elements(globalObject); 298 try { 299 const value = esValue[implSymbol].getAttributeNS(null, "valign"); 300 return value === null ? "" : value; 301 } finally { 302 ceReactionsPostSteps_helpers_custom_elements(globalObject); 303 } 304 } 305 306 set vAlign(V) { 307 const esValue = this !== null && this !== undefined ? this : globalObject; 308 309 if (!exports.is(esValue)) { 310 throw new TypeError("'set vAlign' called on an object that is not a valid instance of HTMLTableRowElement."); 311 } 312 313 V = conversions["DOMString"](V, { 314 context: "Failed to set the 'vAlign' property on 'HTMLTableRowElement': The provided value" 315 }); 316 317 ceReactionsPreSteps_helpers_custom_elements(globalObject); 318 try { 319 esValue[implSymbol].setAttributeNS(null, "valign", V); 320 } finally { 321 ceReactionsPostSteps_helpers_custom_elements(globalObject); 322 } 323 } 324 325 get bgColor() { 326 const esValue = this !== null && this !== undefined ? this : globalObject; 327 328 if (!exports.is(esValue)) { 329 throw new TypeError("'get bgColor' called on an object that is not a valid instance of HTMLTableRowElement."); 330 } 331 332 ceReactionsPreSteps_helpers_custom_elements(globalObject); 333 try { 334 const value = esValue[implSymbol].getAttributeNS(null, "bgcolor"); 335 return value === null ? "" : value; 336 } finally { 337 ceReactionsPostSteps_helpers_custom_elements(globalObject); 338 } 339 } 340 341 set bgColor(V) { 342 const esValue = this !== null && this !== undefined ? this : globalObject; 343 344 if (!exports.is(esValue)) { 345 throw new TypeError("'set bgColor' called on an object that is not a valid instance of HTMLTableRowElement."); 346 } 347 348 V = conversions["DOMString"](V, { 349 context: "Failed to set the 'bgColor' property on 'HTMLTableRowElement': The provided value", 350 treatNullAsEmptyString: true 351 }); 352 353 ceReactionsPreSteps_helpers_custom_elements(globalObject); 354 try { 355 esValue[implSymbol].setAttributeNS(null, "bgcolor", V); 356 } finally { 357 ceReactionsPostSteps_helpers_custom_elements(globalObject); 358 } 359 } 360 } 361 Object.defineProperties(HTMLTableRowElement.prototype, { 362 insertCell: { enumerable: true }, 363 deleteCell: { enumerable: true }, 364 rowIndex: { enumerable: true }, 365 sectionRowIndex: { enumerable: true }, 366 cells: { enumerable: true }, 367 align: { enumerable: true }, 368 ch: { enumerable: true }, 369 chOff: { enumerable: true }, 370 vAlign: { enumerable: true }, 371 bgColor: { enumerable: true }, 372 [Symbol.toStringTag]: { value: "HTMLTableRowElement", configurable: true } 373 }); 374 if (globalObject[ctorRegistrySymbol] === undefined) { 375 globalObject[ctorRegistrySymbol] = Object.create(null); 376 } 377 globalObject[ctorRegistrySymbol][interfaceName] = HTMLTableRowElement; 378 379 Object.defineProperty(globalObject, interfaceName, { 380 configurable: true, 381 writable: true, 382 value: HTMLTableRowElement 383 }); 384 }; 385 386 const Impl = require("../nodes/HTMLTableRowElement-impl.js");