diff -r 000000000000 -r 4f2f89ce4247 WebCore/generated/JSSVGTextContentElement.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/WebCore/generated/JSSVGTextContentElement.cpp Fri Sep 17 09:02:29 2010 +0300 @@ -0,0 +1,543 @@ +/* + 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" + +#if ENABLE(SVG) + +#include "JSSVGTextContentElement.h" + +#include "CSSMutableStyleDeclaration.h" +#include "CSSStyleDeclaration.h" +#include "CSSValue.h" +#include "ExceptionCode.h" +#include "FloatPoint.h" +#include "JSCSSStyleDeclaration.h" +#include "JSCSSValue.h" +#include "JSSVGAnimatedBoolean.h" +#include "JSSVGAnimatedEnumeration.h" +#include "JSSVGAnimatedLength.h" +#include "JSSVGAnimatedString.h" +#include "JSSVGPoint.h" +#include "JSSVGRect.h" +#include "JSSVGStringList.h" +#include "KURL.h" +#include "SVGStringList.h" +#include "SVGTextContentElement.h" +#include +#include +#include +#include + +using namespace JSC; + +namespace WebCore { + +ASSERT_CLASS_FITS_IN_CELL(JSSVGTextContentElement); + +/* Hash table */ +#if ENABLE(JIT) +#define THUNK_GENERATOR(generator) , generator +#else +#define THUNK_GENERATOR(generator) +#endif + +static const HashTableValue JSSVGTextContentElementTableValues[12] = +{ + { "textLength", DontDelete | ReadOnly, (intptr_t)static_cast(jsSVGTextContentElementTextLength), (intptr_t)0 THUNK_GENERATOR(0) }, + { "lengthAdjust", DontDelete | ReadOnly, (intptr_t)static_cast(jsSVGTextContentElementLengthAdjust), (intptr_t)0 THUNK_GENERATOR(0) }, + { "requiredFeatures", DontDelete | ReadOnly, (intptr_t)static_cast(jsSVGTextContentElementRequiredFeatures), (intptr_t)0 THUNK_GENERATOR(0) }, + { "requiredExtensions", DontDelete | ReadOnly, (intptr_t)static_cast(jsSVGTextContentElementRequiredExtensions), (intptr_t)0 THUNK_GENERATOR(0) }, + { "systemLanguage", DontDelete | ReadOnly, (intptr_t)static_cast(jsSVGTextContentElementSystemLanguage), (intptr_t)0 THUNK_GENERATOR(0) }, + { "xmllang", DontDelete, (intptr_t)static_cast(jsSVGTextContentElementXmllang), (intptr_t)setJSSVGTextContentElementXmllang THUNK_GENERATOR(0) }, + { "xmlspace", DontDelete, (intptr_t)static_cast(jsSVGTextContentElementXmlspace), (intptr_t)setJSSVGTextContentElementXmlspace THUNK_GENERATOR(0) }, + { "externalResourcesRequired", DontDelete | ReadOnly, (intptr_t)static_cast(jsSVGTextContentElementExternalResourcesRequired), (intptr_t)0 THUNK_GENERATOR(0) }, + { "className", DontDelete | ReadOnly, (intptr_t)static_cast(jsSVGTextContentElementClassName), (intptr_t)0 THUNK_GENERATOR(0) }, + { "style", DontDelete | ReadOnly, (intptr_t)static_cast(jsSVGTextContentElementStyle), (intptr_t)0 THUNK_GENERATOR(0) }, + { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast(jsSVGTextContentElementConstructor), (intptr_t)0 THUNK_GENERATOR(0) }, + { 0, 0, 0, 0 THUNK_GENERATOR(0) } +}; + +#undef THUNK_GENERATOR +static JSC_CONST_HASHTABLE HashTable JSSVGTextContentElementTable = { 34, 31, JSSVGTextContentElementTableValues, 0 }; +/* Hash table for constructor */ +#if ENABLE(JIT) +#define THUNK_GENERATOR(generator) , generator +#else +#define THUNK_GENERATOR(generator) +#endif + +static const HashTableValue JSSVGTextContentElementConstructorTableValues[4] = +{ + { "LENGTHADJUST_UNKNOWN", DontDelete | ReadOnly, (intptr_t)static_cast(jsSVGTextContentElementLENGTHADJUST_UNKNOWN), (intptr_t)0 THUNK_GENERATOR(0) }, + { "LENGTHADJUST_SPACING", DontDelete | ReadOnly, (intptr_t)static_cast(jsSVGTextContentElementLENGTHADJUST_SPACING), (intptr_t)0 THUNK_GENERATOR(0) }, + { "LENGTHADJUST_SPACINGANDGLYPHS", DontDelete | ReadOnly, (intptr_t)static_cast(jsSVGTextContentElementLENGTHADJUST_SPACINGANDGLYPHS), (intptr_t)0 THUNK_GENERATOR(0) }, + { 0, 0, 0, 0 THUNK_GENERATOR(0) } +}; + +#undef THUNK_GENERATOR +static JSC_CONST_HASHTABLE HashTable JSSVGTextContentElementConstructorTable = { 8, 7, JSSVGTextContentElementConstructorTableValues, 0 }; + +COMPILE_ASSERT(0 == SVGTextContentElement::LENGTHADJUST_UNKNOWN, SVGTextContentElementEnumLENGTHADJUST_UNKNOWNIsWrongUseDontCheckEnums); +COMPILE_ASSERT(1 == SVGTextContentElement::LENGTHADJUST_SPACING, SVGTextContentElementEnumLENGTHADJUST_SPACINGIsWrongUseDontCheckEnums); +COMPILE_ASSERT(2 == SVGTextContentElement::LENGTHADJUST_SPACINGANDGLYPHS, SVGTextContentElementEnumLENGTHADJUST_SPACINGANDGLYPHSIsWrongUseDontCheckEnums); + +class JSSVGTextContentElementConstructor : public DOMConstructorObject { +public: + JSSVGTextContentElementConstructor(JSC::ExecState*, JSDOMGlobalObject*); + + virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); + virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); + virtual const JSC::ClassInfo* classInfo() const { return &s_info; } + static const JSC::ClassInfo s_info; + static PassRefPtr createStructure(JSC::JSValue prototype) + { + return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount); + } +protected: + static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; +}; + +const ClassInfo JSSVGTextContentElementConstructor::s_info = { "SVGTextContentElementConstructor", 0, &JSSVGTextContentElementConstructorTable, 0 }; + +JSSVGTextContentElementConstructor::JSSVGTextContentElementConstructor(ExecState* exec, JSDOMGlobalObject* globalObject) + : DOMConstructorObject(JSSVGTextContentElementConstructor::createStructure(globalObject->objectPrototype()), globalObject) +{ + putDirect(exec->propertyNames().prototype, JSSVGTextContentElementPrototype::self(exec, globalObject), DontDelete | ReadOnly); +} + +bool JSSVGTextContentElementConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) +{ + return getStaticValueSlot(exec, &JSSVGTextContentElementConstructorTable, this, propertyName, slot); +} + +bool JSSVGTextContentElementConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) +{ + return getStaticValueDescriptor(exec, &JSSVGTextContentElementConstructorTable, this, propertyName, descriptor); +} + +/* Hash table for prototype */ +#if ENABLE(JIT) +#define THUNK_GENERATOR(generator) , generator +#else +#define THUNK_GENERATOR(generator) +#endif + +static const HashTableValue JSSVGTextContentElementPrototypeTableValues[15] = +{ + { "LENGTHADJUST_UNKNOWN", DontDelete | ReadOnly, (intptr_t)static_cast(jsSVGTextContentElementLENGTHADJUST_UNKNOWN), (intptr_t)0 THUNK_GENERATOR(0) }, + { "LENGTHADJUST_SPACING", DontDelete | ReadOnly, (intptr_t)static_cast(jsSVGTextContentElementLENGTHADJUST_SPACING), (intptr_t)0 THUNK_GENERATOR(0) }, + { "LENGTHADJUST_SPACINGANDGLYPHS", DontDelete | ReadOnly, (intptr_t)static_cast(jsSVGTextContentElementLENGTHADJUST_SPACINGANDGLYPHS), (intptr_t)0 THUNK_GENERATOR(0) }, + { "getNumberOfChars", DontDelete | Function, (intptr_t)static_cast(jsSVGTextContentElementPrototypeFunctionGetNumberOfChars), (intptr_t)0 THUNK_GENERATOR(0) }, + { "getComputedTextLength", DontDelete | Function, (intptr_t)static_cast(jsSVGTextContentElementPrototypeFunctionGetComputedTextLength), (intptr_t)0 THUNK_GENERATOR(0) }, + { "getSubStringLength", DontDelete | Function, (intptr_t)static_cast(jsSVGTextContentElementPrototypeFunctionGetSubStringLength), (intptr_t)2 THUNK_GENERATOR(0) }, + { "getStartPositionOfChar", DontDelete | Function, (intptr_t)static_cast(jsSVGTextContentElementPrototypeFunctionGetStartPositionOfChar), (intptr_t)1 THUNK_GENERATOR(0) }, + { "getEndPositionOfChar", DontDelete | Function, (intptr_t)static_cast(jsSVGTextContentElementPrototypeFunctionGetEndPositionOfChar), (intptr_t)1 THUNK_GENERATOR(0) }, + { "getExtentOfChar", DontDelete | Function, (intptr_t)static_cast(jsSVGTextContentElementPrototypeFunctionGetExtentOfChar), (intptr_t)1 THUNK_GENERATOR(0) }, + { "getRotationOfChar", DontDelete | Function, (intptr_t)static_cast(jsSVGTextContentElementPrototypeFunctionGetRotationOfChar), (intptr_t)1 THUNK_GENERATOR(0) }, + { "getCharNumAtPosition", DontDelete | Function, (intptr_t)static_cast(jsSVGTextContentElementPrototypeFunctionGetCharNumAtPosition), (intptr_t)1 THUNK_GENERATOR(0) }, + { "selectSubString", DontDelete | Function, (intptr_t)static_cast(jsSVGTextContentElementPrototypeFunctionSelectSubString), (intptr_t)2 THUNK_GENERATOR(0) }, + { "hasExtension", DontDelete | Function, (intptr_t)static_cast(jsSVGTextContentElementPrototypeFunctionHasExtension), (intptr_t)1 THUNK_GENERATOR(0) }, + { "getPresentationAttribute", DontDelete | Function, (intptr_t)static_cast(jsSVGTextContentElementPrototypeFunctionGetPresentationAttribute), (intptr_t)1 THUNK_GENERATOR(0) }, + { 0, 0, 0, 0 THUNK_GENERATOR(0) } +}; + +#undef THUNK_GENERATOR +static JSC_CONST_HASHTABLE HashTable JSSVGTextContentElementPrototypeTable = { 34, 31, JSSVGTextContentElementPrototypeTableValues, 0 }; +const ClassInfo JSSVGTextContentElementPrototype::s_info = { "SVGTextContentElementPrototype", 0, &JSSVGTextContentElementPrototypeTable, 0 }; + +JSObject* JSSVGTextContentElementPrototype::self(ExecState* exec, JSGlobalObject* globalObject) +{ + return getDOMPrototype(exec, globalObject); +} + +bool JSSVGTextContentElementPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) +{ + return getStaticPropertySlot(exec, &JSSVGTextContentElementPrototypeTable, this, propertyName, slot); +} + +bool JSSVGTextContentElementPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) +{ + return getStaticPropertyDescriptor(exec, &JSSVGTextContentElementPrototypeTable, this, propertyName, descriptor); +} + +const ClassInfo JSSVGTextContentElement::s_info = { "SVGTextContentElement", &JSSVGElement::s_info, &JSSVGTextContentElementTable, 0 }; + +JSSVGTextContentElement::JSSVGTextContentElement(NonNullPassRefPtr structure, JSDOMGlobalObject* globalObject, PassRefPtr impl) + : JSSVGElement(structure, globalObject, impl) +{ +} + +JSObject* JSSVGTextContentElement::createPrototype(ExecState* exec, JSGlobalObject* globalObject) +{ + return new (exec) JSSVGTextContentElementPrototype(globalObject, JSSVGTextContentElementPrototype::createStructure(JSSVGElementPrototype::self(exec, globalObject))); +} + +bool JSSVGTextContentElement::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) +{ + return getStaticValueSlot(exec, &JSSVGTextContentElementTable, this, propertyName, slot); +} + +bool JSSVGTextContentElement::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) +{ + return getStaticValueDescriptor(exec, &JSSVGTextContentElementTable, this, propertyName, descriptor); +} + +JSValue jsSVGTextContentElementTextLength(ExecState* exec, JSValue slotBase, const Identifier&) +{ + JSSVGTextContentElement* castedThis = static_cast(asObject(slotBase)); + UNUSED_PARAM(exec); + SVGTextContentElement* imp = static_cast(castedThis->impl()); + RefPtr obj = imp->textLengthAnimated(); + JSValue result = toJS(exec, castedThis->globalObject(), obj.get(), imp); + return result; +} + +JSValue jsSVGTextContentElementLengthAdjust(ExecState* exec, JSValue slotBase, const Identifier&) +{ + JSSVGTextContentElement* castedThis = static_cast(asObject(slotBase)); + UNUSED_PARAM(exec); + SVGTextContentElement* imp = static_cast(castedThis->impl()); + RefPtr obj = imp->lengthAdjustAnimated(); + JSValue result = toJS(exec, castedThis->globalObject(), obj.get(), imp); + return result; +} + +JSValue jsSVGTextContentElementRequiredFeatures(ExecState* exec, JSValue slotBase, const Identifier&) +{ + JSSVGTextContentElement* castedThis = static_cast(asObject(slotBase)); + UNUSED_PARAM(exec); + SVGTextContentElement* imp = static_cast(castedThis->impl()); + JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->requiredFeatures()), imp); + return result; +} + +JSValue jsSVGTextContentElementRequiredExtensions(ExecState* exec, JSValue slotBase, const Identifier&) +{ + JSSVGTextContentElement* castedThis = static_cast(asObject(slotBase)); + UNUSED_PARAM(exec); + SVGTextContentElement* imp = static_cast(castedThis->impl()); + JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->requiredExtensions()), imp); + return result; +} + +JSValue jsSVGTextContentElementSystemLanguage(ExecState* exec, JSValue slotBase, const Identifier&) +{ + JSSVGTextContentElement* castedThis = static_cast(asObject(slotBase)); + UNUSED_PARAM(exec); + SVGTextContentElement* imp = static_cast(castedThis->impl()); + JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->systemLanguage()), imp); + return result; +} + +JSValue jsSVGTextContentElementXmllang(ExecState* exec, JSValue slotBase, const Identifier&) +{ + JSSVGTextContentElement* castedThis = static_cast(asObject(slotBase)); + UNUSED_PARAM(exec); + SVGTextContentElement* imp = static_cast(castedThis->impl()); + JSValue result = jsString(exec, imp->xmllang()); + return result; +} + +JSValue jsSVGTextContentElementXmlspace(ExecState* exec, JSValue slotBase, const Identifier&) +{ + JSSVGTextContentElement* castedThis = static_cast(asObject(slotBase)); + UNUSED_PARAM(exec); + SVGTextContentElement* imp = static_cast(castedThis->impl()); + JSValue result = jsString(exec, imp->xmlspace()); + return result; +} + +JSValue jsSVGTextContentElementExternalResourcesRequired(ExecState* exec, JSValue slotBase, const Identifier&) +{ + JSSVGTextContentElement* castedThis = static_cast(asObject(slotBase)); + UNUSED_PARAM(exec); + SVGTextContentElement* imp = static_cast(castedThis->impl()); + RefPtr obj = imp->externalResourcesRequiredAnimated(); + JSValue result = toJS(exec, castedThis->globalObject(), obj.get(), imp); + return result; +} + +JSValue jsSVGTextContentElementClassName(ExecState* exec, JSValue slotBase, const Identifier&) +{ + JSSVGTextContentElement* castedThis = static_cast(asObject(slotBase)); + UNUSED_PARAM(exec); + SVGTextContentElement* imp = static_cast(castedThis->impl()); + RefPtr obj = imp->classNameAnimated(); + JSValue result = toJS(exec, castedThis->globalObject(), obj.get(), imp); + return result; +} + +JSValue jsSVGTextContentElementStyle(ExecState* exec, JSValue slotBase, const Identifier&) +{ + JSSVGTextContentElement* castedThis = static_cast(asObject(slotBase)); + UNUSED_PARAM(exec); + SVGTextContentElement* imp = static_cast(castedThis->impl()); + JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->style())); + return result; +} + +JSValue jsSVGTextContentElementConstructor(ExecState* exec, JSValue slotBase, const Identifier&) +{ + JSSVGTextContentElement* domObject = static_cast(asObject(slotBase)); + return JSSVGTextContentElement::getConstructor(exec, domObject->globalObject()); +} +void JSSVGTextContentElement::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot) +{ + lookupPut(exec, propertyName, value, &JSSVGTextContentElementTable, this, slot); +} + +void setJSSVGTextContentElementXmllang(ExecState* exec, JSObject* thisObject, JSValue value) +{ + JSSVGTextContentElement* castedThis = static_cast(thisObject); + SVGTextContentElement* imp = static_cast(castedThis->impl()); + imp->setXmllang(ustringToString(value.toString(exec))); +} + +void setJSSVGTextContentElementXmlspace(ExecState* exec, JSObject* thisObject, JSValue value) +{ + JSSVGTextContentElement* castedThis = static_cast(thisObject); + SVGTextContentElement* imp = static_cast(castedThis->impl()); + imp->setXmlspace(ustringToString(value.toString(exec))); +} + +JSValue JSSVGTextContentElement::getConstructor(ExecState* exec, JSGlobalObject* globalObject) +{ + return getDOMConstructor(exec, static_cast(globalObject)); +} + +EncodedJSValue JSC_HOST_CALL jsSVGTextContentElementPrototypeFunctionGetNumberOfChars(ExecState* exec) +{ + JSValue thisValue = exec->hostThisValue(); + if (!thisValue.inherits(&JSSVGTextContentElement::s_info)) + return throwVMTypeError(exec); + JSSVGTextContentElement* castedThis = static_cast(asObject(thisValue)); + SVGTextContentElement* imp = static_cast(castedThis->impl()); + + + JSC::JSValue result = jsNumber(exec, imp->getNumberOfChars()); + return JSValue::encode(result); +} + +EncodedJSValue JSC_HOST_CALL jsSVGTextContentElementPrototypeFunctionGetComputedTextLength(ExecState* exec) +{ + JSValue thisValue = exec->hostThisValue(); + if (!thisValue.inherits(&JSSVGTextContentElement::s_info)) + return throwVMTypeError(exec); + JSSVGTextContentElement* castedThis = static_cast(asObject(thisValue)); + SVGTextContentElement* imp = static_cast(castedThis->impl()); + + + JSC::JSValue result = jsNumber(exec, imp->getComputedTextLength()); + return JSValue::encode(result); +} + +EncodedJSValue JSC_HOST_CALL jsSVGTextContentElementPrototypeFunctionGetSubStringLength(ExecState* exec) +{ + JSValue thisValue = exec->hostThisValue(); + if (!thisValue.inherits(&JSSVGTextContentElement::s_info)) + return throwVMTypeError(exec); + JSSVGTextContentElement* castedThis = static_cast(asObject(thisValue)); + SVGTextContentElement* imp = static_cast(castedThis->impl()); + ExceptionCode ec = 0; + int offset = exec->argument(0).toInt32(exec); + if (offset < 0) { + setDOMException(exec, INDEX_SIZE_ERR); + return JSValue::encode(jsUndefined()); + } + int length = exec->argument(1).toInt32(exec); + if (length < 0) { + setDOMException(exec, INDEX_SIZE_ERR); + return JSValue::encode(jsUndefined()); + } + + + JSC::JSValue result = jsNumber(exec, imp->getSubStringLength(offset, length, ec)); + setDOMException(exec, ec); + return JSValue::encode(result); +} + +EncodedJSValue JSC_HOST_CALL jsSVGTextContentElementPrototypeFunctionGetStartPositionOfChar(ExecState* exec) +{ + JSValue thisValue = exec->hostThisValue(); + if (!thisValue.inherits(&JSSVGTextContentElement::s_info)) + return throwVMTypeError(exec); + JSSVGTextContentElement* castedThis = static_cast(asObject(thisValue)); + SVGTextContentElement* imp = static_cast(castedThis->impl()); + ExceptionCode ec = 0; + int offset = exec->argument(0).toInt32(exec); + if (offset < 0) { + setDOMException(exec, INDEX_SIZE_ERR); + return JSValue::encode(jsUndefined()); + } + + + JSC::JSValue result = toJS(exec, castedThis->globalObject(), JSSVGStaticPODTypeWrapper::create(imp->getStartPositionOfChar(offset, ec)).get(), 0 /* no context on purpose */); + setDOMException(exec, ec); + return JSValue::encode(result); +} + +EncodedJSValue JSC_HOST_CALL jsSVGTextContentElementPrototypeFunctionGetEndPositionOfChar(ExecState* exec) +{ + JSValue thisValue = exec->hostThisValue(); + if (!thisValue.inherits(&JSSVGTextContentElement::s_info)) + return throwVMTypeError(exec); + JSSVGTextContentElement* castedThis = static_cast(asObject(thisValue)); + SVGTextContentElement* imp = static_cast(castedThis->impl()); + ExceptionCode ec = 0; + int offset = exec->argument(0).toInt32(exec); + if (offset < 0) { + setDOMException(exec, INDEX_SIZE_ERR); + return JSValue::encode(jsUndefined()); + } + + + JSC::JSValue result = toJS(exec, castedThis->globalObject(), JSSVGStaticPODTypeWrapper::create(imp->getEndPositionOfChar(offset, ec)).get(), 0 /* no context on purpose */); + setDOMException(exec, ec); + return JSValue::encode(result); +} + +EncodedJSValue JSC_HOST_CALL jsSVGTextContentElementPrototypeFunctionGetExtentOfChar(ExecState* exec) +{ + JSValue thisValue = exec->hostThisValue(); + if (!thisValue.inherits(&JSSVGTextContentElement::s_info)) + return throwVMTypeError(exec); + JSSVGTextContentElement* castedThis = static_cast(asObject(thisValue)); + SVGTextContentElement* imp = static_cast(castedThis->impl()); + ExceptionCode ec = 0; + int offset = exec->argument(0).toInt32(exec); + if (offset < 0) { + setDOMException(exec, INDEX_SIZE_ERR); + return JSValue::encode(jsUndefined()); + } + + + JSC::JSValue result = toJS(exec, castedThis->globalObject(), JSSVGStaticPODTypeWrapper::create(imp->getExtentOfChar(offset, ec)).get(), 0 /* no context on purpose */); + setDOMException(exec, ec); + return JSValue::encode(result); +} + +EncodedJSValue JSC_HOST_CALL jsSVGTextContentElementPrototypeFunctionGetRotationOfChar(ExecState* exec) +{ + JSValue thisValue = exec->hostThisValue(); + if (!thisValue.inherits(&JSSVGTextContentElement::s_info)) + return throwVMTypeError(exec); + JSSVGTextContentElement* castedThis = static_cast(asObject(thisValue)); + SVGTextContentElement* imp = static_cast(castedThis->impl()); + ExceptionCode ec = 0; + int offset = exec->argument(0).toInt32(exec); + if (offset < 0) { + setDOMException(exec, INDEX_SIZE_ERR); + return JSValue::encode(jsUndefined()); + } + + + JSC::JSValue result = jsNumber(exec, imp->getRotationOfChar(offset, ec)); + setDOMException(exec, ec); + return JSValue::encode(result); +} + +EncodedJSValue JSC_HOST_CALL jsSVGTextContentElementPrototypeFunctionGetCharNumAtPosition(ExecState* exec) +{ + JSValue thisValue = exec->hostThisValue(); + if (!thisValue.inherits(&JSSVGTextContentElement::s_info)) + return throwVMTypeError(exec); + JSSVGTextContentElement* castedThis = static_cast(asObject(thisValue)); + SVGTextContentElement* imp = static_cast(castedThis->impl()); + FloatPoint point = toSVGPoint(exec->argument(0)); + + + JSC::JSValue result = jsNumber(exec, imp->getCharNumAtPosition(point)); + return JSValue::encode(result); +} + +EncodedJSValue JSC_HOST_CALL jsSVGTextContentElementPrototypeFunctionSelectSubString(ExecState* exec) +{ + JSValue thisValue = exec->hostThisValue(); + if (!thisValue.inherits(&JSSVGTextContentElement::s_info)) + return throwVMTypeError(exec); + JSSVGTextContentElement* castedThis = static_cast(asObject(thisValue)); + SVGTextContentElement* imp = static_cast(castedThis->impl()); + ExceptionCode ec = 0; + int offset = exec->argument(0).toInt32(exec); + if (offset < 0) { + setDOMException(exec, INDEX_SIZE_ERR); + return JSValue::encode(jsUndefined()); + } + int length = exec->argument(1).toInt32(exec); + if (length < 0) { + setDOMException(exec, INDEX_SIZE_ERR); + return JSValue::encode(jsUndefined()); + } + + imp->selectSubString(offset, length, ec); + setDOMException(exec, ec); + return JSValue::encode(jsUndefined()); +} + +EncodedJSValue JSC_HOST_CALL jsSVGTextContentElementPrototypeFunctionHasExtension(ExecState* exec) +{ + JSValue thisValue = exec->hostThisValue(); + if (!thisValue.inherits(&JSSVGTextContentElement::s_info)) + return throwVMTypeError(exec); + JSSVGTextContentElement* castedThis = static_cast(asObject(thisValue)); + SVGTextContentElement* imp = static_cast(castedThis->impl()); + const String& extension = ustringToString(exec->argument(0).toString(exec)); + + + JSC::JSValue result = jsBoolean(imp->hasExtension(extension)); + return JSValue::encode(result); +} + +EncodedJSValue JSC_HOST_CALL jsSVGTextContentElementPrototypeFunctionGetPresentationAttribute(ExecState* exec) +{ + JSValue thisValue = exec->hostThisValue(); + if (!thisValue.inherits(&JSSVGTextContentElement::s_info)) + return throwVMTypeError(exec); + JSSVGTextContentElement* castedThis = static_cast(asObject(thisValue)); + SVGTextContentElement* imp = static_cast(castedThis->impl()); + const String& name = ustringToString(exec->argument(0).toString(exec)); + + + JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->getPresentationAttribute(name))); + return JSValue::encode(result); +} + +// Constant getters + +JSValue jsSVGTextContentElementLENGTHADJUST_UNKNOWN(ExecState* exec, JSValue, const Identifier&) +{ + return jsNumber(exec, static_cast(0)); +} + +JSValue jsSVGTextContentElementLENGTHADJUST_SPACING(ExecState* exec, JSValue, const Identifier&) +{ + return jsNumber(exec, static_cast(1)); +} + +JSValue jsSVGTextContentElementLENGTHADJUST_SPACINGANDGLYPHS(ExecState* exec, JSValue, const Identifier&) +{ + return jsNumber(exec, static_cast(2)); +} + + +} + +#endif // ENABLE(SVG)