WebCore/generated/JSStyleSheet.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 #include "JSStyleSheet.h"
       
    23 
       
    24 #include "JSMediaList.h"
       
    25 #include "JSNode.h"
       
    26 #include "JSStyleSheet.h"
       
    27 #include "KURL.h"
       
    28 #include "MediaList.h"
       
    29 #include "Node.h"
       
    30 #include "StyleSheet.h"
       
    31 #include <wtf/GetPtr.h>
       
    32 
       
    33 using namespace JSC;
       
    34 
       
    35 namespace WebCore {
       
    36 
       
    37 ASSERT_CLASS_FITS_IN_CELL(JSStyleSheet);
       
    38 
       
    39 /* Hash table */
       
    40 #if ENABLE(JIT)
       
    41 #define THUNK_GENERATOR(generator) , generator
       
    42 #else
       
    43 #define THUNK_GENERATOR(generator)
       
    44 #endif
       
    45 
       
    46 static const HashTableValue JSStyleSheetTableValues[9] =
       
    47 {
       
    48     { "type", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsStyleSheetType), (intptr_t)0 THUNK_GENERATOR(0) },
       
    49     { "disabled", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsStyleSheetDisabled), (intptr_t)setJSStyleSheetDisabled THUNK_GENERATOR(0) },
       
    50     { "ownerNode", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsStyleSheetOwnerNode), (intptr_t)0 THUNK_GENERATOR(0) },
       
    51     { "parentStyleSheet", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsStyleSheetParentStyleSheet), (intptr_t)0 THUNK_GENERATOR(0) },
       
    52     { "href", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsStyleSheetHref), (intptr_t)0 THUNK_GENERATOR(0) },
       
    53     { "title", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsStyleSheetTitle), (intptr_t)0 THUNK_GENERATOR(0) },
       
    54     { "media", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsStyleSheetMedia), (intptr_t)0 THUNK_GENERATOR(0) },
       
    55     { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsStyleSheetConstructor), (intptr_t)0 THUNK_GENERATOR(0) },
       
    56     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
       
    57 };
       
    58 
       
    59 #undef THUNK_GENERATOR
       
    60 static JSC_CONST_HASHTABLE HashTable JSStyleSheetTable = { 17, 15, JSStyleSheetTableValues, 0 };
       
    61 /* Hash table for constructor */
       
    62 #if ENABLE(JIT)
       
    63 #define THUNK_GENERATOR(generator) , generator
       
    64 #else
       
    65 #define THUNK_GENERATOR(generator)
       
    66 #endif
       
    67 
       
    68 static const HashTableValue JSStyleSheetConstructorTableValues[1] =
       
    69 {
       
    70     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
       
    71 };
       
    72 
       
    73 #undef THUNK_GENERATOR
       
    74 static JSC_CONST_HASHTABLE HashTable JSStyleSheetConstructorTable = { 1, 0, JSStyleSheetConstructorTableValues, 0 };
       
    75 class JSStyleSheetConstructor : public DOMConstructorObject {
       
    76 public:
       
    77     JSStyleSheetConstructor(JSC::ExecState*, JSDOMGlobalObject*);
       
    78 
       
    79     virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);
       
    80     virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);
       
    81     virtual const JSC::ClassInfo* classInfo() const { return &s_info; }
       
    82     static const JSC::ClassInfo s_info;
       
    83     static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype)
       
    84     {
       
    85         return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount);
       
    86     }
       
    87 protected:
       
    88     static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags;
       
    89 };
       
    90 
       
    91 const ClassInfo JSStyleSheetConstructor::s_info = { "StyleSheetConstructor", 0, &JSStyleSheetConstructorTable, 0 };
       
    92 
       
    93 JSStyleSheetConstructor::JSStyleSheetConstructor(ExecState* exec, JSDOMGlobalObject* globalObject)
       
    94     : DOMConstructorObject(JSStyleSheetConstructor::createStructure(globalObject->objectPrototype()), globalObject)
       
    95 {
       
    96     putDirect(exec->propertyNames().prototype, JSStyleSheetPrototype::self(exec, globalObject), DontDelete | ReadOnly);
       
    97 }
       
    98 
       
    99 bool JSStyleSheetConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
   100 {
       
   101     return getStaticValueSlot<JSStyleSheetConstructor, DOMObject>(exec, &JSStyleSheetConstructorTable, this, propertyName, slot);
       
   102 }
       
   103 
       
   104 bool JSStyleSheetConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
       
   105 {
       
   106     return getStaticValueDescriptor<JSStyleSheetConstructor, DOMObject>(exec, &JSStyleSheetConstructorTable, this, propertyName, descriptor);
       
   107 }
       
   108 
       
   109 /* Hash table for prototype */
       
   110 #if ENABLE(JIT)
       
   111 #define THUNK_GENERATOR(generator) , generator
       
   112 #else
       
   113 #define THUNK_GENERATOR(generator)
       
   114 #endif
       
   115 
       
   116 static const HashTableValue JSStyleSheetPrototypeTableValues[1] =
       
   117 {
       
   118     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
       
   119 };
       
   120 
       
   121 #undef THUNK_GENERATOR
       
   122 static JSC_CONST_HASHTABLE HashTable JSStyleSheetPrototypeTable = { 1, 0, JSStyleSheetPrototypeTableValues, 0 };
       
   123 const ClassInfo JSStyleSheetPrototype::s_info = { "StyleSheetPrototype", 0, &JSStyleSheetPrototypeTable, 0 };
       
   124 
       
   125 JSObject* JSStyleSheetPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
       
   126 {
       
   127     return getDOMPrototype<JSStyleSheet>(exec, globalObject);
       
   128 }
       
   129 
       
   130 const ClassInfo JSStyleSheet::s_info = { "StyleSheet", 0, &JSStyleSheetTable, 0 };
       
   131 
       
   132 JSStyleSheet::JSStyleSheet(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<StyleSheet> impl)
       
   133     : DOMObjectWithGlobalPointer(structure, globalObject)
       
   134     , m_impl(impl)
       
   135 {
       
   136 }
       
   137 
       
   138 JSStyleSheet::~JSStyleSheet()
       
   139 {
       
   140     forgetDOMObject(this, impl());
       
   141 }
       
   142 
       
   143 JSObject* JSStyleSheet::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
       
   144 {
       
   145     return new (exec) JSStyleSheetPrototype(globalObject, JSStyleSheetPrototype::createStructure(globalObject->objectPrototype()));
       
   146 }
       
   147 
       
   148 bool JSStyleSheet::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
       
   149 {
       
   150     return getStaticValueSlot<JSStyleSheet, Base>(exec, &JSStyleSheetTable, this, propertyName, slot);
       
   151 }
       
   152 
       
   153 bool JSStyleSheet::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
       
   154 {
       
   155     return getStaticValueDescriptor<JSStyleSheet, Base>(exec, &JSStyleSheetTable, this, propertyName, descriptor);
       
   156 }
       
   157 
       
   158 JSValue jsStyleSheetType(ExecState* exec, JSValue slotBase, const Identifier&)
       
   159 {
       
   160     JSStyleSheet* castedThis = static_cast<JSStyleSheet*>(asObject(slotBase));
       
   161     UNUSED_PARAM(exec);
       
   162     StyleSheet* imp = static_cast<StyleSheet*>(castedThis->impl());
       
   163     JSValue result = jsStringOrNull(exec, imp->type());
       
   164     return result;
       
   165 }
       
   166 
       
   167 JSValue jsStyleSheetDisabled(ExecState* exec, JSValue slotBase, const Identifier&)
       
   168 {
       
   169     JSStyleSheet* castedThis = static_cast<JSStyleSheet*>(asObject(slotBase));
       
   170     UNUSED_PARAM(exec);
       
   171     StyleSheet* imp = static_cast<StyleSheet*>(castedThis->impl());
       
   172     JSValue result = jsBoolean(imp->disabled());
       
   173     return result;
       
   174 }
       
   175 
       
   176 JSValue jsStyleSheetOwnerNode(ExecState* exec, JSValue slotBase, const Identifier&)
       
   177 {
       
   178     JSStyleSheet* castedThis = static_cast<JSStyleSheet*>(asObject(slotBase));
       
   179     UNUSED_PARAM(exec);
       
   180     StyleSheet* imp = static_cast<StyleSheet*>(castedThis->impl());
       
   181     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->ownerNode()));
       
   182     return result;
       
   183 }
       
   184 
       
   185 JSValue jsStyleSheetParentStyleSheet(ExecState* exec, JSValue slotBase, const Identifier&)
       
   186 {
       
   187     JSStyleSheet* castedThis = static_cast<JSStyleSheet*>(asObject(slotBase));
       
   188     UNUSED_PARAM(exec);
       
   189     StyleSheet* imp = static_cast<StyleSheet*>(castedThis->impl());
       
   190     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->parentStyleSheet()));
       
   191     return result;
       
   192 }
       
   193 
       
   194 JSValue jsStyleSheetHref(ExecState* exec, JSValue slotBase, const Identifier&)
       
   195 {
       
   196     JSStyleSheet* castedThis = static_cast<JSStyleSheet*>(asObject(slotBase));
       
   197     UNUSED_PARAM(exec);
       
   198     StyleSheet* imp = static_cast<StyleSheet*>(castedThis->impl());
       
   199     JSValue result = jsStringOrNull(exec, imp->href());
       
   200     return result;
       
   201 }
       
   202 
       
   203 JSValue jsStyleSheetTitle(ExecState* exec, JSValue slotBase, const Identifier&)
       
   204 {
       
   205     JSStyleSheet* castedThis = static_cast<JSStyleSheet*>(asObject(slotBase));
       
   206     UNUSED_PARAM(exec);
       
   207     StyleSheet* imp = static_cast<StyleSheet*>(castedThis->impl());
       
   208     JSValue result = jsStringOrNull(exec, imp->title());
       
   209     return result;
       
   210 }
       
   211 
       
   212 JSValue jsStyleSheetMedia(ExecState* exec, JSValue slotBase, const Identifier&)
       
   213 {
       
   214     JSStyleSheet* castedThis = static_cast<JSStyleSheet*>(asObject(slotBase));
       
   215     UNUSED_PARAM(exec);
       
   216     StyleSheet* imp = static_cast<StyleSheet*>(castedThis->impl());
       
   217     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->media()));
       
   218     return result;
       
   219 }
       
   220 
       
   221 JSValue jsStyleSheetConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
       
   222 {
       
   223     JSStyleSheet* domObject = static_cast<JSStyleSheet*>(asObject(slotBase));
       
   224     return JSStyleSheet::getConstructor(exec, domObject->globalObject());
       
   225 }
       
   226 void JSStyleSheet::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
       
   227 {
       
   228     lookupPut<JSStyleSheet, Base>(exec, propertyName, value, &JSStyleSheetTable, this, slot);
       
   229 }
       
   230 
       
   231 void setJSStyleSheetDisabled(ExecState* exec, JSObject* thisObject, JSValue value)
       
   232 {
       
   233     JSStyleSheet* castedThis = static_cast<JSStyleSheet*>(thisObject);
       
   234     StyleSheet* imp = static_cast<StyleSheet*>(castedThis->impl());
       
   235     imp->setDisabled(value.toBoolean(exec));
       
   236 }
       
   237 
       
   238 JSValue JSStyleSheet::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
       
   239 {
       
   240     return getDOMConstructor<JSStyleSheetConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
       
   241 }
       
   242 
       
   243 StyleSheet* toStyleSheet(JSC::JSValue value)
       
   244 {
       
   245     return value.inherits(&JSStyleSheet::s_info) ? static_cast<JSStyleSheet*>(asObject(value))->impl() : 0;
       
   246 }
       
   247 
       
   248 }