| /* |
| This file is part of the WebKit open source project. |
| This file has been generated by generate-bindings.pl. DO NOT MODIFY! |
| |
| This library is free software; you can redistribute it and/or |
| modify it under the terms of the GNU Library General Public |
| License as published by the Free Software Foundation; either |
| version 2 of the License, or (at your option) any later version. |
| |
| This library is distributed in the hope that it will be useful, |
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| Library General Public License for more details. |
| |
| You should have received a copy of the GNU Library General Public License |
| along with this library; see the file COPYING.LIB. If not, write to |
| the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| Boston, MA 02110-1301, USA. |
| */ |
| |
| #include "config.h" |
| #include "JSHTMLFrameElement.h" |
| |
| #include "ExceptionCode.h" |
| #include "HTMLNames.h" |
| #include "JSDOMBinding.h" |
| #include "JSDOMConstructor.h" |
| #include "JSDOMWindow.h" |
| #include "JSDocument.h" |
| #include "JSSVGDocument.h" |
| #include "SVGDocument.h" |
| #include "URL.h" |
| #include <runtime/Error.h> |
| #include <runtime/JSString.h> |
| #include <wtf/GetPtr.h> |
| |
| using namespace JSC; |
| |
| namespace WebCore { |
| |
| // Functions |
| |
| JSC::EncodedJSValue JSC_HOST_CALL jsHTMLFrameElementPrototypeFunctionGetSVGDocument(JSC::ExecState*); |
| |
| // Attributes |
| |
| JSC::EncodedJSValue jsHTMLFrameElementFrameBorder(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSHTMLFrameElementFrameBorder(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| JSC::EncodedJSValue jsHTMLFrameElementLongDesc(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSHTMLFrameElementLongDesc(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| JSC::EncodedJSValue jsHTMLFrameElementMarginHeight(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSHTMLFrameElementMarginHeight(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| JSC::EncodedJSValue jsHTMLFrameElementMarginWidth(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSHTMLFrameElementMarginWidth(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| JSC::EncodedJSValue jsHTMLFrameElementName(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSHTMLFrameElementName(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| JSC::EncodedJSValue jsHTMLFrameElementNoResize(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSHTMLFrameElementNoResize(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| JSC::EncodedJSValue jsHTMLFrameElementScrolling(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSHTMLFrameElementScrolling(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| JSC::EncodedJSValue jsHTMLFrameElementSrc(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSHTMLFrameElementSrc(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| JSC::EncodedJSValue jsHTMLFrameElementContentDocument(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| JSC::EncodedJSValue jsHTMLFrameElementContentWindow(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| JSC::EncodedJSValue jsHTMLFrameElementLocation(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSHTMLFrameElementLocation(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| JSC::EncodedJSValue jsHTMLFrameElementWidth(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| JSC::EncodedJSValue jsHTMLFrameElementHeight(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| JSC::EncodedJSValue jsHTMLFrameElementConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSHTMLFrameElementConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| |
| class JSHTMLFrameElementPrototype : public JSC::JSNonFinalObject { |
| public: |
| typedef JSC::JSNonFinalObject Base; |
| static JSHTMLFrameElementPrototype* create(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::Structure* structure) |
| { |
| JSHTMLFrameElementPrototype* ptr = new (NotNull, JSC::allocateCell<JSHTMLFrameElementPrototype>(vm.heap)) JSHTMLFrameElementPrototype(vm, globalObject, structure); |
| ptr->finishCreation(vm); |
| return ptr; |
| } |
| |
| DECLARE_INFO; |
| static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) |
| { |
| return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info()); |
| } |
| |
| private: |
| JSHTMLFrameElementPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure) |
| : JSC::JSNonFinalObject(vm, structure) |
| { |
| } |
| |
| void finishCreation(JSC::VM&); |
| }; |
| |
| typedef JSDOMConstructorNotConstructable<JSHTMLFrameElement> JSHTMLFrameElementConstructor; |
| |
| template<> JSValue JSHTMLFrameElementConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject) |
| { |
| return JSHTMLElement::getConstructor(vm, &globalObject); |
| } |
| |
| template<> void JSHTMLFrameElementConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject) |
| { |
| putDirect(vm, vm.propertyNames->prototype, JSHTMLFrameElement::prototype(vm, &globalObject), DontDelete | ReadOnly | DontEnum); |
| putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String(ASCIILiteral("HTMLFrameElement"))), ReadOnly | DontEnum); |
| putDirect(vm, vm.propertyNames->length, jsNumber(0), ReadOnly | DontEnum); |
| } |
| |
| template<> const ClassInfo JSHTMLFrameElementConstructor::s_info = { "HTMLFrameElement", &Base::s_info, 0, CREATE_METHOD_TABLE(JSHTMLFrameElementConstructor) }; |
| |
| /* Hash table for prototype */ |
| |
| static const HashTableValue JSHTMLFrameElementPrototypeTableValues[] = |
| { |
| { "constructor", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLFrameElementConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLFrameElementConstructor) } }, |
| { "frameBorder", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLFrameElementFrameBorder), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLFrameElementFrameBorder) } }, |
| { "longDesc", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLFrameElementLongDesc), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLFrameElementLongDesc) } }, |
| { "marginHeight", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLFrameElementMarginHeight), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLFrameElementMarginHeight) } }, |
| { "marginWidth", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLFrameElementMarginWidth), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLFrameElementMarginWidth) } }, |
| { "name", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLFrameElementName), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLFrameElementName) } }, |
| { "noResize", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLFrameElementNoResize), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLFrameElementNoResize) } }, |
| { "scrolling", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLFrameElementScrolling), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLFrameElementScrolling) } }, |
| { "src", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLFrameElementSrc), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLFrameElementSrc) } }, |
| { "contentDocument", ReadOnly | CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLFrameElementContentDocument), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
| { "contentWindow", ReadOnly | CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLFrameElementContentWindow), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
| { "location", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLFrameElementLocation), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSHTMLFrameElementLocation) } }, |
| { "width", ReadOnly | CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLFrameElementWidth), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
| { "height", ReadOnly | CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLFrameElementHeight), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
| { "getSVGDocument", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsHTMLFrameElementPrototypeFunctionGetSVGDocument), (intptr_t) (0) } }, |
| }; |
| |
| const ClassInfo JSHTMLFrameElementPrototype::s_info = { "HTMLFrameElementPrototype", &Base::s_info, 0, CREATE_METHOD_TABLE(JSHTMLFrameElementPrototype) }; |
| |
| void JSHTMLFrameElementPrototype::finishCreation(VM& vm) |
| { |
| Base::finishCreation(vm); |
| reifyStaticProperties(vm, JSHTMLFrameElementPrototypeTableValues, *this); |
| } |
| |
| const ClassInfo JSHTMLFrameElement::s_info = { "HTMLFrameElement", &Base::s_info, 0, CREATE_METHOD_TABLE(JSHTMLFrameElement) }; |
| |
| JSHTMLFrameElement::JSHTMLFrameElement(Structure* structure, JSDOMGlobalObject& globalObject, Ref<HTMLFrameElement>&& impl) |
| : JSHTMLElement(structure, globalObject, WTFMove(impl)) |
| { |
| } |
| |
| JSObject* JSHTMLFrameElement::createPrototype(VM& vm, JSGlobalObject* globalObject) |
| { |
| return JSHTMLFrameElementPrototype::create(vm, globalObject, JSHTMLFrameElementPrototype::createStructure(vm, globalObject, JSHTMLElement::prototype(vm, globalObject))); |
| } |
| |
| JSObject* JSHTMLFrameElement::prototype(VM& vm, JSGlobalObject* globalObject) |
| { |
| return getDOMPrototype<JSHTMLFrameElement>(vm, globalObject); |
| } |
| |
| EncodedJSValue jsHTMLFrameElementFrameBorder(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = jsDynamicCast<JSHTMLFrameElement*>(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "HTMLFrameElement", "frameBorder"); |
| } |
| auto& impl = castedThis->wrapped(); |
| JSValue result = jsStringWithCache(state, impl.attributeWithoutSynchronization(WebCore::HTMLNames::frameborderAttr)); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsHTMLFrameElementLongDesc(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = jsDynamicCast<JSHTMLFrameElement*>(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "HTMLFrameElement", "longDesc"); |
| } |
| auto& impl = castedThis->wrapped(); |
| JSValue result = jsStringWithCache(state, impl.getURLAttribute(WebCore::HTMLNames::longdescAttr)); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsHTMLFrameElementMarginHeight(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = jsDynamicCast<JSHTMLFrameElement*>(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "HTMLFrameElement", "marginHeight"); |
| } |
| auto& impl = castedThis->wrapped(); |
| JSValue result = jsStringWithCache(state, impl.attributeWithoutSynchronization(WebCore::HTMLNames::marginheightAttr)); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsHTMLFrameElementMarginWidth(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = jsDynamicCast<JSHTMLFrameElement*>(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "HTMLFrameElement", "marginWidth"); |
| } |
| auto& impl = castedThis->wrapped(); |
| JSValue result = jsStringWithCache(state, impl.attributeWithoutSynchronization(WebCore::HTMLNames::marginwidthAttr)); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsHTMLFrameElementName(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = jsDynamicCast<JSHTMLFrameElement*>(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "HTMLFrameElement", "name"); |
| } |
| auto& impl = castedThis->wrapped(); |
| JSValue result = jsStringWithCache(state, impl.getNameAttribute()); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsHTMLFrameElementNoResize(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = jsDynamicCast<JSHTMLFrameElement*>(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "HTMLFrameElement", "noResize"); |
| } |
| auto& impl = castedThis->wrapped(); |
| JSValue result = jsBoolean(impl.hasAttributeWithoutSynchronization(WebCore::HTMLNames::noresizeAttr)); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsHTMLFrameElementScrolling(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = jsDynamicCast<JSHTMLFrameElement*>(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "HTMLFrameElement", "scrolling"); |
| } |
| auto& impl = castedThis->wrapped(); |
| JSValue result = jsStringWithCache(state, impl.attributeWithoutSynchronization(WebCore::HTMLNames::scrollingAttr)); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsHTMLFrameElementSrc(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = jsDynamicCast<JSHTMLFrameElement*>(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "HTMLFrameElement", "src"); |
| } |
| auto& impl = castedThis->wrapped(); |
| JSValue result = jsStringWithCache(state, impl.getURLAttribute(WebCore::HTMLNames::srcAttr)); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsHTMLFrameElementContentDocument(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = jsDynamicCast<JSHTMLFrameElement*>(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "HTMLFrameElement", "contentDocument"); |
| } |
| auto& impl = castedThis->wrapped(); |
| return JSValue::encode(shouldAllowAccessToNode(state, impl.contentDocument()) ? toJS(state, castedThis->globalObject(), impl.contentDocument()) : jsNull()); |
| } |
| |
| |
| EncodedJSValue jsHTMLFrameElementContentWindow(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = jsDynamicCast<JSHTMLFrameElement*>(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "HTMLFrameElement", "contentWindow"); |
| } |
| auto& impl = castedThis->wrapped(); |
| JSValue result = toJS(state, castedThis->globalObject(), impl.contentWindow()); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsHTMLFrameElementLocation(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = jsDynamicCast<JSHTMLFrameElement*>(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "HTMLFrameElement", "location"); |
| } |
| auto& impl = castedThis->wrapped(); |
| JSValue result = jsStringWithCache(state, impl.location()); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsHTMLFrameElementWidth(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = jsDynamicCast<JSHTMLFrameElement*>(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "HTMLFrameElement", "width"); |
| } |
| auto& impl = castedThis->wrapped(); |
| JSValue result = jsNumber(impl.width()); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsHTMLFrameElementHeight(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = jsDynamicCast<JSHTMLFrameElement*>(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "HTMLFrameElement", "height"); |
| } |
| auto& impl = castedThis->wrapped(); |
| JSValue result = jsNumber(impl.height()); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsHTMLFrameElementConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| JSHTMLFrameElementPrototype* domObject = jsDynamicCast<JSHTMLFrameElementPrototype*>(JSValue::decode(thisValue)); |
| if (UNLIKELY(!domObject)) |
| return throwVMTypeError(state, throwScope); |
| return JSValue::encode(JSHTMLFrameElement::getConstructor(state->vm(), domObject->globalObject())); |
| } |
| |
| bool setJSHTMLFrameElementConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| JSValue value = JSValue::decode(encodedValue); |
| JSHTMLFrameElementPrototype* domObject = jsDynamicCast<JSHTMLFrameElementPrototype*>(JSValue::decode(thisValue)); |
| if (UNLIKELY(!domObject)) { |
| throwVMTypeError(state, throwScope); |
| return false; |
| } |
| // Shadowing a built-in constructor |
| return domObject->putDirect(state->vm(), state->propertyNames().constructor, value); |
| } |
| |
| bool setJSHTMLFrameElementFrameBorder(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(thisValue); |
| JSHTMLFrameElement* castedThis = jsDynamicCast<JSHTMLFrameElement*>(JSValue::decode(thisValue)); |
| if (UNLIKELY(!castedThis)) { |
| return throwSetterTypeError(*state, throwScope, "HTMLFrameElement", "frameBorder"); |
| } |
| auto& impl = castedThis->wrapped(); |
| auto nativeValue = value.toWTFString(state); |
| RETURN_IF_EXCEPTION(throwScope, false); |
| impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::frameborderAttr, WTFMove(nativeValue)); |
| return true; |
| } |
| |
| |
| bool setJSHTMLFrameElementLongDesc(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(thisValue); |
| JSHTMLFrameElement* castedThis = jsDynamicCast<JSHTMLFrameElement*>(JSValue::decode(thisValue)); |
| if (UNLIKELY(!castedThis)) { |
| return throwSetterTypeError(*state, throwScope, "HTMLFrameElement", "longDesc"); |
| } |
| auto& impl = castedThis->wrapped(); |
| auto nativeValue = valueToUSVString(state, value); |
| RETURN_IF_EXCEPTION(throwScope, false); |
| impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::longdescAttr, WTFMove(nativeValue)); |
| return true; |
| } |
| |
| |
| bool setJSHTMLFrameElementMarginHeight(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(thisValue); |
| JSHTMLFrameElement* castedThis = jsDynamicCast<JSHTMLFrameElement*>(JSValue::decode(thisValue)); |
| if (UNLIKELY(!castedThis)) { |
| return throwSetterTypeError(*state, throwScope, "HTMLFrameElement", "marginHeight"); |
| } |
| auto& impl = castedThis->wrapped(); |
| auto nativeValue = valueToStringTreatingNullAsEmptyString(state, value); |
| RETURN_IF_EXCEPTION(throwScope, false); |
| impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::marginheightAttr, WTFMove(nativeValue)); |
| return true; |
| } |
| |
| |
| bool setJSHTMLFrameElementMarginWidth(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(thisValue); |
| JSHTMLFrameElement* castedThis = jsDynamicCast<JSHTMLFrameElement*>(JSValue::decode(thisValue)); |
| if (UNLIKELY(!castedThis)) { |
| return throwSetterTypeError(*state, throwScope, "HTMLFrameElement", "marginWidth"); |
| } |
| auto& impl = castedThis->wrapped(); |
| auto nativeValue = valueToStringTreatingNullAsEmptyString(state, value); |
| RETURN_IF_EXCEPTION(throwScope, false); |
| impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::marginwidthAttr, WTFMove(nativeValue)); |
| return true; |
| } |
| |
| |
| bool setJSHTMLFrameElementName(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(thisValue); |
| JSHTMLFrameElement* castedThis = jsDynamicCast<JSHTMLFrameElement*>(JSValue::decode(thisValue)); |
| if (UNLIKELY(!castedThis)) { |
| return throwSetterTypeError(*state, throwScope, "HTMLFrameElement", "name"); |
| } |
| auto& impl = castedThis->wrapped(); |
| auto nativeValue = value.toWTFString(state); |
| RETURN_IF_EXCEPTION(throwScope, false); |
| impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::nameAttr, WTFMove(nativeValue)); |
| return true; |
| } |
| |
| |
| bool setJSHTMLFrameElementNoResize(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(thisValue); |
| JSHTMLFrameElement* castedThis = jsDynamicCast<JSHTMLFrameElement*>(JSValue::decode(thisValue)); |
| if (UNLIKELY(!castedThis)) { |
| return throwSetterTypeError(*state, throwScope, "HTMLFrameElement", "noResize"); |
| } |
| auto& impl = castedThis->wrapped(); |
| auto nativeValue = value.toBoolean(state); |
| RETURN_IF_EXCEPTION(throwScope, false); |
| impl.setBooleanAttribute(WebCore::HTMLNames::noresizeAttr, WTFMove(nativeValue)); |
| return true; |
| } |
| |
| |
| bool setJSHTMLFrameElementScrolling(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(thisValue); |
| JSHTMLFrameElement* castedThis = jsDynamicCast<JSHTMLFrameElement*>(JSValue::decode(thisValue)); |
| if (UNLIKELY(!castedThis)) { |
| return throwSetterTypeError(*state, throwScope, "HTMLFrameElement", "scrolling"); |
| } |
| auto& impl = castedThis->wrapped(); |
| auto nativeValue = value.toWTFString(state); |
| RETURN_IF_EXCEPTION(throwScope, false); |
| impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::scrollingAttr, WTFMove(nativeValue)); |
| return true; |
| } |
| |
| |
| bool setJSHTMLFrameElementSrc(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(thisValue); |
| JSHTMLFrameElement* castedThis = jsDynamicCast<JSHTMLFrameElement*>(JSValue::decode(thisValue)); |
| if (UNLIKELY(!castedThis)) { |
| return throwSetterTypeError(*state, throwScope, "HTMLFrameElement", "src"); |
| } |
| auto& impl = castedThis->wrapped(); |
| auto nativeValue = valueToUSVString(state, value); |
| RETURN_IF_EXCEPTION(throwScope, false); |
| impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::srcAttr, WTFMove(nativeValue)); |
| return true; |
| } |
| |
| |
| bool setJSHTMLFrameElementLocation(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(thisValue); |
| JSHTMLFrameElement* castedThis = jsDynamicCast<JSHTMLFrameElement*>(JSValue::decode(thisValue)); |
| if (UNLIKELY(!castedThis)) { |
| return throwSetterTypeError(*state, throwScope, "HTMLFrameElement", "location"); |
| } |
| castedThis->setLocation(*state, value); |
| return true; |
| } |
| |
| |
| JSValue JSHTMLFrameElement::getConstructor(VM& vm, const JSGlobalObject* globalObject) |
| { |
| return getDOMConstructor<JSHTMLFrameElementConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject)); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsHTMLFrameElementPrototypeFunctionGetSVGDocument(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSHTMLFrameElement*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, throwScope, "HTMLFrameElement", "getSVGDocument"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSHTMLFrameElement::info()); |
| auto& impl = castedThis->wrapped(); |
| ExceptionCode ec = 0; |
| if (!shouldAllowAccessToNode(state, impl.getSVGDocument(ec))) |
| return JSValue::encode(jsNull()); |
| JSValue result = toJS(state, castedThis->globalObject(), impl.getSVGDocument(ec)); |
| |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(result); |
| } |
| |
| void JSHTMLFrameElement::visitChildren(JSCell* cell, SlotVisitor& visitor) |
| { |
| auto* thisObject = jsCast<JSHTMLFrameElement*>(cell); |
| ASSERT_GC_OBJECT_INHERITS(thisObject, info()); |
| Base::visitChildren(thisObject, visitor); |
| thisObject->wrapped().visitJSEventListeners(visitor); |
| } |
| |
| |
| } |