void JSCSSRuleOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context) { JSCSSRule* jsCSSRule = jsCast<JSCSSRule*>(handle.get().asCell()); DOMWrapperWorld& world = *static_cast<DOMWrapperWorld*>(context); uncacheWrapper(world, &jsCSSRule->impl(), jsCSSRule); jsCSSRule->releaseImpl(); }
void setJSCSSRuleCssText(ExecState* exec, JSObject* thisObject, JSValue value) { JSCSSRule* castedThis = static_cast<JSCSSRule*>(thisObject); CSSRule* imp = static_cast<CSSRule*>(castedThis->impl()); ExceptionCode ec = 0; imp->setCssText(valueToStringWithNullCheck(exec, value), ec); setDOMException(exec, ec); }
bool JSCSSRuleOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) { JSCSSRule* jsCSSRule = jsCast<JSCSSRule*>(handle.get().asCell()); if (!isObservable(jsCSSRule)) return false; void* root = WebCore::root(&jsCSSRule->impl()); return visitor.containsOpaqueRoot(root); }
JSValue jsCSSRuleParentRule(ExecState* exec, JSValue slotBase, const Identifier&) { JSCSSRule* castedThis = static_cast<JSCSSRule*>(asObject(slotBase)); UNUSED_PARAM(exec); CSSRule* imp = static_cast<CSSRule*>(castedThis->impl()); JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->parentRule())); return result; }
JSValue jsCSSRuleCssText(ExecState* exec, JSValue slotBase, const Identifier&) { JSCSSRule* castedThis = static_cast<JSCSSRule*>(asObject(slotBase)); UNUSED_PARAM(exec); CSSRule* imp = static_cast<CSSRule*>(castedThis->impl()); JSValue result = jsStringOrNull(exec, imp->cssText()); return result; }
JSValue jsCSSRuleType(ExecState* exec, JSValue slotBase, const Identifier&) { JSCSSRule* castedThis = static_cast<JSCSSRule*>(asObject(slotBase)); UNUSED_PARAM(exec); CSSRule* imp = static_cast<CSSRule*>(castedThis->impl()); JSValue result = jsNumber(imp->type()); return result; }
EncodedJSValue jsCSSRuleConstructor(ExecState* exec, EncodedJSValue thisValue, EncodedJSValue, PropertyName) { JSCSSRule* domObject = jsDynamicCast<JSCSSRule*>(JSValue::decode(thisValue)); if (!domObject) return throwVMTypeError(exec); if (!domObject) return throwVMTypeError(exec); return JSValue::encode(JSCSSRule::getConstructor(exec->vm(), domObject->globalObject())); }
void JSCSSRule::visitChildren(JSCell* cell, SlotVisitor& visitor) { JSCSSRule* thisObject = jsCast<JSCSSRule*>(cell); ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info); COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag); ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren()); Base::visitChildren(thisObject, visitor); visitor.addOpaqueRoot(root(thisObject->impl())); }
EncodedJSValue jsCSSRuleParentRule(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) { JSCSSRule* castedThis = jsDynamicCast<JSCSSRule*>(JSValue::decode(thisValue)); UNUSED_PARAM(slotBase); if (!castedThis) return throwVMTypeError(exec); UNUSED_PARAM(exec); CSSRule& impl = castedThis->impl(); JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.parentRule())); return JSValue::encode(result); }
EncodedJSValue jsCSSRuleCssText(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName) { JSCSSRule* castedThis = jsDynamicCast<JSCSSRule*>(JSValue::decode(thisValue)); UNUSED_PARAM(slotBase); if (!castedThis) return throwVMTypeError(exec); UNUSED_PARAM(exec); CSSRule& impl = castedThis->impl(); JSValue result = jsStringOrNull(exec, impl.cssText()); return JSValue::encode(result); }
void setJSCSSRuleCssText(ExecState* exec, EncodedJSValue thisValue, EncodedJSValue encodedValue) { JSValue value = JSValue::decode(encodedValue); UNUSED_PARAM(exec); JSCSSRule* castedThis = jsDynamicCast<JSCSSRule*>(JSValue::decode(thisValue)); if (!castedThis) { throwVMTypeError(exec); return; } CSSRule& impl = castedThis->impl(); ExceptionCode ec = 0; const String& nativeValue(valueToStringWithNullCheck(exec, value)); if (exec->hadException()) return; impl.setCssText(nativeValue, ec); setDOMException(exec, ec); }
JSValue jsCSSRuleConstructor(ExecState* exec, JSValue slotBase, const Identifier&) { JSCSSRule* domObject = static_cast<JSCSSRule*>(asObject(slotBase)); return JSCSSRule::getConstructor(exec, domObject->globalObject()); }