EncodedJSValue JSStyleSheetList::nameGetter(ExecState* exec, JSObject* slotBase, EncodedJSValue, PropertyName propertyName)
{
    JSStyleSheetList* thisObj = jsCast<JSStyleSheetList*>(slotBase);
    HTMLStyleElement* element = thisObj->impl().getNamedItem(propertyNameToString(propertyName));
    ASSERT(element);
    return JSValue::encode(toJS(exec, thisObj->globalObject(), element->sheet()));
}
JSValue* JSStyleSheetList::nameGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot)
{
    JSStyleSheetList* thisObj = static_cast<JSStyleSheetList*>(slot.slotBase());
    HTMLStyleElement* element = thisObj->impl()->getNamedItem(propertyName);
    ASSERT(element);
    return toJS(exec, element->sheet());
}
JSValue JSStyleSheetList::nameGetter(ExecState* exec, JSValue slotBase, const Identifier& propertyName)
{
    JSStyleSheetList* thisObj = static_cast<JSStyleSheetList*>(asObject(slotBase));
    HTMLStyleElement* element = thisObj->impl()->getNamedItem(identifierToString(propertyName));
    ASSERT(element);
    return toJS(exec, thisObj->globalObject(), element->sheet());
}
Example #4
0
JSValue jsStyleSheetListLength(ExecState* exec, JSValue slotBase, const Identifier&)
{
    JSStyleSheetList* castedThis = static_cast<JSStyleSheetList*>(asObject(slotBase));
    UNUSED_PARAM(exec);
    StyleSheetList* imp = static_cast<StyleSheetList*>(castedThis->impl());
    JSValue result = jsNumber(imp->length());
    return result;
}
Example #5
0
bool JSStyleSheetListOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
{
    JSStyleSheetList* jsStyleSheetList = static_cast<JSStyleSheetList*>(handle.get().asCell());
    if (!isObservable(jsStyleSheetList))
        return false;
    Document* root = jsStyleSheetList->impl()->document();
    if (!root)
        return false;
    return visitor.containsOpaqueRoot(root);
}
Example #6
0
JSValue* jsStyleSheetListPrototypeFunctionItem(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
{
    if (!thisValue->isObject(&JSStyleSheetList::s_info))
        return throwError(exec, TypeError);
    JSStyleSheetList* castedThisObj = static_cast<JSStyleSheetList*>(thisValue);
    StyleSheetList* imp = static_cast<StyleSheetList*>(castedThisObj->impl());
    unsigned index = args[0]->toInt32(exec);


    KJS::JSValue* result = toJS(exec, WTF::getPtr(imp->item(index)));
    return result;
}
Example #7
0
EncodedJSValue JSC_HOST_CALL jsStyleSheetListPrototypeFunctionItem(ExecState* exec)
{
    JSValue thisValue = exec->hostThisValue();
    if (!thisValue.inherits(&JSStyleSheetList::s_info))
        return throwVMTypeError(exec);
    JSStyleSheetList* castedThis = static_cast<JSStyleSheetList*>(asObject(thisValue));
    StyleSheetList* imp = static_cast<StyleSheetList*>(castedThis->impl());
    unsigned index(exec->argument(0).toUInt32(exec));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());


    JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->item(index)));
    return JSValue::encode(result);
}
Example #8
0
JSValue* JSStyleSheetList::indexGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot)
{
    JSStyleSheetList* thisObj = static_cast<JSStyleSheetList*>(slot.slotBase());
    return toJS(exec, static_cast<StyleSheetList*>(thisObj->impl())->item(slot.index()));
}
Example #9
0
void JSStyleSheetListOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
{
    JSStyleSheetList* jsStyleSheetList = static_cast<JSStyleSheetList*>(handle.get().asCell());
    DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);
    uncacheWrapper(world, jsStyleSheetList->impl(), jsStyleSheetList);
}
Example #10
0
JSValue JSStyleSheetList::indexGetter(ExecState* exec, JSValue slotBase, unsigned index)
{
    JSStyleSheetList* thisObj = static_cast<JSStyleSheetList*>(asObject(slotBase));
    return toJS(exec, thisObj->globalObject(), static_cast<StyleSheetList*>(thisObj->impl())->item(index));
}
Example #11
0
JSValue jsStyleSheetListConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
{
    JSStyleSheetList* domObject = static_cast<JSStyleSheetList*>(asObject(slotBase));
    return JSStyleSheetList::getConstructor(exec, domObject->globalObject());
}