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, 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 #3
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 #4
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 #5
0
JSValue jsStyleSheetListConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
{
    JSStyleSheetList* domObject = static_cast<JSStyleSheetList*>(asObject(slotBase));
    return JSStyleSheetList::getConstructor(exec, domObject->globalObject());
}