| 1 | /* |
| 2 | This file is part of the WebKit open source project. |
| 3 | This file has been generated by generate-bindings.pl. DO NOT MODIFY! |
| 4 | |
| 5 | This library is free software; you can redistribute it and/or |
| 6 | modify it under the terms of the GNU Library General Public |
| 7 | License as published by the Free Software Foundation; either |
| 8 | version 2 of the License, or (at your option) any later version. |
| 9 | |
| 10 | This library is distributed in the hope that it will be useful, |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 | Library General Public License for more details. |
| 14 | |
| 15 | You should have received a copy of the GNU Library General Public License |
| 16 | along with this library; see the file COPYING.LIB. If not, write to |
| 17 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 18 | Boston, MA 02110-1301, USA. |
| 19 | */ |
| 20 | |
| 21 | #include "config.h" |
| 22 | #include "JSHTMLTableElement.h" |
| 23 | |
| 24 | #include "CustomElementReactionQueue.h" |
| 25 | #include "HTMLNames.h" |
| 26 | #include "JSDOMAttribute.h" |
| 27 | #include "JSDOMBinding.h" |
| 28 | #include "JSDOMConstructorNotConstructable.h" |
| 29 | #include "JSDOMConvertInterface.h" |
| 30 | #include "JSDOMConvertNullable.h" |
| 31 | #include "JSDOMConvertNumbers.h" |
| 32 | #include "JSDOMConvertStrings.h" |
| 33 | #include "JSDOMExceptionHandling.h" |
| 34 | #include "JSDOMGlobalObject.h" |
| 35 | #include "JSDOMOperation.h" |
| 36 | #include "JSDOMWrapperCache.h" |
| 37 | #include "JSHTMLCollection.h" |
| 38 | #include "JSHTMLTableCaptionElement.h" |
| 39 | #include "JSHTMLTableSectionElement.h" |
| 40 | #include "ScriptExecutionContext.h" |
| 41 | #include <JavaScriptCore/HeapSnapshotBuilder.h> |
| 42 | #include <JavaScriptCore/JSCInlines.h> |
| 43 | #include <wtf/GetPtr.h> |
| 44 | #include <wtf/PointerPreparations.h> |
| 45 | #include <wtf/URL.h> |
| 46 | |
| 47 | |
| 48 | namespace WebCore { |
| 49 | using namespace JSC; |
| 50 | |
| 51 | // Functions |
| 52 | |
| 53 | JSC::EncodedJSValue JSC_HOST_CALL jsHTMLTableElementPrototypeFunctionCreateTHead(JSC::ExecState*); |
| 54 | JSC::EncodedJSValue JSC_HOST_CALL jsHTMLTableElementPrototypeFunctionDeleteTHead(JSC::ExecState*); |
| 55 | JSC::EncodedJSValue JSC_HOST_CALL jsHTMLTableElementPrototypeFunctionCreateTFoot(JSC::ExecState*); |
| 56 | JSC::EncodedJSValue JSC_HOST_CALL jsHTMLTableElementPrototypeFunctionDeleteTFoot(JSC::ExecState*); |
| 57 | JSC::EncodedJSValue JSC_HOST_CALL jsHTMLTableElementPrototypeFunctionCreateTBody(JSC::ExecState*); |
| 58 | JSC::EncodedJSValue JSC_HOST_CALL jsHTMLTableElementPrototypeFunctionCreateCaption(JSC::ExecState*); |
| 59 | JSC::EncodedJSValue JSC_HOST_CALL jsHTMLTableElementPrototypeFunctionDeleteCaption(JSC::ExecState*); |
| 60 | JSC::EncodedJSValue JSC_HOST_CALL jsHTMLTableElementPrototypeFunctionInsertRow(JSC::ExecState*); |
| 61 | JSC::EncodedJSValue JSC_HOST_CALL jsHTMLTableElementPrototypeFunctionDeleteRow(JSC::ExecState*); |
| 62 | |
| 63 | // Attributes |
| 64 | |
| 65 | JSC::EncodedJSValue jsHTMLTableElementConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 66 | bool setJSHTMLTableElementConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| 67 | JSC::EncodedJSValue jsHTMLTableElementCaption(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 68 | bool setJSHTMLTableElementCaption(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| 69 | JSC::EncodedJSValue jsHTMLTableElementTHead(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 70 | bool setJSHTMLTableElementTHead(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| 71 | JSC::EncodedJSValue jsHTMLTableElementTFoot(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 72 | bool setJSHTMLTableElementTFoot(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| 73 | JSC::EncodedJSValue jsHTMLTableElementRows(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 74 | JSC::EncodedJSValue jsHTMLTableElementTBodies(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 75 | JSC::EncodedJSValue jsHTMLTableElementAlign(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 76 | bool setJSHTMLTableElementAlign(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| 77 | JSC::EncodedJSValue jsHTMLTableElementBgColor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 78 | bool setJSHTMLTableElementBgColor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| 79 | JSC::EncodedJSValue jsHTMLTableElementBorder(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 80 | bool setJSHTMLTableElementBorder(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| 81 | JSC::EncodedJSValue jsHTMLTableElementCellPadding(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 82 | bool setJSHTMLTableElementCellPadding(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| 83 | JSC::EncodedJSValue jsHTMLTableElementCellSpacing(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 84 | bool setJSHTMLTableElementCellSpacing(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| 85 | JSC::EncodedJSValue jsHTMLTableElementFrame(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 86 | bool setJSHTMLTableElementFrame(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| 87 | JSC::EncodedJSValue jsHTMLTableElementRules(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 88 | bool setJSHTMLTableElementRules(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| 89 | JSC::EncodedJSValue jsHTMLTableElementSummary(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 90 | bool setJSHTMLTableElementSummary(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| 91 | JSC::EncodedJSValue jsHTMLTableElementWidth(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| 92 | bool setJSHTMLTableElementWidth(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| 93 | |
| 94 | class JSHTMLTableElementPrototype : public JSC::JSNonFinalObject { |
| 95 | public: |
| 96 | using Base = JSC::JSNonFinalObject; |
| 97 | static JSHTMLTableElementPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure) |
| 98 | { |
| 99 | JSHTMLTableElementPrototype* ptr = new (NotNull, JSC::allocateCell<JSHTMLTableElementPrototype>(vm.heap)) JSHTMLTableElementPrototype(vm, globalObject, structure); |
| 100 | ptr->finishCreation(vm); |
| 101 | return ptr; |
| 102 | } |
| 103 | |
| 104 | DECLARE_INFO; |
| 105 | static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) |
| 106 | { |
| 107 | return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info()); |
| 108 | } |
| 109 | |
| 110 | private: |
| 111 | JSHTMLTableElementPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure) |
| 112 | : JSC::JSNonFinalObject(vm, structure) |
| 113 | { |
| 114 | } |
| 115 | |
| 116 | void finishCreation(JSC::VM&); |
| 117 | }; |
| 118 | |
| 119 | using JSHTMLTableElementConstructor = JSDOMConstructorNotConstructable<JSHTMLTableElement>; |
| 120 | |
| 121 | template<> JSValue JSHTMLTableElementConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject) |
| 122 | { |
| 123 | return JSHTMLElement::getConstructor(vm, &globalObject); |
| 124 | } |
| 125 | |
| 126 | template<> void JSHTMLTableElementConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject) |
| 127 | { |
| 128 | putDirect(vm, vm.propertyNames->prototype, JSHTMLTableElement::prototype(vm, globalObject), JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
| 129 | putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String("HTMLTableElement"_s )), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
| 130 | putDirect(vm, vm.propertyNames->length, jsNumber(0), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
| 131 | } |
| 132 | |
| 133 | template<> const ClassInfo JSHTMLTableElementConstructor::s_info = { "HTMLTableElement" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSHTMLTableElementConstructor) }; |
| 134 | |
| 135 | /* Hash table for prototype */ |
| 136 | |
| 137 | static const HashTableValue JSHTMLTableElementPrototypeTableValues[] = |
| 138 | { |
| 139 | { "constructor" , static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLTableElementConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLTableElementConstructor) } }, |
| 140 | { "caption" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLTableElementCaption), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLTableElementCaption) } }, |
| 141 | { "tHead" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLTableElementTHead), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLTableElementTHead) } }, |
| 142 | { "tFoot" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLTableElementTFoot), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLTableElementTFoot) } }, |
| 143 | { "rows" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLTableElementRows), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
| 144 | { "tBodies" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLTableElementTBodies), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
| 145 | { "align" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLTableElementAlign), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLTableElementAlign) } }, |
| 146 | { "bgColor" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLTableElementBgColor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLTableElementBgColor) } }, |
| 147 | { "border" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLTableElementBorder), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLTableElementBorder) } }, |
| 148 | { "cellPadding" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLTableElementCellPadding), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLTableElementCellPadding) } }, |
| 149 | { "cellSpacing" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLTableElementCellSpacing), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLTableElementCellSpacing) } }, |
| 150 | { "frame" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLTableElementFrame), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLTableElementFrame) } }, |
| 151 | { "rules" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLTableElementRules), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLTableElementRules) } }, |
| 152 | { "summary" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLTableElementSummary), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLTableElementSummary) } }, |
| 153 | { "width" , static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLTableElementWidth), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLTableElementWidth) } }, |
| 154 | { "createTHead" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsHTMLTableElementPrototypeFunctionCreateTHead), (intptr_t) (0) } }, |
| 155 | { "deleteTHead" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsHTMLTableElementPrototypeFunctionDeleteTHead), (intptr_t) (0) } }, |
| 156 | { "createTFoot" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsHTMLTableElementPrototypeFunctionCreateTFoot), (intptr_t) (0) } }, |
| 157 | { "deleteTFoot" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsHTMLTableElementPrototypeFunctionDeleteTFoot), (intptr_t) (0) } }, |
| 158 | { "createTBody" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsHTMLTableElementPrototypeFunctionCreateTBody), (intptr_t) (0) } }, |
| 159 | { "createCaption" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsHTMLTableElementPrototypeFunctionCreateCaption), (intptr_t) (0) } }, |
| 160 | { "deleteCaption" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsHTMLTableElementPrototypeFunctionDeleteCaption), (intptr_t) (0) } }, |
| 161 | { "insertRow" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsHTMLTableElementPrototypeFunctionInsertRow), (intptr_t) (0) } }, |
| 162 | { "deleteRow" , static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsHTMLTableElementPrototypeFunctionDeleteRow), (intptr_t) (1) } }, |
| 163 | }; |
| 164 | |
| 165 | const ClassInfo JSHTMLTableElementPrototype::s_info = { "HTMLTableElementPrototype" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSHTMLTableElementPrototype) }; |
| 166 | |
| 167 | void JSHTMLTableElementPrototype::finishCreation(VM& vm) |
| 168 | { |
| 169 | Base::finishCreation(vm); |
| 170 | reifyStaticProperties(vm, JSHTMLTableElement::info(), JSHTMLTableElementPrototypeTableValues, *this); |
| 171 | } |
| 172 | |
| 173 | const ClassInfo JSHTMLTableElement::s_info = { "HTMLTableElement" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSHTMLTableElement) }; |
| 174 | |
| 175 | JSHTMLTableElement::JSHTMLTableElement(Structure* structure, JSDOMGlobalObject& globalObject, Ref<HTMLTableElement>&& impl) |
| 176 | : JSHTMLElement(structure, globalObject, WTFMove(impl)) |
| 177 | { |
| 178 | } |
| 179 | |
| 180 | void JSHTMLTableElement::finishCreation(VM& vm) |
| 181 | { |
| 182 | Base::finishCreation(vm); |
| 183 | ASSERT(inherits(vm, info())); |
| 184 | |
| 185 | } |
| 186 | |
| 187 | JSObject* JSHTMLTableElement::createPrototype(VM& vm, JSDOMGlobalObject& globalObject) |
| 188 | { |
| 189 | return JSHTMLTableElementPrototype::create(vm, &globalObject, JSHTMLTableElementPrototype::createStructure(vm, &globalObject, JSHTMLElement::prototype(vm, globalObject))); |
| 190 | } |
| 191 | |
| 192 | JSObject* JSHTMLTableElement::prototype(VM& vm, JSDOMGlobalObject& globalObject) |
| 193 | { |
| 194 | return getDOMPrototype<JSHTMLTableElement>(vm, globalObject); |
| 195 | } |
| 196 | |
| 197 | JSValue JSHTMLTableElement::getConstructor(VM& vm, const JSGlobalObject* globalObject) |
| 198 | { |
| 199 | return getDOMConstructor<JSHTMLTableElementConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject)); |
| 200 | } |
| 201 | |
| 202 | template<> inline JSHTMLTableElement* IDLAttribute<JSHTMLTableElement>::cast(ExecState& state, EncodedJSValue thisValue) |
| 203 | { |
| 204 | return jsDynamicCast<JSHTMLTableElement*>(state.vm(), JSValue::decode(thisValue)); |
| 205 | } |
| 206 | |
| 207 | template<> inline JSHTMLTableElement* IDLOperation<JSHTMLTableElement>::cast(ExecState& state) |
| 208 | { |
| 209 | return jsDynamicCast<JSHTMLTableElement*>(state.vm(), state.thisValue()); |
| 210 | } |
| 211 | |
| 212 | EncodedJSValue jsHTMLTableElementConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 213 | { |
| 214 | VM& vm = state->vm(); |
| 215 | auto throwScope = DECLARE_THROW_SCOPE(vm); |
| 216 | auto* prototype = jsDynamicCast<JSHTMLTableElementPrototype*>(vm, JSValue::decode(thisValue)); |
| 217 | if (UNLIKELY(!prototype)) |
| 218 | return throwVMTypeError(state, throwScope); |
| 219 | return JSValue::encode(JSHTMLTableElement::getConstructor(state->vm(), prototype->globalObject())); |
| 220 | } |
| 221 | |
| 222 | bool setJSHTMLTableElementConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| 223 | { |
| 224 | VM& vm = state->vm(); |
| 225 | auto throwScope = DECLARE_THROW_SCOPE(vm); |
| 226 | auto* prototype = jsDynamicCast<JSHTMLTableElementPrototype*>(vm, JSValue::decode(thisValue)); |
| 227 | if (UNLIKELY(!prototype)) { |
| 228 | throwVMTypeError(state, throwScope); |
| 229 | return false; |
| 230 | } |
| 231 | // Shadowing a built-in constructor |
| 232 | return prototype->putDirect(vm, vm.propertyNames->constructor, JSValue::decode(encodedValue)); |
| 233 | } |
| 234 | |
| 235 | static inline JSValue jsHTMLTableElementCaptionGetter(ExecState& state, JSHTMLTableElement& thisObject, ThrowScope& throwScope) |
| 236 | { |
| 237 | UNUSED_PARAM(throwScope); |
| 238 | UNUSED_PARAM(state); |
| 239 | auto& impl = thisObject.wrapped(); |
| 240 | JSValue result = toJS<IDLNullable<IDLInterface<HTMLTableCaptionElement>>>(state, *thisObject.globalObject(), throwScope, impl.caption()); |
| 241 | return result; |
| 242 | } |
| 243 | |
| 244 | EncodedJSValue jsHTMLTableElementCaption(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 245 | { |
| 246 | return IDLAttribute<JSHTMLTableElement>::get<jsHTMLTableElementCaptionGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "caption" ); |
| 247 | } |
| 248 | |
| 249 | static inline bool setJSHTMLTableElementCaptionSetter(ExecState& state, JSHTMLTableElement& thisObject, JSValue value, ThrowScope& throwScope) |
| 250 | { |
| 251 | UNUSED_PARAM(throwScope); |
| 252 | CustomElementReactionStack customElementReactionStack(state); |
| 253 | auto& impl = thisObject.wrapped(); |
| 254 | auto nativeValue = convert<IDLNullable<IDLInterface<HTMLTableCaptionElement>>>(state, value, [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwAttributeTypeError(state, scope, "HTMLTableElement" , "caption" , "HTMLTableCaptionElement" ); }); |
| 255 | RETURN_IF_EXCEPTION(throwScope, false); |
| 256 | AttributeSetter::call(state, throwScope, [&] { |
| 257 | return impl.setCaption(WTFMove(nativeValue)); |
| 258 | }); |
| 259 | return true; |
| 260 | } |
| 261 | |
| 262 | bool setJSHTMLTableElementCaption(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| 263 | { |
| 264 | return IDLAttribute<JSHTMLTableElement>::set<setJSHTMLTableElementCaptionSetter>(*state, thisValue, encodedValue, "caption" ); |
| 265 | } |
| 266 | |
| 267 | static inline JSValue jsHTMLTableElementTHeadGetter(ExecState& state, JSHTMLTableElement& thisObject, ThrowScope& throwScope) |
| 268 | { |
| 269 | UNUSED_PARAM(throwScope); |
| 270 | UNUSED_PARAM(state); |
| 271 | auto& impl = thisObject.wrapped(); |
| 272 | JSValue result = toJS<IDLNullable<IDLInterface<HTMLTableSectionElement>>>(state, *thisObject.globalObject(), throwScope, impl.tHead()); |
| 273 | return result; |
| 274 | } |
| 275 | |
| 276 | EncodedJSValue jsHTMLTableElementTHead(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 277 | { |
| 278 | return IDLAttribute<JSHTMLTableElement>::get<jsHTMLTableElementTHeadGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "tHead" ); |
| 279 | } |
| 280 | |
| 281 | static inline bool setJSHTMLTableElementTHeadSetter(ExecState& state, JSHTMLTableElement& thisObject, JSValue value, ThrowScope& throwScope) |
| 282 | { |
| 283 | UNUSED_PARAM(throwScope); |
| 284 | CustomElementReactionStack customElementReactionStack(state); |
| 285 | auto& impl = thisObject.wrapped(); |
| 286 | auto nativeValue = convert<IDLNullable<IDLInterface<HTMLTableSectionElement>>>(state, value, [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwAttributeTypeError(state, scope, "HTMLTableElement" , "tHead" , "HTMLTableSectionElement" ); }); |
| 287 | RETURN_IF_EXCEPTION(throwScope, false); |
| 288 | AttributeSetter::call(state, throwScope, [&] { |
| 289 | return impl.setTHead(WTFMove(nativeValue)); |
| 290 | }); |
| 291 | return true; |
| 292 | } |
| 293 | |
| 294 | bool setJSHTMLTableElementTHead(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| 295 | { |
| 296 | return IDLAttribute<JSHTMLTableElement>::set<setJSHTMLTableElementTHeadSetter>(*state, thisValue, encodedValue, "tHead" ); |
| 297 | } |
| 298 | |
| 299 | static inline JSValue (ExecState& state, JSHTMLTableElement& thisObject, ThrowScope& throwScope) |
| 300 | { |
| 301 | UNUSED_PARAM(throwScope); |
| 302 | UNUSED_PARAM(state); |
| 303 | auto& impl = thisObject.wrapped(); |
| 304 | JSValue result = toJS<IDLNullable<IDLInterface<HTMLTableSectionElement>>>(state, *thisObject.globalObject(), throwScope, impl.tFoot()); |
| 305 | return result; |
| 306 | } |
| 307 | |
| 308 | EncodedJSValue (ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 309 | { |
| 310 | return IDLAttribute<JSHTMLTableElement>::get<jsHTMLTableElementTFootGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "tFoot" ); |
| 311 | } |
| 312 | |
| 313 | static inline bool (ExecState& state, JSHTMLTableElement& thisObject, JSValue value, ThrowScope& throwScope) |
| 314 | { |
| 315 | UNUSED_PARAM(throwScope); |
| 316 | CustomElementReactionStack customElementReactionStack(state); |
| 317 | auto& impl = thisObject.wrapped(); |
| 318 | auto nativeValue = convert<IDLNullable<IDLInterface<HTMLTableSectionElement>>>(state, value, [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwAttributeTypeError(state, scope, "HTMLTableElement" , "tFoot" , "HTMLTableSectionElement" ); }); |
| 319 | RETURN_IF_EXCEPTION(throwScope, false); |
| 320 | AttributeSetter::call(state, throwScope, [&] { |
| 321 | return impl.setTFoot(WTFMove(nativeValue)); |
| 322 | }); |
| 323 | return true; |
| 324 | } |
| 325 | |
| 326 | bool (ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| 327 | { |
| 328 | return IDLAttribute<JSHTMLTableElement>::set<setJSHTMLTableElementTFootSetter>(*state, thisValue, encodedValue, "tFoot" ); |
| 329 | } |
| 330 | |
| 331 | static inline JSValue jsHTMLTableElementRowsGetter(ExecState& state, JSHTMLTableElement& thisObject, ThrowScope& throwScope) |
| 332 | { |
| 333 | UNUSED_PARAM(throwScope); |
| 334 | UNUSED_PARAM(state); |
| 335 | auto& impl = thisObject.wrapped(); |
| 336 | JSValue result = toJS<IDLInterface<HTMLCollection>>(state, *thisObject.globalObject(), throwScope, impl.rows()); |
| 337 | return result; |
| 338 | } |
| 339 | |
| 340 | EncodedJSValue jsHTMLTableElementRows(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 341 | { |
| 342 | return IDLAttribute<JSHTMLTableElement>::get<jsHTMLTableElementRowsGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "rows" ); |
| 343 | } |
| 344 | |
| 345 | static inline JSValue jsHTMLTableElementTBodiesGetter(ExecState& state, JSHTMLTableElement& thisObject, ThrowScope& throwScope) |
| 346 | { |
| 347 | UNUSED_PARAM(throwScope); |
| 348 | UNUSED_PARAM(state); |
| 349 | auto& impl = thisObject.wrapped(); |
| 350 | JSValue result = toJS<IDLInterface<HTMLCollection>>(state, *thisObject.globalObject(), throwScope, impl.tBodies()); |
| 351 | return result; |
| 352 | } |
| 353 | |
| 354 | EncodedJSValue jsHTMLTableElementTBodies(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 355 | { |
| 356 | return IDLAttribute<JSHTMLTableElement>::get<jsHTMLTableElementTBodiesGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "tBodies" ); |
| 357 | } |
| 358 | |
| 359 | static inline JSValue jsHTMLTableElementAlignGetter(ExecState& state, JSHTMLTableElement& thisObject, ThrowScope& throwScope) |
| 360 | { |
| 361 | UNUSED_PARAM(throwScope); |
| 362 | UNUSED_PARAM(state); |
| 363 | auto& impl = thisObject.wrapped(); |
| 364 | JSValue result = toJS<IDLDOMString>(state, throwScope, impl.attributeWithoutSynchronization(WebCore::HTMLNames::alignAttr)); |
| 365 | return result; |
| 366 | } |
| 367 | |
| 368 | EncodedJSValue jsHTMLTableElementAlign(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 369 | { |
| 370 | return IDLAttribute<JSHTMLTableElement>::get<jsHTMLTableElementAlignGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "align" ); |
| 371 | } |
| 372 | |
| 373 | static inline bool setJSHTMLTableElementAlignSetter(ExecState& state, JSHTMLTableElement& thisObject, JSValue value, ThrowScope& throwScope) |
| 374 | { |
| 375 | UNUSED_PARAM(throwScope); |
| 376 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
| 377 | auto& impl = thisObject.wrapped(); |
| 378 | auto nativeValue = convert<IDLDOMString>(state, value); |
| 379 | RETURN_IF_EXCEPTION(throwScope, false); |
| 380 | AttributeSetter::call(state, throwScope, [&] { |
| 381 | return impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::alignAttr, WTFMove(nativeValue)); |
| 382 | }); |
| 383 | return true; |
| 384 | } |
| 385 | |
| 386 | bool setJSHTMLTableElementAlign(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| 387 | { |
| 388 | return IDLAttribute<JSHTMLTableElement>::set<setJSHTMLTableElementAlignSetter>(*state, thisValue, encodedValue, "align" ); |
| 389 | } |
| 390 | |
| 391 | static inline JSValue jsHTMLTableElementBgColorGetter(ExecState& state, JSHTMLTableElement& thisObject, ThrowScope& throwScope) |
| 392 | { |
| 393 | UNUSED_PARAM(throwScope); |
| 394 | UNUSED_PARAM(state); |
| 395 | auto& impl = thisObject.wrapped(); |
| 396 | JSValue result = toJS<IDLTreatNullAsEmptyAdaptor<IDLDOMString>>(state, throwScope, impl.attributeWithoutSynchronization(WebCore::HTMLNames::bgcolorAttr)); |
| 397 | return result; |
| 398 | } |
| 399 | |
| 400 | EncodedJSValue jsHTMLTableElementBgColor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 401 | { |
| 402 | return IDLAttribute<JSHTMLTableElement>::get<jsHTMLTableElementBgColorGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "bgColor" ); |
| 403 | } |
| 404 | |
| 405 | static inline bool setJSHTMLTableElementBgColorSetter(ExecState& state, JSHTMLTableElement& thisObject, JSValue value, ThrowScope& throwScope) |
| 406 | { |
| 407 | UNUSED_PARAM(throwScope); |
| 408 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
| 409 | auto& impl = thisObject.wrapped(); |
| 410 | auto nativeValue = convert<IDLTreatNullAsEmptyAdaptor<IDLDOMString>>(state, value); |
| 411 | RETURN_IF_EXCEPTION(throwScope, false); |
| 412 | AttributeSetter::call(state, throwScope, [&] { |
| 413 | return impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::bgcolorAttr, WTFMove(nativeValue)); |
| 414 | }); |
| 415 | return true; |
| 416 | } |
| 417 | |
| 418 | bool setJSHTMLTableElementBgColor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| 419 | { |
| 420 | return IDLAttribute<JSHTMLTableElement>::set<setJSHTMLTableElementBgColorSetter>(*state, thisValue, encodedValue, "bgColor" ); |
| 421 | } |
| 422 | |
| 423 | static inline JSValue jsHTMLTableElementBorderGetter(ExecState& state, JSHTMLTableElement& thisObject, ThrowScope& throwScope) |
| 424 | { |
| 425 | UNUSED_PARAM(throwScope); |
| 426 | UNUSED_PARAM(state); |
| 427 | auto& impl = thisObject.wrapped(); |
| 428 | JSValue result = toJS<IDLDOMString>(state, throwScope, impl.attributeWithoutSynchronization(WebCore::HTMLNames::borderAttr)); |
| 429 | return result; |
| 430 | } |
| 431 | |
| 432 | EncodedJSValue jsHTMLTableElementBorder(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 433 | { |
| 434 | return IDLAttribute<JSHTMLTableElement>::get<jsHTMLTableElementBorderGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "border" ); |
| 435 | } |
| 436 | |
| 437 | static inline bool setJSHTMLTableElementBorderSetter(ExecState& state, JSHTMLTableElement& thisObject, JSValue value, ThrowScope& throwScope) |
| 438 | { |
| 439 | UNUSED_PARAM(throwScope); |
| 440 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
| 441 | auto& impl = thisObject.wrapped(); |
| 442 | auto nativeValue = convert<IDLDOMString>(state, value); |
| 443 | RETURN_IF_EXCEPTION(throwScope, false); |
| 444 | AttributeSetter::call(state, throwScope, [&] { |
| 445 | return impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::borderAttr, WTFMove(nativeValue)); |
| 446 | }); |
| 447 | return true; |
| 448 | } |
| 449 | |
| 450 | bool setJSHTMLTableElementBorder(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| 451 | { |
| 452 | return IDLAttribute<JSHTMLTableElement>::set<setJSHTMLTableElementBorderSetter>(*state, thisValue, encodedValue, "border" ); |
| 453 | } |
| 454 | |
| 455 | static inline JSValue jsHTMLTableElementCellPaddingGetter(ExecState& state, JSHTMLTableElement& thisObject, ThrowScope& throwScope) |
| 456 | { |
| 457 | UNUSED_PARAM(throwScope); |
| 458 | UNUSED_PARAM(state); |
| 459 | auto& impl = thisObject.wrapped(); |
| 460 | JSValue result = toJS<IDLTreatNullAsEmptyAdaptor<IDLDOMString>>(state, throwScope, impl.attributeWithoutSynchronization(WebCore::HTMLNames::cellpaddingAttr)); |
| 461 | return result; |
| 462 | } |
| 463 | |
| 464 | EncodedJSValue jsHTMLTableElementCellPadding(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 465 | { |
| 466 | return IDLAttribute<JSHTMLTableElement>::get<jsHTMLTableElementCellPaddingGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "cellPadding" ); |
| 467 | } |
| 468 | |
| 469 | static inline bool setJSHTMLTableElementCellPaddingSetter(ExecState& state, JSHTMLTableElement& thisObject, JSValue value, ThrowScope& throwScope) |
| 470 | { |
| 471 | UNUSED_PARAM(throwScope); |
| 472 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
| 473 | auto& impl = thisObject.wrapped(); |
| 474 | auto nativeValue = convert<IDLTreatNullAsEmptyAdaptor<IDLDOMString>>(state, value); |
| 475 | RETURN_IF_EXCEPTION(throwScope, false); |
| 476 | AttributeSetter::call(state, throwScope, [&] { |
| 477 | return impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::cellpaddingAttr, WTFMove(nativeValue)); |
| 478 | }); |
| 479 | return true; |
| 480 | } |
| 481 | |
| 482 | bool setJSHTMLTableElementCellPadding(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| 483 | { |
| 484 | return IDLAttribute<JSHTMLTableElement>::set<setJSHTMLTableElementCellPaddingSetter>(*state, thisValue, encodedValue, "cellPadding" ); |
| 485 | } |
| 486 | |
| 487 | static inline JSValue jsHTMLTableElementCellSpacingGetter(ExecState& state, JSHTMLTableElement& thisObject, ThrowScope& throwScope) |
| 488 | { |
| 489 | UNUSED_PARAM(throwScope); |
| 490 | UNUSED_PARAM(state); |
| 491 | auto& impl = thisObject.wrapped(); |
| 492 | JSValue result = toJS<IDLTreatNullAsEmptyAdaptor<IDLDOMString>>(state, throwScope, impl.attributeWithoutSynchronization(WebCore::HTMLNames::cellspacingAttr)); |
| 493 | return result; |
| 494 | } |
| 495 | |
| 496 | EncodedJSValue jsHTMLTableElementCellSpacing(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 497 | { |
| 498 | return IDLAttribute<JSHTMLTableElement>::get<jsHTMLTableElementCellSpacingGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "cellSpacing" ); |
| 499 | } |
| 500 | |
| 501 | static inline bool setJSHTMLTableElementCellSpacingSetter(ExecState& state, JSHTMLTableElement& thisObject, JSValue value, ThrowScope& throwScope) |
| 502 | { |
| 503 | UNUSED_PARAM(throwScope); |
| 504 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
| 505 | auto& impl = thisObject.wrapped(); |
| 506 | auto nativeValue = convert<IDLTreatNullAsEmptyAdaptor<IDLDOMString>>(state, value); |
| 507 | RETURN_IF_EXCEPTION(throwScope, false); |
| 508 | AttributeSetter::call(state, throwScope, [&] { |
| 509 | return impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::cellspacingAttr, WTFMove(nativeValue)); |
| 510 | }); |
| 511 | return true; |
| 512 | } |
| 513 | |
| 514 | bool setJSHTMLTableElementCellSpacing(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| 515 | { |
| 516 | return IDLAttribute<JSHTMLTableElement>::set<setJSHTMLTableElementCellSpacingSetter>(*state, thisValue, encodedValue, "cellSpacing" ); |
| 517 | } |
| 518 | |
| 519 | static inline JSValue jsHTMLTableElementFrameGetter(ExecState& state, JSHTMLTableElement& thisObject, ThrowScope& throwScope) |
| 520 | { |
| 521 | UNUSED_PARAM(throwScope); |
| 522 | UNUSED_PARAM(state); |
| 523 | auto& impl = thisObject.wrapped(); |
| 524 | JSValue result = toJS<IDLDOMString>(state, throwScope, impl.attributeWithoutSynchronization(WebCore::HTMLNames::frameAttr)); |
| 525 | return result; |
| 526 | } |
| 527 | |
| 528 | EncodedJSValue jsHTMLTableElementFrame(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 529 | { |
| 530 | return IDLAttribute<JSHTMLTableElement>::get<jsHTMLTableElementFrameGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "frame" ); |
| 531 | } |
| 532 | |
| 533 | static inline bool setJSHTMLTableElementFrameSetter(ExecState& state, JSHTMLTableElement& thisObject, JSValue value, ThrowScope& throwScope) |
| 534 | { |
| 535 | UNUSED_PARAM(throwScope); |
| 536 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
| 537 | auto& impl = thisObject.wrapped(); |
| 538 | auto nativeValue = convert<IDLDOMString>(state, value); |
| 539 | RETURN_IF_EXCEPTION(throwScope, false); |
| 540 | AttributeSetter::call(state, throwScope, [&] { |
| 541 | return impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::frameAttr, WTFMove(nativeValue)); |
| 542 | }); |
| 543 | return true; |
| 544 | } |
| 545 | |
| 546 | bool setJSHTMLTableElementFrame(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| 547 | { |
| 548 | return IDLAttribute<JSHTMLTableElement>::set<setJSHTMLTableElementFrameSetter>(*state, thisValue, encodedValue, "frame" ); |
| 549 | } |
| 550 | |
| 551 | static inline JSValue jsHTMLTableElementRulesGetter(ExecState& state, JSHTMLTableElement& thisObject, ThrowScope& throwScope) |
| 552 | { |
| 553 | UNUSED_PARAM(throwScope); |
| 554 | UNUSED_PARAM(state); |
| 555 | auto& impl = thisObject.wrapped(); |
| 556 | JSValue result = toJS<IDLDOMString>(state, throwScope, impl.attributeWithoutSynchronization(WebCore::HTMLNames::rulesAttr)); |
| 557 | return result; |
| 558 | } |
| 559 | |
| 560 | EncodedJSValue jsHTMLTableElementRules(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 561 | { |
| 562 | return IDLAttribute<JSHTMLTableElement>::get<jsHTMLTableElementRulesGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "rules" ); |
| 563 | } |
| 564 | |
| 565 | static inline bool setJSHTMLTableElementRulesSetter(ExecState& state, JSHTMLTableElement& thisObject, JSValue value, ThrowScope& throwScope) |
| 566 | { |
| 567 | UNUSED_PARAM(throwScope); |
| 568 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
| 569 | auto& impl = thisObject.wrapped(); |
| 570 | auto nativeValue = convert<IDLDOMString>(state, value); |
| 571 | RETURN_IF_EXCEPTION(throwScope, false); |
| 572 | AttributeSetter::call(state, throwScope, [&] { |
| 573 | return impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::rulesAttr, WTFMove(nativeValue)); |
| 574 | }); |
| 575 | return true; |
| 576 | } |
| 577 | |
| 578 | bool setJSHTMLTableElementRules(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| 579 | { |
| 580 | return IDLAttribute<JSHTMLTableElement>::set<setJSHTMLTableElementRulesSetter>(*state, thisValue, encodedValue, "rules" ); |
| 581 | } |
| 582 | |
| 583 | static inline JSValue jsHTMLTableElementSummaryGetter(ExecState& state, JSHTMLTableElement& thisObject, ThrowScope& throwScope) |
| 584 | { |
| 585 | UNUSED_PARAM(throwScope); |
| 586 | UNUSED_PARAM(state); |
| 587 | auto& impl = thisObject.wrapped(); |
| 588 | JSValue result = toJS<IDLDOMString>(state, throwScope, impl.attributeWithoutSynchronization(WebCore::HTMLNames::summaryAttr)); |
| 589 | return result; |
| 590 | } |
| 591 | |
| 592 | EncodedJSValue jsHTMLTableElementSummary(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 593 | { |
| 594 | return IDLAttribute<JSHTMLTableElement>::get<jsHTMLTableElementSummaryGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "summary" ); |
| 595 | } |
| 596 | |
| 597 | static inline bool setJSHTMLTableElementSummarySetter(ExecState& state, JSHTMLTableElement& thisObject, JSValue value, ThrowScope& throwScope) |
| 598 | { |
| 599 | UNUSED_PARAM(throwScope); |
| 600 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
| 601 | auto& impl = thisObject.wrapped(); |
| 602 | auto nativeValue = convert<IDLDOMString>(state, value); |
| 603 | RETURN_IF_EXCEPTION(throwScope, false); |
| 604 | AttributeSetter::call(state, throwScope, [&] { |
| 605 | return impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::summaryAttr, WTFMove(nativeValue)); |
| 606 | }); |
| 607 | return true; |
| 608 | } |
| 609 | |
| 610 | bool setJSHTMLTableElementSummary(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| 611 | { |
| 612 | return IDLAttribute<JSHTMLTableElement>::set<setJSHTMLTableElementSummarySetter>(*state, thisValue, encodedValue, "summary" ); |
| 613 | } |
| 614 | |
| 615 | static inline JSValue jsHTMLTableElementWidthGetter(ExecState& state, JSHTMLTableElement& thisObject, ThrowScope& throwScope) |
| 616 | { |
| 617 | UNUSED_PARAM(throwScope); |
| 618 | UNUSED_PARAM(state); |
| 619 | auto& impl = thisObject.wrapped(); |
| 620 | JSValue result = toJS<IDLDOMString>(state, throwScope, impl.attributeWithoutSynchronization(WebCore::HTMLNames::widthAttr)); |
| 621 | return result; |
| 622 | } |
| 623 | |
| 624 | EncodedJSValue jsHTMLTableElementWidth(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| 625 | { |
| 626 | return IDLAttribute<JSHTMLTableElement>::get<jsHTMLTableElementWidthGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "width" ); |
| 627 | } |
| 628 | |
| 629 | static inline bool setJSHTMLTableElementWidthSetter(ExecState& state, JSHTMLTableElement& thisObject, JSValue value, ThrowScope& throwScope) |
| 630 | { |
| 631 | UNUSED_PARAM(throwScope); |
| 632 | CustomElementReactionDisallowedScope customElementReactionDisallowedScope; |
| 633 | auto& impl = thisObject.wrapped(); |
| 634 | auto nativeValue = convert<IDLDOMString>(state, value); |
| 635 | RETURN_IF_EXCEPTION(throwScope, false); |
| 636 | AttributeSetter::call(state, throwScope, [&] { |
| 637 | return impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::widthAttr, WTFMove(nativeValue)); |
| 638 | }); |
| 639 | return true; |
| 640 | } |
| 641 | |
| 642 | bool setJSHTMLTableElementWidth(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| 643 | { |
| 644 | return IDLAttribute<JSHTMLTableElement>::set<setJSHTMLTableElementWidthSetter>(*state, thisValue, encodedValue, "width" ); |
| 645 | } |
| 646 | |
| 647 | static inline JSC::EncodedJSValue jsHTMLTableElementPrototypeFunctionCreateTHeadBody(JSC::ExecState* state, typename IDLOperation<JSHTMLTableElement>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 648 | { |
| 649 | UNUSED_PARAM(state); |
| 650 | UNUSED_PARAM(throwScope); |
| 651 | auto& impl = castedThis->wrapped(); |
| 652 | return JSValue::encode(toJS<IDLInterface<HTMLElement>>(*state, *castedThis->globalObject(), impl.createTHead())); |
| 653 | } |
| 654 | |
| 655 | EncodedJSValue JSC_HOST_CALL jsHTMLTableElementPrototypeFunctionCreateTHead(ExecState* state) |
| 656 | { |
| 657 | return IDLOperation<JSHTMLTableElement>::call<jsHTMLTableElementPrototypeFunctionCreateTHeadBody>(*state, "createTHead" ); |
| 658 | } |
| 659 | |
| 660 | static inline JSC::EncodedJSValue jsHTMLTableElementPrototypeFunctionDeleteTHeadBody(JSC::ExecState* state, typename IDLOperation<JSHTMLTableElement>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 661 | { |
| 662 | UNUSED_PARAM(state); |
| 663 | UNUSED_PARAM(throwScope); |
| 664 | CustomElementReactionStack customElementReactionStack(*state); |
| 665 | auto& impl = castedThis->wrapped(); |
| 666 | impl.deleteTHead(); |
| 667 | return JSValue::encode(jsUndefined()); |
| 668 | } |
| 669 | |
| 670 | EncodedJSValue JSC_HOST_CALL jsHTMLTableElementPrototypeFunctionDeleteTHead(ExecState* state) |
| 671 | { |
| 672 | return IDLOperation<JSHTMLTableElement>::call<jsHTMLTableElementPrototypeFunctionDeleteTHeadBody>(*state, "deleteTHead" ); |
| 673 | } |
| 674 | |
| 675 | static inline JSC::EncodedJSValue jsHTMLTableElementPrototypeFunctionCreateTFootBody(JSC::ExecState* state, typename IDLOperation<JSHTMLTableElement>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 676 | { |
| 677 | UNUSED_PARAM(state); |
| 678 | UNUSED_PARAM(throwScope); |
| 679 | auto& impl = castedThis->wrapped(); |
| 680 | return JSValue::encode(toJS<IDLInterface<HTMLElement>>(*state, *castedThis->globalObject(), impl.createTFoot())); |
| 681 | } |
| 682 | |
| 683 | EncodedJSValue JSC_HOST_CALL (ExecState* state) |
| 684 | { |
| 685 | return IDLOperation<JSHTMLTableElement>::call<jsHTMLTableElementPrototypeFunctionCreateTFootBody>(*state, "createTFoot" ); |
| 686 | } |
| 687 | |
| 688 | static inline JSC::EncodedJSValue jsHTMLTableElementPrototypeFunctionDeleteTFootBody(JSC::ExecState* state, typename IDLOperation<JSHTMLTableElement>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 689 | { |
| 690 | UNUSED_PARAM(state); |
| 691 | UNUSED_PARAM(throwScope); |
| 692 | CustomElementReactionStack customElementReactionStack(*state); |
| 693 | auto& impl = castedThis->wrapped(); |
| 694 | impl.deleteTFoot(); |
| 695 | return JSValue::encode(jsUndefined()); |
| 696 | } |
| 697 | |
| 698 | EncodedJSValue JSC_HOST_CALL (ExecState* state) |
| 699 | { |
| 700 | return IDLOperation<JSHTMLTableElement>::call<jsHTMLTableElementPrototypeFunctionDeleteTFootBody>(*state, "deleteTFoot" ); |
| 701 | } |
| 702 | |
| 703 | static inline JSC::EncodedJSValue jsHTMLTableElementPrototypeFunctionCreateTBodyBody(JSC::ExecState* state, typename IDLOperation<JSHTMLTableElement>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 704 | { |
| 705 | UNUSED_PARAM(state); |
| 706 | UNUSED_PARAM(throwScope); |
| 707 | auto& impl = castedThis->wrapped(); |
| 708 | return JSValue::encode(toJS<IDLInterface<HTMLElement>>(*state, *castedThis->globalObject(), impl.createTBody())); |
| 709 | } |
| 710 | |
| 711 | EncodedJSValue JSC_HOST_CALL jsHTMLTableElementPrototypeFunctionCreateTBody(ExecState* state) |
| 712 | { |
| 713 | return IDLOperation<JSHTMLTableElement>::call<jsHTMLTableElementPrototypeFunctionCreateTBodyBody>(*state, "createTBody" ); |
| 714 | } |
| 715 | |
| 716 | static inline JSC::EncodedJSValue jsHTMLTableElementPrototypeFunctionCreateCaptionBody(JSC::ExecState* state, typename IDLOperation<JSHTMLTableElement>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 717 | { |
| 718 | UNUSED_PARAM(state); |
| 719 | UNUSED_PARAM(throwScope); |
| 720 | auto& impl = castedThis->wrapped(); |
| 721 | return JSValue::encode(toJS<IDLInterface<HTMLElement>>(*state, *castedThis->globalObject(), impl.createCaption())); |
| 722 | } |
| 723 | |
| 724 | EncodedJSValue JSC_HOST_CALL jsHTMLTableElementPrototypeFunctionCreateCaption(ExecState* state) |
| 725 | { |
| 726 | return IDLOperation<JSHTMLTableElement>::call<jsHTMLTableElementPrototypeFunctionCreateCaptionBody>(*state, "createCaption" ); |
| 727 | } |
| 728 | |
| 729 | static inline JSC::EncodedJSValue jsHTMLTableElementPrototypeFunctionDeleteCaptionBody(JSC::ExecState* state, typename IDLOperation<JSHTMLTableElement>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 730 | { |
| 731 | UNUSED_PARAM(state); |
| 732 | UNUSED_PARAM(throwScope); |
| 733 | CustomElementReactionStack customElementReactionStack(*state); |
| 734 | auto& impl = castedThis->wrapped(); |
| 735 | impl.deleteCaption(); |
| 736 | return JSValue::encode(jsUndefined()); |
| 737 | } |
| 738 | |
| 739 | EncodedJSValue JSC_HOST_CALL jsHTMLTableElementPrototypeFunctionDeleteCaption(ExecState* state) |
| 740 | { |
| 741 | return IDLOperation<JSHTMLTableElement>::call<jsHTMLTableElementPrototypeFunctionDeleteCaptionBody>(*state, "deleteCaption" ); |
| 742 | } |
| 743 | |
| 744 | static inline JSC::EncodedJSValue jsHTMLTableElementPrototypeFunctionInsertRowBody(JSC::ExecState* state, typename IDLOperation<JSHTMLTableElement>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 745 | { |
| 746 | UNUSED_PARAM(state); |
| 747 | UNUSED_PARAM(throwScope); |
| 748 | auto& impl = castedThis->wrapped(); |
| 749 | auto index = state->argument(0).isUndefined() ? -1 : convert<IDLLong>(*state, state->uncheckedArgument(0)); |
| 750 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 751 | return JSValue::encode(toJS<IDLInterface<HTMLElement>>(*state, *castedThis->globalObject(), throwScope, impl.insertRow(WTFMove(index)))); |
| 752 | } |
| 753 | |
| 754 | EncodedJSValue JSC_HOST_CALL jsHTMLTableElementPrototypeFunctionInsertRow(ExecState* state) |
| 755 | { |
| 756 | return IDLOperation<JSHTMLTableElement>::call<jsHTMLTableElementPrototypeFunctionInsertRowBody>(*state, "insertRow" ); |
| 757 | } |
| 758 | |
| 759 | static inline JSC::EncodedJSValue jsHTMLTableElementPrototypeFunctionDeleteRowBody(JSC::ExecState* state, typename IDLOperation<JSHTMLTableElement>::ClassParameter castedThis, JSC::ThrowScope& throwScope) |
| 760 | { |
| 761 | UNUSED_PARAM(state); |
| 762 | UNUSED_PARAM(throwScope); |
| 763 | CustomElementReactionStack customElementReactionStack(*state); |
| 764 | auto& impl = castedThis->wrapped(); |
| 765 | if (UNLIKELY(state->argumentCount() < 1)) |
| 766 | return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| 767 | auto index = convert<IDLLong>(*state, state->uncheckedArgument(0)); |
| 768 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 769 | propagateException(*state, throwScope, impl.deleteRow(WTFMove(index))); |
| 770 | return JSValue::encode(jsUndefined()); |
| 771 | } |
| 772 | |
| 773 | EncodedJSValue JSC_HOST_CALL jsHTMLTableElementPrototypeFunctionDeleteRow(ExecState* state) |
| 774 | { |
| 775 | return IDLOperation<JSHTMLTableElement>::call<jsHTMLTableElementPrototypeFunctionDeleteRowBody>(*state, "deleteRow" ); |
| 776 | } |
| 777 | |
| 778 | void JSHTMLTableElement::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) |
| 779 | { |
| 780 | auto* thisObject = jsCast<JSHTMLTableElement*>(cell); |
| 781 | builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); |
| 782 | if (thisObject->scriptExecutionContext()) |
| 783 | builder.setLabelForCell(cell, "url " + thisObject->scriptExecutionContext()->url().string()); |
| 784 | Base::heapSnapshot(cell, builder); |
| 785 | } |
| 786 | |
| 787 | |
| 788 | } |
| 789 | |