Esempio n. 1
0
void JSXMLHttpRequest::putValueProperty(ExecState* exec, int token, JSValue* value)
{
    switch (token) {
    case OnabortAttrNum: {
        setOnabort(exec, value);
        break;
    }
    case OnerrorAttrNum: {
        setOnerror(exec, value);
        break;
    }
    case OnloadAttrNum: {
        setOnload(exec, value);
        break;
    }
    case OnloadstartAttrNum: {
        setOnloadstart(exec, value);
        break;
    }
    case OnprogressAttrNum: {
        setOnprogress(exec, value);
        break;
    }
    case OnreadystatechangeAttrNum: {
        setOnreadystatechange(exec, value);
        break;
    }
    }
}
void HTMLElementImp::eval()
{
    DocumentWindowPtr window = getOwnerDocumentImp()->activate();
    Nullable<std::u16string> attr = getAttribute(u"style");
    if (attr.hasValue()) {
        CSSParser parser;
        style = parser.parseDeclarations(attr.value());
        parser.getStyleDeclaration()->setOwner(this);
    }
    attr = getAttribute(u"onclick");
    if (attr.hasValue())
        setOnclick(window->getContext()->compileFunction(attr.value()));
    attr = getAttribute(u"onload");
    if (attr.hasValue())
        setOnload(window->getContext()->compileFunction(attr.value()));
}