static v8::Handle<v8::Value> parentStyleSheetAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) { StyleSheet* imp = V8StyleSheet::toNative(info.Holder()); RefPtr<StyleSheet> result = imp->parentStyleSheet(); v8::Handle<v8::Value> wrapper = result.get() ? v8::Handle<v8::Value>(DOMDataStore::getWrapper(result.get(), info.GetIsolate())) : v8Undefined(); if (wrapper.IsEmpty()) { wrapper = toV8(result.get(), info.Holder(), info.GetIsolate()); if (!wrapper.IsEmpty()) V8DOMWrapper::setNamedHiddenReference(info.Holder(), "parentStyleSheet", wrapper); } return wrapper; }
static v8::Handle<v8::Value> parentStyleSheetAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) { INC_STATS("DOM.StyleSheet.parentStyleSheet._get"); StyleSheet* imp = V8StyleSheet::toNative(info.Holder()); RefPtr<StyleSheet> result = imp->parentStyleSheet(); v8::Handle<v8::Value> wrapper = result.get() ? getDOMObjectMap().get(result.get()) : v8::Handle<v8::Value>(); if (wrapper.IsEmpty()) { wrapper = toV8(result.get()); if (!wrapper.IsEmpty()) V8DOMWrapper::setHiddenReference(info.Holder(), wrapper); } return wrapper; }
JSValue* JSStyleSheet::getValueProperty(ExecState* exec, int token) const { switch (token) { case TypeAttrNum: { StyleSheet* imp = static_cast<StyleSheet*>(impl()); return jsStringOrNull(exec, imp->type()); } case DisabledAttrNum: { StyleSheet* imp = static_cast<StyleSheet*>(impl()); return jsBoolean(imp->disabled()); } case OwnerNodeAttrNum: { StyleSheet* imp = static_cast<StyleSheet*>(impl()); return toJS(exec, WTF::getPtr(imp->ownerNode())); } case ParentStyleSheetAttrNum: { StyleSheet* imp = static_cast<StyleSheet*>(impl()); return toJS(exec, WTF::getPtr(imp->parentStyleSheet())); } case HrefAttrNum: { StyleSheet* imp = static_cast<StyleSheet*>(impl()); return jsStringOrNull(exec, imp->href()); } case TitleAttrNum: { StyleSheet* imp = static_cast<StyleSheet*>(impl()); return jsStringOrNull(exec, imp->title()); } case MediaAttrNum: { StyleSheet* imp = static_cast<StyleSheet*>(impl()); return toJS(exec, WTF::getPtr(imp->media())); } case ConstructorAttrNum: return getConstructor(exec); } return 0; }