コード例 #1
0
JSValue* JSSVGPathElement::getValueProperty(ExecState* exec, int token) const
{
    switch (token) {
    case PathLengthAttrNum: {
        SVGPathElement* imp = static_cast<SVGPathElement*>(impl());

        ASSERT(exec && exec->dynamicInterpreter());

        RefPtr<SVGAnimatedNumber> obj = imp->pathLengthAnimated();
        Frame* activeFrame = static_cast<ScriptInterpreter*>(exec->dynamicInterpreter())->frame();
        if (activeFrame) {
            SVGDocumentExtensions* extensions = (activeFrame->document() ? activeFrame->document()->accessSVGExtensions() : 0);
            if (extensions) {
                if (extensions->hasGenericContext<SVGAnimatedNumber>(obj.get()))
                    ASSERT(extensions->genericContext<SVGAnimatedNumber>(obj.get()) == imp);
                else
                    extensions->setGenericContext<SVGAnimatedNumber>(obj.get(), imp);
            }
        }

        return toJS(exec, obj.get());
    }
    case RequiredFeaturesAttrNum: {
        SVGPathElement* imp = static_cast<SVGPathElement*>(impl());

        return toJS(exec, WTF::getPtr(imp->requiredFeatures()));
    }
    case RequiredExtensionsAttrNum: {
        SVGPathElement* imp = static_cast<SVGPathElement*>(impl());

        return toJS(exec, WTF::getPtr(imp->requiredExtensions()));
    }
    case SystemLanguageAttrNum: {
        SVGPathElement* imp = static_cast<SVGPathElement*>(impl());

        return toJS(exec, WTF::getPtr(imp->systemLanguage()));
    }
    case XmllangAttrNum: {
        SVGPathElement* imp = static_cast<SVGPathElement*>(impl());

        return jsString(imp->xmllang());
    }
    case XmlspaceAttrNum: {
        SVGPathElement* imp = static_cast<SVGPathElement*>(impl());

        return jsString(imp->xmlspace());
    }
    case ExternalResourcesRequiredAttrNum: {
        SVGPathElement* imp = static_cast<SVGPathElement*>(impl());

        ASSERT(exec && exec->dynamicInterpreter());

        RefPtr<SVGAnimatedBoolean> obj = imp->externalResourcesRequiredAnimated();
        Frame* activeFrame = static_cast<ScriptInterpreter*>(exec->dynamicInterpreter())->frame();
        if (activeFrame) {
            SVGDocumentExtensions* extensions = (activeFrame->document() ? activeFrame->document()->accessSVGExtensions() : 0);
            if (extensions) {
                if (extensions->hasGenericContext<SVGAnimatedBoolean>(obj.get()))
                    ASSERT(extensions->genericContext<SVGAnimatedBoolean>(obj.get()) == imp);
                else
                    extensions->setGenericContext<SVGAnimatedBoolean>(obj.get(), imp);
            }
        }

        return toJS(exec, obj.get());
    }
    case ClassNameAttrNum: {
        SVGPathElement* imp = static_cast<SVGPathElement*>(impl());

        ASSERT(exec && exec->dynamicInterpreter());

        RefPtr<SVGAnimatedString> obj = imp->classNameAnimated();
        Frame* activeFrame = static_cast<ScriptInterpreter*>(exec->dynamicInterpreter())->frame();
        if (activeFrame) {
            SVGDocumentExtensions* extensions = (activeFrame->document() ? activeFrame->document()->accessSVGExtensions() : 0);
            if (extensions) {
                if (extensions->hasGenericContext<SVGAnimatedString>(obj.get()))
                    ASSERT(extensions->genericContext<SVGAnimatedString>(obj.get()) == imp);
                else
                    extensions->setGenericContext<SVGAnimatedString>(obj.get(), imp);
            }
        }

        return toJS(exec, obj.get());
    }
    case StyleAttrNum: {
        SVGPathElement* imp = static_cast<SVGPathElement*>(impl());

        return toJS(exec, WTF::getPtr(imp->style()));
    }
    case TransformAttrNum: {
        SVGPathElement* imp = static_cast<SVGPathElement*>(impl());

        ASSERT(exec && exec->dynamicInterpreter());

        RefPtr<SVGAnimatedTransformList> obj = imp->transformAnimated();
        Frame* activeFrame = static_cast<ScriptInterpreter*>(exec->dynamicInterpreter())->frame();
        if (activeFrame) {
            SVGDocumentExtensions* extensions = (activeFrame->document() ? activeFrame->document()->accessSVGExtensions() : 0);
            if (extensions) {
                if (extensions->hasGenericContext<SVGAnimatedTransformList>(obj.get()))
                    ASSERT(extensions->genericContext<SVGAnimatedTransformList>(obj.get()) == imp);
                else
                    extensions->setGenericContext<SVGAnimatedTransformList>(obj.get(), imp);
            }
        }

        return toJS(exec, obj.get());
    }
    case NearestViewportElementAttrNum: {
        SVGPathElement* imp = static_cast<SVGPathElement*>(impl());

        return toJS(exec, WTF::getPtr(imp->nearestViewportElement()));
    }
    case FarthestViewportElementAttrNum: {
        SVGPathElement* imp = static_cast<SVGPathElement*>(impl());

        return toJS(exec, WTF::getPtr(imp->farthestViewportElement()));
    }
    case PathSegListAttrNum: {
        SVGPathElement* imp = static_cast<SVGPathElement*>(impl());

        return toJS(exec, WTF::getPtr(imp->pathSegList()));
    }
    case NormalizedPathSegListAttrNum: {
        SVGPathElement* imp = static_cast<SVGPathElement*>(impl());

        return toJS(exec, WTF::getPtr(imp->normalizedPathSegList()));
    }
    case AnimatedPathSegListAttrNum: {
        SVGPathElement* imp = static_cast<SVGPathElement*>(impl());

        return toJS(exec, WTF::getPtr(imp->animatedPathSegList()));
    }
    case AnimatedNormalizedPathSegListAttrNum: {
        SVGPathElement* imp = static_cast<SVGPathElement*>(impl());

        return toJS(exec, WTF::getPtr(imp->animatedNormalizedPathSegList()));
    }
    }
    return 0;
}
コード例 #2
0
static v8::Handle<v8::Value> animatedPathSegListAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    SVGPathElement* imp = V8SVGPathElement::toNative(info.Holder());
    return toV8Fast(WTF::getPtr(imp->animatedPathSegList()), info, imp);
}
コード例 #3
0
static v8::Handle<v8::Value> animatedPathSegListAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    INC_STATS("DOM.SVGPathElement.animatedPathSegList._get");
    SVGPathElement* imp = V8SVGPathElement::toNative(info.Holder());
    return toV8(WTF::getPtr(imp->animatedPathSegList()));
}