コード例 #1
0
ファイル: JSSVGLength.cpp プロジェクト: Crawping/davinci
JSValue* JSSVGLength::getValueProperty(ExecState* exec, int token) const
{
    switch (token) {
    case UnitTypeAttrNum: {
        SVGLength imp(*impl());

        return jsNumber(imp.unitType());
    }
    case ValueAttrNum: {
        SVGLength imp(*impl());

        return jsNumber(imp.value());
    }
    case ValueInSpecifiedUnitsAttrNum: {
        SVGLength imp(*impl());

        return jsNumber(imp.valueInSpecifiedUnits());
    }
    case ValueAsStringAttrNum: {
        SVGLength imp(*impl());

        return jsString(imp.valueAsString());
    }
    case ConstructorAttrNum:
        return getConstructor(exec);
    }
    return 0;
}
コード例 #2
0
ファイル: JSRect.cpp プロジェクト: FilipBE/qtextended
JSValue* JSRect::getValueProperty(ExecState* exec, int token) const
{
    switch (token) {
    case TopAttrNum: {
        Rect* imp = static_cast<Rect*>(impl());

        return toJS(exec, WTF::getPtr(imp->top()));
    }
    case RightAttrNum: {
        Rect* imp = static_cast<Rect*>(impl());

        return toJS(exec, WTF::getPtr(imp->right()));
    }
    case BottomAttrNum: {
        Rect* imp = static_cast<Rect*>(impl());

        return toJS(exec, WTF::getPtr(imp->bottom()));
    }
    case LeftAttrNum: {
        Rect* imp = static_cast<Rect*>(impl());

        return toJS(exec, WTF::getPtr(imp->left()));
    }
    case ConstructorAttrNum:
        return getConstructor(exec);
    }
    return 0;
}
コード例 #3
0
JSValue* JSHTMLTextAreaElement::getValueProperty(ExecState* exec, int token) const
{
    switch (token) {
    case DefaultValueAttrNum: {
        HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(impl());
        return jsString(exec, imp->defaultValue());
    }
    case FormAttrNum: {
        HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(impl());
        return toJS(exec, WTF::getPtr(imp->form()));
    }
    case AccessKeyAttrNum: {
        HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(impl());
        return jsString(exec, imp->accessKey());
    }
    case ColsAttrNum: {
        HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(impl());
        return jsNumber(exec, imp->cols());
    }
    case DisabledAttrNum: {
        HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(impl());
        return jsBoolean(imp->disabled());
    }
    case AutofocusAttrNum: {
        HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(impl());
        return jsBoolean(imp->autofocus());
    }
    case NameAttrNum: {
        HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(impl());
        return jsString(exec, imp->name());
    }
    case ReadOnlyAttrNum: {
        HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(impl());
        return jsBoolean(imp->readOnly());
    }
    case RowsAttrNum: {
        HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(impl());
        return jsNumber(exec, imp->rows());
    }
    case TypeAttrNum: {
        HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(impl());
        return jsString(exec, imp->type());
    }
    case ValueAttrNum: {
        HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(impl());
        return jsString(exec, imp->value());
    }
    case SelectionStartAttrNum: {
        HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(impl());
        return jsNumber(exec, imp->selectionStart());
    }
    case SelectionEndAttrNum: {
        HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(impl());
        return jsNumber(exec, imp->selectionEnd());
    }
    case ConstructorAttrNum:
        return getConstructor(exec);
    }
    return 0;
}
コード例 #4
0
JSValue* JSHTMLFrameElement::getValueProperty(ExecState* exec, int token) const
{
    switch (token) {
    case FrameBorderAttrNum: {
        HTMLFrameElement* imp = static_cast<HTMLFrameElement*>(impl());
        return jsString(exec, imp->frameBorder());
    }
    case LongDescAttrNum: {
        HTMLFrameElement* imp = static_cast<HTMLFrameElement*>(impl());
        return jsString(exec, imp->longDesc());
    }
    case MarginHeightAttrNum: {
        HTMLFrameElement* imp = static_cast<HTMLFrameElement*>(impl());
        return jsString(exec, imp->marginHeight());
    }
    case MarginWidthAttrNum: {
        HTMLFrameElement* imp = static_cast<HTMLFrameElement*>(impl());
        return jsString(exec, imp->marginWidth());
    }
    case NameAttrNum: {
        HTMLFrameElement* imp = static_cast<HTMLFrameElement*>(impl());
        return jsString(exec, imp->name());
    }
    case NoResizeAttrNum: {
        HTMLFrameElement* imp = static_cast<HTMLFrameElement*>(impl());
        return jsBoolean(imp->noResize());
    }
    case ScrollingAttrNum: {
        HTMLFrameElement* imp = static_cast<HTMLFrameElement*>(impl());
        return jsString(exec, imp->scrolling());
    }
    case SrcAttrNum: {
        HTMLFrameElement* imp = static_cast<HTMLFrameElement*>(impl());
        return jsString(exec, imp->src());
    }
    case ContentDocumentAttrNum: {
        HTMLFrameElement* imp = static_cast<HTMLFrameElement*>(impl());
        return checkNodeSecurity(exec, imp->contentDocument()) ? toJS(exec, WTF::getPtr(imp->contentDocument())) : jsUndefined();
    }
    case ContentWindowAttrNum: {
        HTMLFrameElement* imp = static_cast<HTMLFrameElement*>(impl());
        return toJS(exec, WTF::getPtr(imp->contentWindow()));
    }
    case LocationAttrNum: {
        HTMLFrameElement* imp = static_cast<HTMLFrameElement*>(impl());
        return jsString(exec, imp->location());
    }
    case WidthAttrNum: {
        HTMLFrameElement* imp = static_cast<HTMLFrameElement*>(impl());
        return jsNumber(exec, imp->width());
    }
    case HeightAttrNum: {
        HTMLFrameElement* imp = static_cast<HTMLFrameElement*>(impl());
        return jsNumber(exec, imp->height());
    }
    case ConstructorAttrNum:
        return getConstructor(exec);
    }
    return 0;
}
コード例 #5
0
ファイル: JSDocumentType.cpp プロジェクト: Chingliu/EAWebkit
JSValue* JSDocumentType::getValueProperty(ExecState* exec, int token) const
{
    switch (token) {
    case NameAttrNum: {
        DocumentType* imp = static_cast<DocumentType*>(impl());
        return jsString(exec, imp->name());
    }
    case EntitiesAttrNum: {
        DocumentType* imp = static_cast<DocumentType*>(impl());
        return toJS(exec, WTF::getPtr(imp->entities()));
    }
    case NotationsAttrNum: {
        DocumentType* imp = static_cast<DocumentType*>(impl());
        return toJS(exec, WTF::getPtr(imp->notations()));
    }
    case PublicIdAttrNum: {
        DocumentType* imp = static_cast<DocumentType*>(impl());
        return jsStringOrNull(exec, imp->publicId());
    }
    case SystemIdAttrNum: {
        DocumentType* imp = static_cast<DocumentType*>(impl());
        return jsStringOrNull(exec, imp->systemId());
    }
    case InternalSubsetAttrNum: {
        DocumentType* imp = static_cast<DocumentType*>(impl());
        return jsStringOrNull(exec, imp->internalSubset());
    }
    case ConstructorAttrNum:
        return getConstructor(exec);
    }
    return 0;
}
コード例 #6
0
JSValue* JSHTMLTableColElement::getValueProperty(ExecState* exec, int token) const
{
    switch (token) {
    case AlignAttrNum: {
        HTMLTableColElement* imp = static_cast<HTMLTableColElement*>(impl());
        return jsString(exec, imp->align());
    }
    case ChAttrNum: {
        HTMLTableColElement* imp = static_cast<HTMLTableColElement*>(impl());
        return jsString(exec, imp->ch());
    }
    case ChOffAttrNum: {
        HTMLTableColElement* imp = static_cast<HTMLTableColElement*>(impl());
        return jsString(exec, imp->chOff());
    }
    case SpanAttrNum: {
        HTMLTableColElement* imp = static_cast<HTMLTableColElement*>(impl());
        return jsNumber(exec, imp->span());
    }
    case VAlignAttrNum: {
        HTMLTableColElement* imp = static_cast<HTMLTableColElement*>(impl());
        return jsString(exec, imp->vAlign());
    }
    case WidthAttrNum: {
        HTMLTableColElement* imp = static_cast<HTMLTableColElement*>(impl());
        return jsString(exec, imp->width());
    }
    case ConstructorAttrNum:
        return getConstructor(exec);
    }
    return 0;
}
コード例 #7
0
ファイル: JSCSSRule.cpp プロジェクト: FilipBE/qtextended
JSValue* JSCSSRule::getValueProperty(ExecState* exec, int token) const
{
    switch (token) {
    case TypeAttrNum: {
        CSSRule* imp = static_cast<CSSRule*>(impl());

        return jsNumber(imp->type());
    }
    case CssTextAttrNum: {
        CSSRule* imp = static_cast<CSSRule*>(impl());

        return jsStringOrNull(imp->cssText());
    }
    case ParentStyleSheetAttrNum: {
        CSSRule* imp = static_cast<CSSRule*>(impl());

        return toJS(exec, WTF::getPtr(imp->parentStyleSheet()));
    }
    case ParentRuleAttrNum: {
        CSSRule* imp = static_cast<CSSRule*>(impl());

        return toJS(exec, WTF::getPtr(imp->parentRule()));
    }
    case ConstructorAttrNum:
        return getConstructor(exec);
    }
    return 0;
}
コード例 #8
0
JSValue* JSHTMLTableSectionElement::getValueProperty(ExecState* exec, int token) const
{
    switch (token) {
    case AlignAttrNum: {
        HTMLTableSectionElement* imp = static_cast<HTMLTableSectionElement*>(impl());
        return jsString(exec, imp->align());
    }
    case ChAttrNum: {
        HTMLTableSectionElement* imp = static_cast<HTMLTableSectionElement*>(impl());
        return jsString(exec, imp->ch());
    }
    case ChOffAttrNum: {
        HTMLTableSectionElement* imp = static_cast<HTMLTableSectionElement*>(impl());
        return jsString(exec, imp->chOff());
    }
    case VAlignAttrNum: {
        HTMLTableSectionElement* imp = static_cast<HTMLTableSectionElement*>(impl());
        return jsString(exec, imp->vAlign());
    }
    case RowsAttrNum: {
        HTMLTableSectionElement* imp = static_cast<HTMLTableSectionElement*>(impl());
        return toJS(exec, WTF::getPtr(imp->rows()));
    }
    case ConstructorAttrNum:
        return getConstructor(exec);
    }
    return 0;
}
コード例 #9
0
JSValue* JSMutationEvent::getValueProperty(ExecState* exec, int token) const
{
    switch (token) {
    case RelatedNodeAttrNum: {
        MutationEvent* imp = static_cast<MutationEvent*>(impl());
        return toJS(exec, WTF::getPtr(imp->relatedNode()));
    }
    case PrevValueAttrNum: {
        MutationEvent* imp = static_cast<MutationEvent*>(impl());
        return jsString(exec, imp->prevValue());
    }
    case NewValueAttrNum: {
        MutationEvent* imp = static_cast<MutationEvent*>(impl());
        return jsString(exec, imp->newValue());
    }
    case AttrNameAttrNum: {
        MutationEvent* imp = static_cast<MutationEvent*>(impl());
        return jsString(exec, imp->attrName());
    }
    case AttrChangeAttrNum: {
        MutationEvent* imp = static_cast<MutationEvent*>(impl());
        return jsNumber(exec, imp->attrChange());
    }
    case ConstructorAttrNum:
        return getConstructor(exec);
    }
    return 0;
}
コード例 #10
0
v8::Local<v8::Function> V8DOMWrapper::getConstructorForContext(WrapperTypeInfo* type, v8::Handle<v8::Context> context)
{
    // Enter the scope for this context to get the correct constructor.
    v8::Context::Scope scope(context);

    return getConstructor(type, V8DOMWindowShell::getHiddenObjectPrototype(context));
}
コード例 #11
0
ファイル: JSXPathEvaluator.cpp プロジェクト: Crawping/davinci
JSValue* JSXPathEvaluator::getValueProperty(ExecState* exec, int token) const
{
    switch (token) {
    case ConstructorAttrNum:
        return getConstructor(exec);
    }
    return 0;
}
コード例 #12
0
JSValue* JSHTMLMarqueeElement::getValueProperty(ExecState* exec, int token) const
{
    switch (token) {
    case ConstructorAttrNum:
        return getConstructor(exec);
    }
    return 0;
}
コード例 #13
0
ファイル: JSCDATASection.cpp プロジェクト: Chingliu/EAWebkit
JSValue* JSCDATASection::getValueProperty(ExecState* exec, int token) const
{
    switch (token) {
    case ConstructorAttrNum:
        return getConstructor(exec);
    }
    return 0;
}
コード例 #14
0
ファイル: JSSVGUnitTypes.cpp プロジェクト: Crawping/davinci
JSValue* JSSVGUnitTypes::getValueProperty(ExecState* exec, int token) const
{
    switch (token) {
    case ConstructorAttrNum:
        return getConstructor(exec);
    }
    return 0;
}
コード例 #15
0
JSValue* JSCanvasRenderingContext2D::getValueProperty(ExecState* exec, int token) const
{
    switch (token) {
    case CanvasAttrNum: {
        CanvasRenderingContext2D* imp = static_cast<CanvasRenderingContext2D*>(impl());
        return toJS(exec, WTF::getPtr(imp->canvas()));
    }
    case GlobalAlphaAttrNum: {
        CanvasRenderingContext2D* imp = static_cast<CanvasRenderingContext2D*>(impl());
        return jsNumber(exec, imp->globalAlpha());
    }
    case GlobalCompositeOperationAttrNum: {
        CanvasRenderingContext2D* imp = static_cast<CanvasRenderingContext2D*>(impl());
        return jsString(exec, imp->globalCompositeOperation());
    }
    case LineWidthAttrNum: {
        CanvasRenderingContext2D* imp = static_cast<CanvasRenderingContext2D*>(impl());
        return jsNumber(exec, imp->lineWidth());
    }
    case LineCapAttrNum: {
        CanvasRenderingContext2D* imp = static_cast<CanvasRenderingContext2D*>(impl());
        return jsString(exec, imp->lineCap());
    }
    case LineJoinAttrNum: {
        CanvasRenderingContext2D* imp = static_cast<CanvasRenderingContext2D*>(impl());
        return jsString(exec, imp->lineJoin());
    }
    case MiterLimitAttrNum: {
        CanvasRenderingContext2D* imp = static_cast<CanvasRenderingContext2D*>(impl());
        return jsNumber(exec, imp->miterLimit());
    }
    case ShadowOffsetXAttrNum: {
        CanvasRenderingContext2D* imp = static_cast<CanvasRenderingContext2D*>(impl());
        return jsNumber(exec, imp->shadowOffsetX());
    }
    case ShadowOffsetYAttrNum: {
        CanvasRenderingContext2D* imp = static_cast<CanvasRenderingContext2D*>(impl());
        return jsNumber(exec, imp->shadowOffsetY());
    }
    case ShadowBlurAttrNum: {
        CanvasRenderingContext2D* imp = static_cast<CanvasRenderingContext2D*>(impl());
        return jsNumber(exec, imp->shadowBlur());
    }
    case ShadowColorAttrNum: {
        CanvasRenderingContext2D* imp = static_cast<CanvasRenderingContext2D*>(impl());
        return jsString(exec, imp->shadowColor());
    }
    case StrokeStyleAttrNum: {
        return strokeStyle(exec);
    }
    case FillStyleAttrNum: {
        return fillStyle(exec);
    }
    case ConstructorAttrNum:
        return getConstructor(exec);
    }
    return 0;
}
コード例 #16
0
ファイル: JSXPathResult.cpp プロジェクト: FilipBE/qtextended
JSValue* JSXPathResult::getValueProperty(ExecState* exec, int token) const
{
    switch (token) {
    case ResultTypeAttrNum: {
        XPathResult* imp = static_cast<XPathResult*>(impl());

        return jsNumber(imp->resultType());
    }
    case NumberValueAttrNum: {
        ExceptionCode ec = 0;
        XPathResult* imp = static_cast<XPathResult*>(impl());

        KJS::JSValue* result = jsNumber(imp->numberValue(ec));
        setDOMException(exec, ec);
        return result;
    }
    case StringValueAttrNum: {
        ExceptionCode ec = 0;
        XPathResult* imp = static_cast<XPathResult*>(impl());

        KJS::JSValue* result = jsString(imp->stringValue(ec));
        setDOMException(exec, ec);
        return result;
    }
    case BooleanValueAttrNum: {
        ExceptionCode ec = 0;
        XPathResult* imp = static_cast<XPathResult*>(impl());

        KJS::JSValue* result = jsBoolean(imp->booleanValue(ec));
        setDOMException(exec, ec);
        return result;
    }
    case SingleNodeValueAttrNum: {
        ExceptionCode ec = 0;
        XPathResult* imp = static_cast<XPathResult*>(impl());

        KJS::JSValue* result = toJS(exec, WTF::getPtr(imp->singleNodeValue(ec)));
        setDOMException(exec, ec);
        return result;
    }
    case InvalidIteratorStateAttrNum: {
        XPathResult* imp = static_cast<XPathResult*>(impl());

        return jsBoolean(imp->invalidIteratorState());
    }
    case SnapshotLengthAttrNum: {
        ExceptionCode ec = 0;
        XPathResult* imp = static_cast<XPathResult*>(impl());

        KJS::JSValue* result = jsNumber(imp->snapshotLength(ec));
        setDOMException(exec, ec);
        return result;
    }
    case ConstructorAttrNum:
        return getConstructor(exec);
    }
    return 0;
}
コード例 #17
0
ファイル: JSRange.cpp プロジェクト: FilipBE/qtextended
JSValue* JSRange::getValueProperty(ExecState* exec, int token) const
{
    switch (token) {
    case StartContainerAttrNum: {
        ExceptionCode ec = 0;
        Range* imp = static_cast<Range*>(impl());

        KJS::JSValue* result = toJS(exec, WTF::getPtr(imp->startContainer(ec)));
        setDOMException(exec, ec);
        return result;
    }
    case StartOffsetAttrNum: {
        ExceptionCode ec = 0;
        Range* imp = static_cast<Range*>(impl());

        KJS::JSValue* result = jsNumber(imp->startOffset(ec));
        setDOMException(exec, ec);
        return result;
    }
    case EndContainerAttrNum: {
        ExceptionCode ec = 0;
        Range* imp = static_cast<Range*>(impl());

        KJS::JSValue* result = toJS(exec, WTF::getPtr(imp->endContainer(ec)));
        setDOMException(exec, ec);
        return result;
    }
    case EndOffsetAttrNum: {
        ExceptionCode ec = 0;
        Range* imp = static_cast<Range*>(impl());

        KJS::JSValue* result = jsNumber(imp->endOffset(ec));
        setDOMException(exec, ec);
        return result;
    }
    case CollapsedAttrNum: {
        ExceptionCode ec = 0;
        Range* imp = static_cast<Range*>(impl());

        KJS::JSValue* result = jsBoolean(imp->collapsed(ec));
        setDOMException(exec, ec);
        return result;
    }
    case CommonAncestorContainerAttrNum: {
        ExceptionCode ec = 0;
        Range* imp = static_cast<Range*>(impl());

        KJS::JSValue* result = toJS(exec, WTF::getPtr(imp->commonAncestorContainer(ec)));
        setDOMException(exec, ec);
        return result;
    }
    case ConstructorAttrNum:
        return getConstructor(exec);
    }
    return 0;
}
コード例 #18
0
JSValue* JSHTMLHtmlElement::getValueProperty(ExecState* exec, int token) const
{
    switch (token) {
    case VersionAttrNum: {
        HTMLHtmlElement* imp = static_cast<HTMLHtmlElement*>(impl());
        return jsString(exec, imp->version());
    }
    case ConstructorAttrNum:
        return getConstructor(exec);
    }
    return 0;
}
コード例 #19
0
ファイル: JSTextEvent.cpp プロジェクト: Chingliu/EAWebkit
JSValue* JSTextEvent::getValueProperty(ExecState* exec, int token) const
{
    switch (token) {
    case DataAttrNum: {
        TextEvent* imp = static_cast<TextEvent*>(impl());
        return jsString(exec, imp->data());
    }
    case ConstructorAttrNum:
        return getConstructor(exec);
    }
    return 0;
}
コード例 #20
0
ファイル: JSMediaError.cpp プロジェクト: Chingliu/EAWebkit
JSValue* JSMediaError::getValueProperty(ExecState* exec, int token) const
{
    switch (token) {
    case CodeAttrNum: {
        MediaError* imp = static_cast<MediaError*>(impl());
        return jsNumber(exec, imp->code());
    }
    case ConstructorAttrNum:
        return getConstructor(exec);
    }
    return 0;
}
コード例 #21
0
JSValue* JSHTMLMenuElement::getValueProperty(ExecState* exec, int token) const
{
    switch (token) {
    case CompactAttrNum: {
        HTMLMenuElement* imp = static_cast<HTMLMenuElement*>(impl());
        return jsBoolean(imp->compact());
    }
    case ConstructorAttrNum:
        return getConstructor(exec);
    }
    return 0;
}
コード例 #22
0
JSValue* JSCSSPrimitiveValue::getValueProperty(ExecState* exec, int token) const
{
    switch (token) {
    case PrimitiveTypeAttrNum: {
        CSSPrimitiveValue* imp = static_cast<CSSPrimitiveValue*>(impl());
        return jsNumber(exec, imp->primitiveType());
    }
    case ConstructorAttrNum:
        return getConstructor(exec);
    }
    return 0;
}
コード例 #23
0
ファイル: JSNodeList.cpp プロジェクト: Gin-Rye/duibrowser
JSValue* JSNodeList::getValueProperty(ExecState* exec, int token) const
{
    switch (token) {
    case LengthAttrNum: {
        NodeList* imp = static_cast<NodeList*>(impl());
        return jsNumber(exec, imp->length());
    }
    case ConstructorAttrNum:
        return getConstructor(exec);
    }
    return 0;
}
コード例 #24
0
JSValue* JSCSSFontFaceRule::getValueProperty(ExecState* exec, int token) const
{
    switch (token) {
    case StyleAttrNum: {
        CSSFontFaceRule* imp = static_cast<CSSFontFaceRule*>(impl());
        return toJS(exec, WTF::getPtr(imp->style()));
    }
    case ConstructorAttrNum:
        return getConstructor(exec);
    }
    return 0;
}
コード例 #25
0
JSValue* JSHTMLFormElement::getValueProperty(ExecState* exec, int token) const
{
    switch (token) {
    case ElementsAttrNum: {
        HTMLFormElement* imp = static_cast<HTMLFormElement*>(impl());

        return toJS(exec, WTF::getPtr(imp->elements()));
    }
    case LengthAttrNum: {
        HTMLFormElement* imp = static_cast<HTMLFormElement*>(impl());

        return jsNumber(imp->length());
    }
    case NameAttrNum: {
        HTMLFormElement* imp = static_cast<HTMLFormElement*>(impl());

        return jsString(imp->name());
    }
    case AcceptCharsetAttrNum: {
        HTMLFormElement* imp = static_cast<HTMLFormElement*>(impl());

        return jsString(imp->acceptCharset());
    }
    case ActionAttrNum: {
        HTMLFormElement* imp = static_cast<HTMLFormElement*>(impl());

        return jsString(imp->action());
    }
    case EncodingAttrNum: {
        HTMLFormElement* imp = static_cast<HTMLFormElement*>(impl());

        return jsString(imp->encoding());
    }
    case EnctypeAttrNum: {
        HTMLFormElement* imp = static_cast<HTMLFormElement*>(impl());

        return jsString(imp->enctype());
    }
    case MethodAttrNum: {
        HTMLFormElement* imp = static_cast<HTMLFormElement*>(impl());

        return jsString(imp->method());
    }
    case TargetAttrNum: {
        HTMLFormElement* imp = static_cast<HTMLFormElement*>(impl());

        return jsString(imp->target());
    }
    case ConstructorAttrNum:
        return getConstructor(exec);
    }
    return 0;
}
コード例 #26
0
JSValue* JSHTMLParagraphElement::getValueProperty(ExecState* exec, int token) const
{
    switch (token) {
    case AlignAttrNum: {
        HTMLParagraphElement* imp = static_cast<HTMLParagraphElement*>(impl());

        return jsString(imp->align());
    }
    case ConstructorAttrNum:
        return getConstructor(exec);
    }
    return 0;
}
コード例 #27
0
JSValue* JSCSSCharsetRule::getValueProperty(ExecState* exec, int token) const
{
    switch (token) {
    case EncodingAttrNum: {
        CSSCharsetRule* imp = static_cast<CSSCharsetRule*>(impl());

        return jsStringOrNull(imp->encoding());
    }
    case ConstructorAttrNum:
        return getConstructor(exec);
    }
    return 0;
}
コード例 #28
0
ファイル: V8DOMWrapper.cpp プロジェクト: paul99/third_party
v8::Local<v8::Object> V8DOMWrapper::instantiateV8Object(V8Proxy* proxy, WrapperTypeInfo* type, void* impl)
{
#if ENABLE(WORKERS)
    WorkerContext* workerContext = 0;
#endif
    if (V8IsolatedContext::getEntered()) {
        // This effectively disables the wrapper cache for isolated worlds.
        proxy = 0;
        // FIXME: Do we need a wrapper cache for the isolated world?  We should
        //        see if the performance gains are worth while.
        // We'll get one once we give the isolated context a proper window shell.
    } else if (!proxy) {
        v8::Handle<v8::Context> context = v8::Context::GetCurrent();
        if (!context.IsEmpty()) {
            v8::Handle<v8::Object> globalPrototype = v8::Handle<v8::Object>::Cast(context->Global()->GetPrototype());
            if (isWrapperOfType(globalPrototype, &V8DOMWindow::info)) {
                Frame* frame = V8DOMWindow::toNative(globalPrototype)->frame();
                if (frame && frame->script()->canExecuteScripts(NotAboutToExecuteScript))
                    proxy = V8Proxy::retrieve(frame);
            }
#if ENABLE(WORKERS)
            else
                workerContext = V8WorkerContext::toNative(lookupDOMWrapper(V8WorkerContext::GetTemplate(), context->Global()));
#endif
        }
    }

    v8::Local<v8::Object> instance;
    if (proxy)
        // FIXME: Fix this to work properly with isolated worlds (see above).
        instance = proxy->windowShell()->createWrapperFromCache(type);
    else {
        v8::Local<v8::Function> function;
#if ENABLE(WORKERS)
        if (workerContext)
            function = getConstructor(type, workerContext);
        else
#endif
            function = type->getTemplate()->GetFunction();
        instance = SafeAllocation::newInstance(function);
    }
    if (!instance.IsEmpty()) {
        // Avoid setting the DOM wrapper for failed allocations.
        setDOMWrapper(instance, type, impl);
        if (type == &V8HTMLDocument::info)
            instance = V8HTMLDocument::WrapInShadowObject(instance, static_cast<Node*>(impl));
    }
    return instance;
}
コード例 #29
0
JSValue* JSHTMLLinkElement::getValueProperty(ExecState* exec, int token) const
{
    switch (token) {
    case DisabledAttrNum: {
        HTMLLinkElement* imp = static_cast<HTMLLinkElement*>(impl());
        return jsBoolean(imp->disabled());
    }
    case CharsetAttrNum: {
        HTMLLinkElement* imp = static_cast<HTMLLinkElement*>(impl());
        return jsString(exec, imp->charset());
    }
    case HrefAttrNum: {
        HTMLLinkElement* imp = static_cast<HTMLLinkElement*>(impl());
        return jsString(exec, imp->href());
    }
    case HreflangAttrNum: {
        HTMLLinkElement* imp = static_cast<HTMLLinkElement*>(impl());
        return jsString(exec, imp->hreflang());
    }
    case MediaAttrNum: {
        HTMLLinkElement* imp = static_cast<HTMLLinkElement*>(impl());
        return jsString(exec, imp->media());
    }
    case RelAttrNum: {
        HTMLLinkElement* imp = static_cast<HTMLLinkElement*>(impl());
        return jsString(exec, imp->rel());
    }
    case RevAttrNum: {
        HTMLLinkElement* imp = static_cast<HTMLLinkElement*>(impl());
        return jsString(exec, imp->rev());
    }
    case TargetAttrNum: {
        HTMLLinkElement* imp = static_cast<HTMLLinkElement*>(impl());
        return jsString(exec, imp->target());
    }
    case TypeAttrNum: {
        HTMLLinkElement* imp = static_cast<HTMLLinkElement*>(impl());
        return jsString(exec, imp->type());
    }
    case SheetAttrNum: {
        HTMLLinkElement* imp = static_cast<HTMLLinkElement*>(impl());
        return toJS(exec, WTF::getPtr(imp->sheet()));
    }
    case ConstructorAttrNum:
        return getConstructor(exec);
    }
    return 0;
}
コード例 #30
0
ファイル: JSCSSMediaRule.cpp プロジェクト: Gin-Rye/duibrowser
JSValue* JSCSSMediaRule::getValueProperty(ExecState* exec, int token) const
{
    switch (token) {
    case MediaAttrNum: {
        CSSMediaRule* imp = static_cast<CSSMediaRule*>(impl());
        return toJS(exec, WTF::getPtr(imp->media()));
    }
    case CssRulesAttrNum: {
        CSSMediaRule* imp = static_cast<CSSMediaRule*>(impl());
        return toJS(exec, WTF::getPtr(imp->cssRules()));
    }
    case ConstructorAttrNum:
        return getConstructor(exec);
    }
    return 0;
}