WebCore/generated/JSSVGTextContentElement.cpp
changeset 0 4f2f89ce4247
equal deleted inserted replaced
-1:000000000000 0:4f2f89ce4247
       
     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 
       
    23 #if ENABLE(SVG)
       
    24 
       
    25 #include "JSSVGTextContentElement.h"
       
    26 
       
    27 #include "CSSMutableStyleDeclaration.h"
       
    28 #include "CSSStyleDeclaration.h"
       
    29 #include "CSSValue.h"
       
    30 #include "ExceptionCode.h"
       
    31 #include "FloatPoint.h"
       
    32 #include "JSCSSStyleDeclaration.h"
       
    33 #include "JSCSSValue.h"
       
    34 #include "JSSVGAnimatedBoolean.h"
       
    35 #include "JSSVGAnimatedEnumeration.h"
       
    36 #include "JSSVGAnimatedLength.h"
       
    37 #include "JSSVGAnimatedString.h"
       
    38 #include "JSSVGPoint.h"
       
    39 #include "JSSVGRect.h"
       
    40 #include "JSSVGStringList.h"
       
    41 #include "KURL.h"
       
    42 #include "SVGStringList.h"
       
    43 #include "SVGTextContentElement.h"
       
    44 #include <runtime/Error.h>
       
    45 #include <runtime/JSNumberCell.h>
       
    46 #include <runtime/JSString.h>
       
    47 #include <wtf/GetPtr.h>
       
    48 
       
    49 using namespace JSC;
       
    50 
       
    51 namespace WebCore {
       
    52 
       
    53 ASSERT_CLASS_FITS_IN_CELL(JSSVGTextContentElement);
       
    54 
       
    55 /* Hash table */
       
    56 #if ENABLE(JIT)
       
    57 #define THUNK_GENERATOR(generator) , generator
       
    58 #else
       
    59 #define THUNK_GENERATOR(generator)
       
    60 #endif
       
    61 
       
    62 static const HashTableValue JSSVGTextContentElementTableValues[12] =
       
    63 {
       
    64     { "textLength", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGTextContentElementTextLength), (intptr_t)0 THUNK_GENERATOR(0) },
       
    65     { "lengthAdjust", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGTextContentElementLengthAdjust), (intptr_t)0 THUNK_GENERATOR(0) },
       
    66     { "requiredFeatures", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGTextContentElementRequiredFeatures), (intptr_t)0 THUNK_GENERATOR(0) },
       
    67     { "requiredExtensions", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGTextContentElementRequiredExtensions), (intptr_t)0 THUNK_GENERATOR(0) },
       
    68     { "systemLanguage", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGTextContentElementSystemLanguage), (intptr_t)0 THUNK_GENERATOR(0) },
       
    69     { "xmllang", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGTextContentElementXmllang), (intptr_t)setJSSVGTextContentElementXmllang THUNK_GENERATOR(0) },
       
    70     { "xmlspace", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGTextContentElementXmlspace), (intptr_t)setJSSVGTextContentElementXmlspace THUNK_GENERATOR(0) },
       
    71     { "externalResourcesRequired", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGTextContentElementExternalResourcesRequired), (intptr_t)0 THUNK_GENERATOR(0) },
       
    72     { "className", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGTextContentElementClassName), (intptr_t)0 THUNK_GENERATOR(0) },
       
    73     { "style", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGTextContentElementStyle), (intptr_t)0 THUNK_GENERATOR(0) },
       
    74     { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGTextContentElementConstructor), (intptr_t)0 THUNK_GENERATOR(0) },
       
    75     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
       
    76 };
       
    77 
       
    78 #undef THUNK_GENERATOR
       
    79 static JSC_CONST_HASHTABLE HashTable JSSVGTextContentElementTable = { 34, 31, JSSVGTextContentElementTableValues, 0 };
       
    80 /* Hash table for constructor */
       
    81 #if ENABLE(JIT)
       
    82 #define THUNK_GENERATOR(generator) , generator
       
    83 #else
       
    84 #define THUNK_GENERATOR(generator)
       
    85 #endif
       
    86 
       
    87 static const HashTableValue JSSVGTextContentElementConstructorTableValues[4] =
       
    88 {
       
    89     { "LENGTHADJUST_UNKNOWN", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGTextContentElementLENGTHADJUST_UNKNOWN), (intptr_t)0 THUNK_GENERATOR(0) },
       
    90     { "LENGTHADJUST_SPACING", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGTextContentElementLENGTHADJUST_SPACING), (intptr_t)0 THUNK_GENERATOR(0) },
       
    91     { "LENGTHADJUST_SPACINGANDGLYPHS", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGTextContentElementLENGTHADJUST_SPACINGANDGLYPHS), (intptr_t)0 THUNK_GENERATOR(0) },
       
    92     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
       
    93 };
       
    94 
       
    95 #undef THUNK_GENERATOR
       
    96 static JSC_CONST_HASHTABLE HashTable JSSVGTextContentElementConstructorTable = { 8, 7, JSSVGTextContentElementConstructorTableValues, 0 };
       
    97 
       
    98 COMPILE_ASSERT(0 == SVGTextContentElement::LENGTHADJUST_UNKNOWN, SVGTextContentElementEnumLENGTHADJUST_UNKNOWNIsWrongUseDontCheckEnums);
       
    99 COMPILE_ASSERT(1 == SVGTextContentElement::LENGTHADJUST_SPACING, SVGTextContentElementEnumLENGTHADJUST_SPACINGIsWrongUseDontCheckEnums);
       
   100 COMPILE_ASSERT(2 == SVGTextContentElement::LENGTHADJUST_SPACINGANDGLYPHS, SVGTextContentElementEnumLENGTHADJUST_SPACINGANDGLYPHSIsWrongUseDontCheckEnums);
       
   101 
       
   102 class JSSVGTextContentElementConstructor : public DOMConstructorObject {
       
   103 public:
       
   104     JSSVGTextContentElementConstructor(JSC::ExecState*, JSDOMGlobalObject*);
       
   105 
       
   106     virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);
       
   107     virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);
       
   108     virtual const JSC::ClassInfo* classInfo() const { return &s_info; }
       
   109     static const JSC::ClassInfo s_info;
       
   110     static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype)
       
   111     {
       
   112         return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount);
       
   113     }
       
   114 protected:
       
   115     static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags;
       
   116 };
       
   117 
       
   118 const ClassInfo JSSVGTextContentElementConstructor::s_info = { "SVGTextContentElementConstructor", 0, &JSSVGTextContentElementConstructorTable, 0 };
       
   119 
       
   120 JSSVGTextContentElementConstructor::JSSVGTextContentElementConstructor(ExecState* exec, JSDOMGlobalObject* globalObject)
       
   121     : DOMConstructorObject(JSSVGTextContentElementConstructor::createStructure(globalObject->objectPrototype()), globalObject)
       
   122 {
       
   123     putDirect(exec->propertyNames().prototype, JSSVGTextContentElementPrototype::self(exec, globalObject), DontDelete | ReadOnly);
       
   124 }
       
   125 
       
   126 bool JSSVGTextContentElementConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
   127 {
       
   128     return getStaticValueSlot<JSSVGTextContentElementConstructor, DOMObject>(exec, &JSSVGTextContentElementConstructorTable, this, propertyName, slot);
       
   129 }
       
   130 
       
   131 bool JSSVGTextContentElementConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
       
   132 {
       
   133     return getStaticValueDescriptor<JSSVGTextContentElementConstructor, DOMObject>(exec, &JSSVGTextContentElementConstructorTable, this, propertyName, descriptor);
       
   134 }
       
   135 
       
   136 /* Hash table for prototype */
       
   137 #if ENABLE(JIT)
       
   138 #define THUNK_GENERATOR(generator) , generator
       
   139 #else
       
   140 #define THUNK_GENERATOR(generator)
       
   141 #endif
       
   142 
       
   143 static const HashTableValue JSSVGTextContentElementPrototypeTableValues[15] =
       
   144 {
       
   145     { "LENGTHADJUST_UNKNOWN", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGTextContentElementLENGTHADJUST_UNKNOWN), (intptr_t)0 THUNK_GENERATOR(0) },
       
   146     { "LENGTHADJUST_SPACING", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGTextContentElementLENGTHADJUST_SPACING), (intptr_t)0 THUNK_GENERATOR(0) },
       
   147     { "LENGTHADJUST_SPACINGANDGLYPHS", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGTextContentElementLENGTHADJUST_SPACINGANDGLYPHS), (intptr_t)0 THUNK_GENERATOR(0) },
       
   148     { "getNumberOfChars", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsSVGTextContentElementPrototypeFunctionGetNumberOfChars), (intptr_t)0 THUNK_GENERATOR(0) },
       
   149     { "getComputedTextLength", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsSVGTextContentElementPrototypeFunctionGetComputedTextLength), (intptr_t)0 THUNK_GENERATOR(0) },
       
   150     { "getSubStringLength", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsSVGTextContentElementPrototypeFunctionGetSubStringLength), (intptr_t)2 THUNK_GENERATOR(0) },
       
   151     { "getStartPositionOfChar", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsSVGTextContentElementPrototypeFunctionGetStartPositionOfChar), (intptr_t)1 THUNK_GENERATOR(0) },
       
   152     { "getEndPositionOfChar", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsSVGTextContentElementPrototypeFunctionGetEndPositionOfChar), (intptr_t)1 THUNK_GENERATOR(0) },
       
   153     { "getExtentOfChar", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsSVGTextContentElementPrototypeFunctionGetExtentOfChar), (intptr_t)1 THUNK_GENERATOR(0) },
       
   154     { "getRotationOfChar", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsSVGTextContentElementPrototypeFunctionGetRotationOfChar), (intptr_t)1 THUNK_GENERATOR(0) },
       
   155     { "getCharNumAtPosition", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsSVGTextContentElementPrototypeFunctionGetCharNumAtPosition), (intptr_t)1 THUNK_GENERATOR(0) },
       
   156     { "selectSubString", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsSVGTextContentElementPrototypeFunctionSelectSubString), (intptr_t)2 THUNK_GENERATOR(0) },
       
   157     { "hasExtension", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsSVGTextContentElementPrototypeFunctionHasExtension), (intptr_t)1 THUNK_GENERATOR(0) },
       
   158     { "getPresentationAttribute", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsSVGTextContentElementPrototypeFunctionGetPresentationAttribute), (intptr_t)1 THUNK_GENERATOR(0) },
       
   159     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
       
   160 };
       
   161 
       
   162 #undef THUNK_GENERATOR
       
   163 static JSC_CONST_HASHTABLE HashTable JSSVGTextContentElementPrototypeTable = { 34, 31, JSSVGTextContentElementPrototypeTableValues, 0 };
       
   164 const ClassInfo JSSVGTextContentElementPrototype::s_info = { "SVGTextContentElementPrototype", 0, &JSSVGTextContentElementPrototypeTable, 0 };
       
   165 
       
   166 JSObject* JSSVGTextContentElementPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
       
   167 {
       
   168     return getDOMPrototype<JSSVGTextContentElement>(exec, globalObject);
       
   169 }
       
   170 
       
   171 bool JSSVGTextContentElementPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
   172 {
       
   173     return getStaticPropertySlot<JSSVGTextContentElementPrototype, JSObject>(exec, &JSSVGTextContentElementPrototypeTable, this, propertyName, slot);
       
   174 }
       
   175 
       
   176 bool JSSVGTextContentElementPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
       
   177 {
       
   178     return getStaticPropertyDescriptor<JSSVGTextContentElementPrototype, JSObject>(exec, &JSSVGTextContentElementPrototypeTable, this, propertyName, descriptor);
       
   179 }
       
   180 
       
   181 const ClassInfo JSSVGTextContentElement::s_info = { "SVGTextContentElement", &JSSVGElement::s_info, &JSSVGTextContentElementTable, 0 };
       
   182 
       
   183 JSSVGTextContentElement::JSSVGTextContentElement(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<SVGTextContentElement> impl)
       
   184     : JSSVGElement(structure, globalObject, impl)
       
   185 {
       
   186 }
       
   187 
       
   188 JSObject* JSSVGTextContentElement::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
       
   189 {
       
   190     return new (exec) JSSVGTextContentElementPrototype(globalObject, JSSVGTextContentElementPrototype::createStructure(JSSVGElementPrototype::self(exec, globalObject)));
       
   191 }
       
   192 
       
   193 bool JSSVGTextContentElement::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
   194 {
       
   195     return getStaticValueSlot<JSSVGTextContentElement, Base>(exec, &JSSVGTextContentElementTable, this, propertyName, slot);
       
   196 }
       
   197 
       
   198 bool JSSVGTextContentElement::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
       
   199 {
       
   200     return getStaticValueDescriptor<JSSVGTextContentElement, Base>(exec, &JSSVGTextContentElementTable, this, propertyName, descriptor);
       
   201 }
       
   202 
       
   203 JSValue jsSVGTextContentElementTextLength(ExecState* exec, JSValue slotBase, const Identifier&)
       
   204 {
       
   205     JSSVGTextContentElement* castedThis = static_cast<JSSVGTextContentElement*>(asObject(slotBase));
       
   206     UNUSED_PARAM(exec);
       
   207     SVGTextContentElement* imp = static_cast<SVGTextContentElement*>(castedThis->impl());
       
   208     RefPtr<SVGAnimatedLength> obj = imp->textLengthAnimated();
       
   209     JSValue result =  toJS(exec, castedThis->globalObject(), obj.get(), imp);
       
   210     return result;
       
   211 }
       
   212 
       
   213 JSValue jsSVGTextContentElementLengthAdjust(ExecState* exec, JSValue slotBase, const Identifier&)
       
   214 {
       
   215     JSSVGTextContentElement* castedThis = static_cast<JSSVGTextContentElement*>(asObject(slotBase));
       
   216     UNUSED_PARAM(exec);
       
   217     SVGTextContentElement* imp = static_cast<SVGTextContentElement*>(castedThis->impl());
       
   218     RefPtr<SVGAnimatedEnumeration> obj = imp->lengthAdjustAnimated();
       
   219     JSValue result =  toJS(exec, castedThis->globalObject(), obj.get(), imp);
       
   220     return result;
       
   221 }
       
   222 
       
   223 JSValue jsSVGTextContentElementRequiredFeatures(ExecState* exec, JSValue slotBase, const Identifier&)
       
   224 {
       
   225     JSSVGTextContentElement* castedThis = static_cast<JSSVGTextContentElement*>(asObject(slotBase));
       
   226     UNUSED_PARAM(exec);
       
   227     SVGTextContentElement* imp = static_cast<SVGTextContentElement*>(castedThis->impl());
       
   228     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->requiredFeatures()), imp);
       
   229     return result;
       
   230 }
       
   231 
       
   232 JSValue jsSVGTextContentElementRequiredExtensions(ExecState* exec, JSValue slotBase, const Identifier&)
       
   233 {
       
   234     JSSVGTextContentElement* castedThis = static_cast<JSSVGTextContentElement*>(asObject(slotBase));
       
   235     UNUSED_PARAM(exec);
       
   236     SVGTextContentElement* imp = static_cast<SVGTextContentElement*>(castedThis->impl());
       
   237     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->requiredExtensions()), imp);
       
   238     return result;
       
   239 }
       
   240 
       
   241 JSValue jsSVGTextContentElementSystemLanguage(ExecState* exec, JSValue slotBase, const Identifier&)
       
   242 {
       
   243     JSSVGTextContentElement* castedThis = static_cast<JSSVGTextContentElement*>(asObject(slotBase));
       
   244     UNUSED_PARAM(exec);
       
   245     SVGTextContentElement* imp = static_cast<SVGTextContentElement*>(castedThis->impl());
       
   246     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->systemLanguage()), imp);
       
   247     return result;
       
   248 }
       
   249 
       
   250 JSValue jsSVGTextContentElementXmllang(ExecState* exec, JSValue slotBase, const Identifier&)
       
   251 {
       
   252     JSSVGTextContentElement* castedThis = static_cast<JSSVGTextContentElement*>(asObject(slotBase));
       
   253     UNUSED_PARAM(exec);
       
   254     SVGTextContentElement* imp = static_cast<SVGTextContentElement*>(castedThis->impl());
       
   255     JSValue result = jsString(exec, imp->xmllang());
       
   256     return result;
       
   257 }
       
   258 
       
   259 JSValue jsSVGTextContentElementXmlspace(ExecState* exec, JSValue slotBase, const Identifier&)
       
   260 {
       
   261     JSSVGTextContentElement* castedThis = static_cast<JSSVGTextContentElement*>(asObject(slotBase));
       
   262     UNUSED_PARAM(exec);
       
   263     SVGTextContentElement* imp = static_cast<SVGTextContentElement*>(castedThis->impl());
       
   264     JSValue result = jsString(exec, imp->xmlspace());
       
   265     return result;
       
   266 }
       
   267 
       
   268 JSValue jsSVGTextContentElementExternalResourcesRequired(ExecState* exec, JSValue slotBase, const Identifier&)
       
   269 {
       
   270     JSSVGTextContentElement* castedThis = static_cast<JSSVGTextContentElement*>(asObject(slotBase));
       
   271     UNUSED_PARAM(exec);
       
   272     SVGTextContentElement* imp = static_cast<SVGTextContentElement*>(castedThis->impl());
       
   273     RefPtr<SVGAnimatedBoolean> obj = imp->externalResourcesRequiredAnimated();
       
   274     JSValue result =  toJS(exec, castedThis->globalObject(), obj.get(), imp);
       
   275     return result;
       
   276 }
       
   277 
       
   278 JSValue jsSVGTextContentElementClassName(ExecState* exec, JSValue slotBase, const Identifier&)
       
   279 {
       
   280     JSSVGTextContentElement* castedThis = static_cast<JSSVGTextContentElement*>(asObject(slotBase));
       
   281     UNUSED_PARAM(exec);
       
   282     SVGTextContentElement* imp = static_cast<SVGTextContentElement*>(castedThis->impl());
       
   283     RefPtr<SVGAnimatedString> obj = imp->classNameAnimated();
       
   284     JSValue result =  toJS(exec, castedThis->globalObject(), obj.get(), imp);
       
   285     return result;
       
   286 }
       
   287 
       
   288 JSValue jsSVGTextContentElementStyle(ExecState* exec, JSValue slotBase, const Identifier&)
       
   289 {
       
   290     JSSVGTextContentElement* castedThis = static_cast<JSSVGTextContentElement*>(asObject(slotBase));
       
   291     UNUSED_PARAM(exec);
       
   292     SVGTextContentElement* imp = static_cast<SVGTextContentElement*>(castedThis->impl());
       
   293     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->style()));
       
   294     return result;
       
   295 }
       
   296 
       
   297 JSValue jsSVGTextContentElementConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
       
   298 {
       
   299     JSSVGTextContentElement* domObject = static_cast<JSSVGTextContentElement*>(asObject(slotBase));
       
   300     return JSSVGTextContentElement::getConstructor(exec, domObject->globalObject());
       
   301 }
       
   302 void JSSVGTextContentElement::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
       
   303 {
       
   304     lookupPut<JSSVGTextContentElement, Base>(exec, propertyName, value, &JSSVGTextContentElementTable, this, slot);
       
   305 }
       
   306 
       
   307 void setJSSVGTextContentElementXmllang(ExecState* exec, JSObject* thisObject, JSValue value)
       
   308 {
       
   309     JSSVGTextContentElement* castedThis = static_cast<JSSVGTextContentElement*>(thisObject);
       
   310     SVGTextContentElement* imp = static_cast<SVGTextContentElement*>(castedThis->impl());
       
   311     imp->setXmllang(ustringToString(value.toString(exec)));
       
   312 }
       
   313 
       
   314 void setJSSVGTextContentElementXmlspace(ExecState* exec, JSObject* thisObject, JSValue value)
       
   315 {
       
   316     JSSVGTextContentElement* castedThis = static_cast<JSSVGTextContentElement*>(thisObject);
       
   317     SVGTextContentElement* imp = static_cast<SVGTextContentElement*>(castedThis->impl());
       
   318     imp->setXmlspace(ustringToString(value.toString(exec)));
       
   319 }
       
   320 
       
   321 JSValue JSSVGTextContentElement::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
       
   322 {
       
   323     return getDOMConstructor<JSSVGTextContentElementConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
       
   324 }
       
   325 
       
   326 EncodedJSValue JSC_HOST_CALL jsSVGTextContentElementPrototypeFunctionGetNumberOfChars(ExecState* exec)
       
   327 {
       
   328     JSValue thisValue = exec->hostThisValue();
       
   329     if (!thisValue.inherits(&JSSVGTextContentElement::s_info))
       
   330         return throwVMTypeError(exec);
       
   331     JSSVGTextContentElement* castedThis = static_cast<JSSVGTextContentElement*>(asObject(thisValue));
       
   332     SVGTextContentElement* imp = static_cast<SVGTextContentElement*>(castedThis->impl());
       
   333 
       
   334 
       
   335     JSC::JSValue result = jsNumber(exec, imp->getNumberOfChars());
       
   336     return JSValue::encode(result);
       
   337 }
       
   338 
       
   339 EncodedJSValue JSC_HOST_CALL jsSVGTextContentElementPrototypeFunctionGetComputedTextLength(ExecState* exec)
       
   340 {
       
   341     JSValue thisValue = exec->hostThisValue();
       
   342     if (!thisValue.inherits(&JSSVGTextContentElement::s_info))
       
   343         return throwVMTypeError(exec);
       
   344     JSSVGTextContentElement* castedThis = static_cast<JSSVGTextContentElement*>(asObject(thisValue));
       
   345     SVGTextContentElement* imp = static_cast<SVGTextContentElement*>(castedThis->impl());
       
   346 
       
   347 
       
   348     JSC::JSValue result = jsNumber(exec, imp->getComputedTextLength());
       
   349     return JSValue::encode(result);
       
   350 }
       
   351 
       
   352 EncodedJSValue JSC_HOST_CALL jsSVGTextContentElementPrototypeFunctionGetSubStringLength(ExecState* exec)
       
   353 {
       
   354     JSValue thisValue = exec->hostThisValue();
       
   355     if (!thisValue.inherits(&JSSVGTextContentElement::s_info))
       
   356         return throwVMTypeError(exec);
       
   357     JSSVGTextContentElement* castedThis = static_cast<JSSVGTextContentElement*>(asObject(thisValue));
       
   358     SVGTextContentElement* imp = static_cast<SVGTextContentElement*>(castedThis->impl());
       
   359     ExceptionCode ec = 0;
       
   360     int offset = exec->argument(0).toInt32(exec);
       
   361     if (offset < 0) {
       
   362         setDOMException(exec, INDEX_SIZE_ERR);
       
   363         return JSValue::encode(jsUndefined());
       
   364     }
       
   365     int length = exec->argument(1).toInt32(exec);
       
   366     if (length < 0) {
       
   367         setDOMException(exec, INDEX_SIZE_ERR);
       
   368         return JSValue::encode(jsUndefined());
       
   369     }
       
   370 
       
   371 
       
   372     JSC::JSValue result = jsNumber(exec, imp->getSubStringLength(offset, length, ec));
       
   373     setDOMException(exec, ec);
       
   374     return JSValue::encode(result);
       
   375 }
       
   376 
       
   377 EncodedJSValue JSC_HOST_CALL jsSVGTextContentElementPrototypeFunctionGetStartPositionOfChar(ExecState* exec)
       
   378 {
       
   379     JSValue thisValue = exec->hostThisValue();
       
   380     if (!thisValue.inherits(&JSSVGTextContentElement::s_info))
       
   381         return throwVMTypeError(exec);
       
   382     JSSVGTextContentElement* castedThis = static_cast<JSSVGTextContentElement*>(asObject(thisValue));
       
   383     SVGTextContentElement* imp = static_cast<SVGTextContentElement*>(castedThis->impl());
       
   384     ExceptionCode ec = 0;
       
   385     int offset = exec->argument(0).toInt32(exec);
       
   386     if (offset < 0) {
       
   387         setDOMException(exec, INDEX_SIZE_ERR);
       
   388         return JSValue::encode(jsUndefined());
       
   389     }
       
   390 
       
   391 
       
   392     JSC::JSValue result = toJS(exec, castedThis->globalObject(), JSSVGStaticPODTypeWrapper<FloatPoint>::create(imp->getStartPositionOfChar(offset, ec)).get(), 0 /* no context on purpose */);
       
   393     setDOMException(exec, ec);
       
   394     return JSValue::encode(result);
       
   395 }
       
   396 
       
   397 EncodedJSValue JSC_HOST_CALL jsSVGTextContentElementPrototypeFunctionGetEndPositionOfChar(ExecState* exec)
       
   398 {
       
   399     JSValue thisValue = exec->hostThisValue();
       
   400     if (!thisValue.inherits(&JSSVGTextContentElement::s_info))
       
   401         return throwVMTypeError(exec);
       
   402     JSSVGTextContentElement* castedThis = static_cast<JSSVGTextContentElement*>(asObject(thisValue));
       
   403     SVGTextContentElement* imp = static_cast<SVGTextContentElement*>(castedThis->impl());
       
   404     ExceptionCode ec = 0;
       
   405     int offset = exec->argument(0).toInt32(exec);
       
   406     if (offset < 0) {
       
   407         setDOMException(exec, INDEX_SIZE_ERR);
       
   408         return JSValue::encode(jsUndefined());
       
   409     }
       
   410 
       
   411 
       
   412     JSC::JSValue result = toJS(exec, castedThis->globalObject(), JSSVGStaticPODTypeWrapper<FloatPoint>::create(imp->getEndPositionOfChar(offset, ec)).get(), 0 /* no context on purpose */);
       
   413     setDOMException(exec, ec);
       
   414     return JSValue::encode(result);
       
   415 }
       
   416 
       
   417 EncodedJSValue JSC_HOST_CALL jsSVGTextContentElementPrototypeFunctionGetExtentOfChar(ExecState* exec)
       
   418 {
       
   419     JSValue thisValue = exec->hostThisValue();
       
   420     if (!thisValue.inherits(&JSSVGTextContentElement::s_info))
       
   421         return throwVMTypeError(exec);
       
   422     JSSVGTextContentElement* castedThis = static_cast<JSSVGTextContentElement*>(asObject(thisValue));
       
   423     SVGTextContentElement* imp = static_cast<SVGTextContentElement*>(castedThis->impl());
       
   424     ExceptionCode ec = 0;
       
   425     int offset = exec->argument(0).toInt32(exec);
       
   426     if (offset < 0) {
       
   427         setDOMException(exec, INDEX_SIZE_ERR);
       
   428         return JSValue::encode(jsUndefined());
       
   429     }
       
   430 
       
   431 
       
   432     JSC::JSValue result = toJS(exec, castedThis->globalObject(), JSSVGStaticPODTypeWrapper<FloatRect>::create(imp->getExtentOfChar(offset, ec)).get(), 0 /* no context on purpose */);
       
   433     setDOMException(exec, ec);
       
   434     return JSValue::encode(result);
       
   435 }
       
   436 
       
   437 EncodedJSValue JSC_HOST_CALL jsSVGTextContentElementPrototypeFunctionGetRotationOfChar(ExecState* exec)
       
   438 {
       
   439     JSValue thisValue = exec->hostThisValue();
       
   440     if (!thisValue.inherits(&JSSVGTextContentElement::s_info))
       
   441         return throwVMTypeError(exec);
       
   442     JSSVGTextContentElement* castedThis = static_cast<JSSVGTextContentElement*>(asObject(thisValue));
       
   443     SVGTextContentElement* imp = static_cast<SVGTextContentElement*>(castedThis->impl());
       
   444     ExceptionCode ec = 0;
       
   445     int offset = exec->argument(0).toInt32(exec);
       
   446     if (offset < 0) {
       
   447         setDOMException(exec, INDEX_SIZE_ERR);
       
   448         return JSValue::encode(jsUndefined());
       
   449     }
       
   450 
       
   451 
       
   452     JSC::JSValue result = jsNumber(exec, imp->getRotationOfChar(offset, ec));
       
   453     setDOMException(exec, ec);
       
   454     return JSValue::encode(result);
       
   455 }
       
   456 
       
   457 EncodedJSValue JSC_HOST_CALL jsSVGTextContentElementPrototypeFunctionGetCharNumAtPosition(ExecState* exec)
       
   458 {
       
   459     JSValue thisValue = exec->hostThisValue();
       
   460     if (!thisValue.inherits(&JSSVGTextContentElement::s_info))
       
   461         return throwVMTypeError(exec);
       
   462     JSSVGTextContentElement* castedThis = static_cast<JSSVGTextContentElement*>(asObject(thisValue));
       
   463     SVGTextContentElement* imp = static_cast<SVGTextContentElement*>(castedThis->impl());
       
   464     FloatPoint point = toSVGPoint(exec->argument(0));
       
   465 
       
   466 
       
   467     JSC::JSValue result = jsNumber(exec, imp->getCharNumAtPosition(point));
       
   468     return JSValue::encode(result);
       
   469 }
       
   470 
       
   471 EncodedJSValue JSC_HOST_CALL jsSVGTextContentElementPrototypeFunctionSelectSubString(ExecState* exec)
       
   472 {
       
   473     JSValue thisValue = exec->hostThisValue();
       
   474     if (!thisValue.inherits(&JSSVGTextContentElement::s_info))
       
   475         return throwVMTypeError(exec);
       
   476     JSSVGTextContentElement* castedThis = static_cast<JSSVGTextContentElement*>(asObject(thisValue));
       
   477     SVGTextContentElement* imp = static_cast<SVGTextContentElement*>(castedThis->impl());
       
   478     ExceptionCode ec = 0;
       
   479     int offset = exec->argument(0).toInt32(exec);
       
   480     if (offset < 0) {
       
   481         setDOMException(exec, INDEX_SIZE_ERR);
       
   482         return JSValue::encode(jsUndefined());
       
   483     }
       
   484     int length = exec->argument(1).toInt32(exec);
       
   485     if (length < 0) {
       
   486         setDOMException(exec, INDEX_SIZE_ERR);
       
   487         return JSValue::encode(jsUndefined());
       
   488     }
       
   489 
       
   490     imp->selectSubString(offset, length, ec);
       
   491     setDOMException(exec, ec);
       
   492     return JSValue::encode(jsUndefined());
       
   493 }
       
   494 
       
   495 EncodedJSValue JSC_HOST_CALL jsSVGTextContentElementPrototypeFunctionHasExtension(ExecState* exec)
       
   496 {
       
   497     JSValue thisValue = exec->hostThisValue();
       
   498     if (!thisValue.inherits(&JSSVGTextContentElement::s_info))
       
   499         return throwVMTypeError(exec);
       
   500     JSSVGTextContentElement* castedThis = static_cast<JSSVGTextContentElement*>(asObject(thisValue));
       
   501     SVGTextContentElement* imp = static_cast<SVGTextContentElement*>(castedThis->impl());
       
   502     const String& extension = ustringToString(exec->argument(0).toString(exec));
       
   503 
       
   504 
       
   505     JSC::JSValue result = jsBoolean(imp->hasExtension(extension));
       
   506     return JSValue::encode(result);
       
   507 }
       
   508 
       
   509 EncodedJSValue JSC_HOST_CALL jsSVGTextContentElementPrototypeFunctionGetPresentationAttribute(ExecState* exec)
       
   510 {
       
   511     JSValue thisValue = exec->hostThisValue();
       
   512     if (!thisValue.inherits(&JSSVGTextContentElement::s_info))
       
   513         return throwVMTypeError(exec);
       
   514     JSSVGTextContentElement* castedThis = static_cast<JSSVGTextContentElement*>(asObject(thisValue));
       
   515     SVGTextContentElement* imp = static_cast<SVGTextContentElement*>(castedThis->impl());
       
   516     const String& name = ustringToString(exec->argument(0).toString(exec));
       
   517 
       
   518 
       
   519     JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->getPresentationAttribute(name)));
       
   520     return JSValue::encode(result);
       
   521 }
       
   522 
       
   523 // Constant getters
       
   524 
       
   525 JSValue jsSVGTextContentElementLENGTHADJUST_UNKNOWN(ExecState* exec, JSValue, const Identifier&)
       
   526 {
       
   527     return jsNumber(exec, static_cast<int>(0));
       
   528 }
       
   529 
       
   530 JSValue jsSVGTextContentElementLENGTHADJUST_SPACING(ExecState* exec, JSValue, const Identifier&)
       
   531 {
       
   532     return jsNumber(exec, static_cast<int>(1));
       
   533 }
       
   534 
       
   535 JSValue jsSVGTextContentElementLENGTHADJUST_SPACINGANDGLYPHS(ExecState* exec, JSValue, const Identifier&)
       
   536 {
       
   537     return jsNumber(exec, static_cast<int>(2));
       
   538 }
       
   539 
       
   540 
       
   541 }
       
   542 
       
   543 #endif // ENABLE(SVG)