JSValue jsHTMLFrameElementSrc(ExecState* exec, const Identifier&, const PropertySlot& slot)
{
    JSHTMLFrameElement* castedThis = static_cast<JSHTMLFrameElement*>(asObject(slot.slotBase()));
    UNUSED_PARAM(exec);
    HTMLFrameElement* imp = static_cast<HTMLFrameElement*>(castedThis->impl());
    return jsString(exec, imp->getURLAttribute(HTMLNames::srcAttr));
}
JSValue jsHTMLFrameElementHeight(ExecState* exec, const Identifier&, const PropertySlot& slot)
{
    JSHTMLFrameElement* castedThis = static_cast<JSHTMLFrameElement*>(asObject(slot.slotBase()));
    UNUSED_PARAM(exec);
    HTMLFrameElement* imp = static_cast<HTMLFrameElement*>(castedThis->impl());
    return jsNumber(exec, imp->height());
}
JSValue jsHTMLFrameElementNoResize(ExecState* exec, const Identifier&, const PropertySlot& slot)
{
    JSHTMLFrameElement* castedThis = static_cast<JSHTMLFrameElement*>(asObject(slot.slotBase()));
    UNUSED_PARAM(exec);
    HTMLFrameElement* imp = static_cast<HTMLFrameElement*>(castedThis->impl());
    return jsBoolean(imp->noResize());
}
JSValue jsHTMLFrameElementContentWindow(ExecState* exec, const Identifier&, const PropertySlot& slot)
{
    JSHTMLFrameElement* castedThis = static_cast<JSHTMLFrameElement*>(asObject(slot.slotBase()));
    UNUSED_PARAM(exec);
    HTMLFrameElement* imp = static_cast<HTMLFrameElement*>(castedThis->impl());
    return toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->contentWindow()));
}
Пример #5
0
JSValue jsHTMLFrameElementNoResize(ExecState* exec, JSValue slotBase, const Identifier&)
{
    JSHTMLFrameElement* castedThis = static_cast<JSHTMLFrameElement*>(asObject(slotBase));
    UNUSED_PARAM(exec);
    HTMLFrameElement* imp = static_cast<HTMLFrameElement*>(castedThis->impl());
    JSValue result = jsBoolean(imp->hasAttribute(WebCore::HTMLNames::noresizeAttr));
    return result;
}
Пример #6
0
JSValue jsHTMLFrameElementSrc(ExecState* exec, JSValue slotBase, const Identifier&)
{
    JSHTMLFrameElement* castedThis = static_cast<JSHTMLFrameElement*>(asObject(slotBase));
    UNUSED_PARAM(exec);
    HTMLFrameElement* imp = static_cast<HTMLFrameElement*>(castedThis->impl());
    JSValue result = jsString(exec, imp->getURLAttribute(WebCore::HTMLNames::srcAttr));
    return result;
}
Пример #7
0
JSValue jsHTMLFrameElementContentWindow(ExecState* exec, JSValue slotBase, const Identifier&)
{
    JSHTMLFrameElement* castedThis = static_cast<JSHTMLFrameElement*>(asObject(slotBase));
    UNUSED_PARAM(exec);
    HTMLFrameElement* imp = static_cast<HTMLFrameElement*>(castedThis->impl());
    JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->contentWindow()));
    return result;
}
Пример #8
0
JSValue jsHTMLFrameElementLocation(ExecState* exec, JSValue slotBase, const Identifier&)
{
    JSHTMLFrameElement* castedThis = static_cast<JSHTMLFrameElement*>(asObject(slotBase));
    UNUSED_PARAM(exec);
    HTMLFrameElement* imp = static_cast<HTMLFrameElement*>(castedThis->impl());
    JSValue result = jsString(exec, imp->location());
    return result;
}
Пример #9
0
JSValue jsHTMLFrameElementHeight(ExecState* exec, JSValue slotBase, const Identifier&)
{
    JSHTMLFrameElement* castedThis = static_cast<JSHTMLFrameElement*>(asObject(slotBase));
    UNUSED_PARAM(exec);
    HTMLFrameElement* imp = static_cast<HTMLFrameElement*>(castedThis->impl());
    JSValue result = jsNumber(imp->height());
    return result;
}
void V8HTMLFrameElement::locationAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
{
    HTMLFrameElement* frame = V8HTMLFrameElement::toNative(info.Holder());
    String locationValue = toWebCoreStringWithNullCheck(value);

    if (!V8BindingSecurity::allowSettingFrameSrcToJavascriptUrl(V8BindingState::Only(), frame, locationValue))
        return;

    frame->setLocation(locationValue);
}
Пример #11
0
void V8HTMLFrameElement::locationAttrSetterCustom(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<void>& info)
{
    HTMLFrameElement* frame = V8HTMLFrameElement::toNative(info.Holder());
    String locationValue = toWebCoreStringWithNullCheck(value);

    if (!BindingSecurity::allowSettingFrameSrcToJavascriptUrl(frame, locationValue))
        return;

    frame->setLocation(locationValue);
}
void JSHTMLFrameElement::setLocation(ExecState* exec, JSValue value)
{
    HTMLFrameElement* imp = impl();
    String locationValue = valueToStringWithNullCheck(exec, value);

    if (!allowSettingJavascriptURL(exec, imp, locationValue))
        return;

    imp->setLocation(locationValue);
}
Пример #13
0
void RenderFrame::viewCleared()
{
    HTMLFrameElement* element = static_cast<HTMLFrameElement*>(node());
    if (!element || !widget() || !widget()->isFrameView())
        return;

    FrameView* view = static_cast<FrameView*>(widget());

    int marginWidth = element->marginWidth();
    int marginHeight = element->marginHeight();

    if (marginWidth != -1)
        view->setMarginWidth(marginWidth);
    if (marginHeight != -1)
        view->setMarginHeight(marginHeight);
}
JSValue JSC_HOST_CALL jsHTMLFrameElementPrototypeFunctionGetSVGDocument(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
{
    UNUSED_PARAM(args);
    if (!thisValue.inherits(&JSHTMLFrameElement::s_info))
        return throwError(exec, TypeError);
    JSHTMLFrameElement* castedThisObj = static_cast<JSHTMLFrameElement*>(asObject(thisValue));
    HTMLFrameElement* imp = static_cast<HTMLFrameElement*>(castedThisObj->impl());
    ExceptionCode ec = 0;
    if (!checkNodeSecurity(exec, imp->getSVGDocument(ec)))
        return jsUndefined();


    JSC::JSValue result = toJS(exec, castedThisObj->globalObject(), WTF::getPtr(imp->getSVGDocument(ec)));
    setDOMException(exec, ec);
    return result;
}
Пример #15
0
EncodedJSValue JSC_HOST_CALL jsHTMLFrameElementPrototypeFunctionGetSVGDocument(ExecState* exec)
{
    JSValue thisValue = exec->hostThisValue();
    if (!thisValue.inherits(&JSHTMLFrameElement::s_info))
        return throwVMTypeError(exec);
    JSHTMLFrameElement* castedThis = static_cast<JSHTMLFrameElement*>(asObject(thisValue));
    ASSERT_GC_OBJECT_INHERITS(castedThis, &JSHTMLFrameElement::s_info);
    HTMLFrameElement* imp = static_cast<HTMLFrameElement*>(castedThis->impl());
    ExceptionCode ec = 0;
    if (!checkNodeSecurity(exec, imp->getSVGDocument(ec)))
        return JSValue::encode(jsUndefined());


    JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->getSVGDocument(ec)));
    setDOMException(exec, ec);
    return JSValue::encode(result);
}
Пример #16
0
PassRefPtr<Frame> WebFrameLoaderClient::createFrame(const KURL& url, const String& name, HTMLFrameOwnerElement* ownerElement, const String& referrer, bool /*allowsScrolling*/, int /*marginWidth*/, int /*marginHeight*/)
{
    RefPtr<Frame> result = createFrame(url, name, ownerElement, referrer);
    if (!result)
        return 0;

    // Propagate the marginwidth/height and scrolling modes to the view.
    if (ownerElement->hasTagName(frameTag) || ownerElement->hasTagName(iframeTag)) {
        HTMLFrameElement* frameElt = static_cast<HTMLFrameElement*>(ownerElement);
        if (frameElt->scrollingMode() == ScrollbarAlwaysOff)
            result->view()->setScrollbarsMode(ScrollbarAlwaysOff);
        int marginWidth = frameElt->getMarginWidth();
        int marginHeight = frameElt->getMarginHeight();
        if (marginWidth != -1)
            result->view()->setMarginWidth(marginWidth);
        if (marginHeight != -1)
            result->view()->setMarginHeight(marginHeight);
    }

    return result.release();
}
Пример #17
0
JSValue jsHTMLFrameElementContentDocument(ExecState* exec, const Identifier&, const PropertySlot& slot)
{
    HTMLFrameElement* imp = static_cast<HTMLFrameElement*>(static_cast<JSHTMLFrameElement*>(asObject(slot.slotBase()))->impl());
    return checkNodeSecurity(exec, imp->contentDocument()) ? toJS(exec, WTF::getPtr(imp->contentDocument())) : jsUndefined();
}
Пример #18
0
void setJSHTMLFrameElementSrc(ExecState* exec, JSObject* thisObject, JSValue value)
{
    JSHTMLFrameElement* castedThis = static_cast<JSHTMLFrameElement*>(thisObject);
    HTMLFrameElement* imp = static_cast<HTMLFrameElement*>(castedThis->impl());
    imp->setAttribute(WebCore::HTMLNames::srcAttr, valueToStringWithNullCheck(exec, value));
}
Пример #19
0
void setJSHTMLFrameElementNoResize(ExecState* exec, JSObject* thisObject, JSValue value)
{
    JSHTMLFrameElement* castedThis = static_cast<JSHTMLFrameElement*>(thisObject);
    HTMLFrameElement* imp = static_cast<HTMLFrameElement*>(castedThis->impl());
    imp->setBooleanAttribute(WebCore::HTMLNames::noresizeAttr, value.toBoolean(exec));
}
Пример #20
0
JSValue jsHTMLFrameElementWidth(ExecState* exec, const Identifier&, const PropertySlot& slot)
{
    UNUSED_PARAM(exec);
    HTMLFrameElement* imp = static_cast<HTMLFrameElement*>(static_cast<JSHTMLFrameElement*>(asObject(slot.slotBase()))->impl());
    return jsNumber(exec, imp->width());
}
Пример #21
0
void setJSHTMLFrameElementName(ExecState* exec, JSObject* thisObject, JSValue value)
{
    HTMLFrameElement* imp = static_cast<HTMLFrameElement*>(static_cast<JSHTMLFrameElement*>(thisObject)->impl());
    imp->setName(valueToStringWithNullCheck(exec, value));
}
Пример #22
0
void setJSHTMLFrameElementMarginWidth(ExecState* exec, JSObject* thisObject, JSValue value)
{
    JSHTMLFrameElement* castedThisObj = static_cast<JSHTMLFrameElement*>(thisObject);
    HTMLFrameElement* imp = static_cast<HTMLFrameElement*>(castedThisObj->impl());
    imp->setAttribute(HTMLNames::marginwidthAttr, valueToStringWithNullCheck(exec, value));
}
Пример #23
0
JSValue jsHTMLFrameElementContentDocument(ExecState* exec, JSValue slotBase, const Identifier&)
{
    JSHTMLFrameElement* castedThis = static_cast<JSHTMLFrameElement*>(asObject(slotBase));
    HTMLFrameElement* imp = static_cast<HTMLFrameElement*>(castedThis->impl());
    return checkNodeSecurity(exec, imp->contentDocument()) ? toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->contentDocument())) : jsUndefined();
}
Пример #24
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;
}
Пример #25
0
void JSHTMLFrameElement::putValueProperty(ExecState* exec, int token, JSValue* value)
{
    switch (token) {
    case FrameBorderAttrNum: {
        HTMLFrameElement* imp = static_cast<HTMLFrameElement*>(impl());
        imp->setFrameBorder(valueToStringWithNullCheck(exec, value));
        break;
    }
    case LongDescAttrNum: {
        HTMLFrameElement* imp = static_cast<HTMLFrameElement*>(impl());
        imp->setLongDesc(valueToStringWithNullCheck(exec, value));
        break;
    }
    case MarginHeightAttrNum: {
        HTMLFrameElement* imp = static_cast<HTMLFrameElement*>(impl());
        imp->setMarginHeight(valueToStringWithNullCheck(exec, value));
        break;
    }
    case MarginWidthAttrNum: {
        HTMLFrameElement* imp = static_cast<HTMLFrameElement*>(impl());
        imp->setMarginWidth(valueToStringWithNullCheck(exec, value));
        break;
    }
    case NameAttrNum: {
        HTMLFrameElement* imp = static_cast<HTMLFrameElement*>(impl());
        imp->setName(valueToStringWithNullCheck(exec, value));
        break;
    }
    case NoResizeAttrNum: {
        HTMLFrameElement* imp = static_cast<HTMLFrameElement*>(impl());
        imp->setNoResize(value->toBoolean(exec));
        break;
    }
    case ScrollingAttrNum: {
        HTMLFrameElement* imp = static_cast<HTMLFrameElement*>(impl());
        imp->setScrolling(valueToStringWithNullCheck(exec, value));
        break;
    }
    case SrcAttrNum: {
        setSrc(exec, value);
        break;
    }
    case LocationAttrNum: {
        setLocation(exec, value);
        break;
    }
    }
}
Пример #26
0
FrameEdgeInfo RenderFrame::edgeInfo() const
{
    HTMLFrameElement* element = static_cast<HTMLFrameElement*>(node());
    return FrameEdgeInfo(element->noResize(), element->hasFrameBorder());
}
void setJSHTMLFrameElementScrolling(ExecState* exec, JSObject* thisObject, JSValue value)
{
    HTMLFrameElement* imp = static_cast<HTMLFrameElement*>(static_cast<JSHTMLFrameElement*>(thisObject)->impl());
    imp->setAttribute(HTMLNames::scrollingAttr, valueToStringWithNullCheck(exec, value));
}
void setJSHTMLFrameElementNoResize(ExecState* exec, JSObject* thisObject, JSValue value)
{
    HTMLFrameElement* imp = static_cast<HTMLFrameElement*>(static_cast<JSHTMLFrameElement*>(thisObject)->impl());
    imp->setNoResize(value.toBoolean(exec));
}
Пример #29
0
JSValue jsHTMLFrameElementLocation(ExecState* exec, const Identifier&, const PropertySlot& slot)
{
    UNUSED_PARAM(exec);
    HTMLFrameElement* imp = static_cast<HTMLFrameElement*>(static_cast<JSHTMLFrameElement*>(asObject(slot.slotBase()))->impl());
    return jsString(exec, imp->location());
}