本文整理汇总了C++中HTMLAppletElement类的典型用法代码示例。如果您正苦于以下问题:C++ HTMLAppletElement类的具体用法?C++ HTMLAppletElement怎么用?C++ HTMLAppletElement使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了HTMLAppletElement类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createWidgetIfNecessary
void RenderApplet::createWidgetIfNecessary()
{
HTMLAppletElement* element = static_cast<HTMLAppletElement*>(node());
if (widget() || !element->isFinishedParsingChildren())
return;
// FIXME: Java applets can't be resized (this is a bug in Apple's Java implementation).
// In order to work around this problem and have a correct size from the start, we will
// use fixed widths/heights from the style system when we can, since the widget might
// not have an accurate m_width/m_height.
int contentWidth = style()->width().isFixed() ? style()->width().value() :
width() - borderAndPaddingWidth();
int contentHeight = style()->height().isFixed() ? style()->height().value() :
height() - borderAndPaddingHeight();
for (Node* child = element->firstChild(); child; child = child->nextSibling()) {
if (child->hasTagName(paramTag)) {
HTMLParamElement* p = static_cast<HTMLParamElement*>(child);
if (!p->name().isEmpty())
m_args.set(p->name(), p->value());
}
}
Frame* frame = document()->frame();
ASSERT(frame);
setWidget(frame->loader()->createJavaAppletWidget(IntSize(contentWidth, contentHeight), element, m_args));
}
示例2: jsHTMLAppletElementWidth
JSValue jsHTMLAppletElementWidth(ExecState* exec, JSValue slotBase, const Identifier&)
{
JSHTMLAppletElement* castedThis = static_cast<JSHTMLAppletElement*>(asObject(slotBase));
UNUSED_PARAM(exec);
HTMLAppletElement* imp = static_cast<HTMLAppletElement*>(castedThis->impl());
JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::widthAttr));
return result;
}
示例3: if
PassRefPtr<Widget> SubframeLoader::createJavaAppletWidget(const IntSize& size, HTMLAppletElement& element, const Vector<String>& paramNames, const Vector<String>& paramValues)
{
String baseURLString;
String codeBaseURLString;
for (size_t i = 0; i < paramNames.size(); ++i) {
if (equalIgnoringCase(paramNames[i], "baseurl"))
baseURLString = paramValues[i];
else if (equalIgnoringCase(paramNames[i], "codebase"))
codeBaseURLString = paramValues[i];
}
if (!codeBaseURLString.isEmpty()) {
URL codeBaseURL = completeURL(codeBaseURLString);
if (!element.document().securityOrigin()->canDisplay(codeBaseURL)) {
FrameLoader::reportLocalLoadFailed(&m_frame, codeBaseURL.string());
return nullptr;
}
const char javaAppletMimeType[] = "application/x-java-applet";
if (!element.document().contentSecurityPolicy()->allowObjectFromSource(codeBaseURL)
|| !element.document().contentSecurityPolicy()->allowPluginType(javaAppletMimeType, javaAppletMimeType, codeBaseURL))
return nullptr;
}
if (baseURLString.isEmpty())
baseURLString = m_frame.document()->baseURL().string();
URL baseURL = completeURL(baseURLString);
RefPtr<Widget> widget;
if (allowPlugins(AboutToInstantiatePlugin))
widget = m_frame.loader().client().createJavaAppletWidget(size, &element, baseURL, paramNames, paramValues);
logPluginRequest(document()->page(), element.serviceType(), String(), widget);
if (!widget) {
RenderEmbeddedObject* renderer = element.renderEmbeddedObject();
if (!renderer->isPluginUnavailable())
renderer->setPluginUnavailabilityReason(RenderEmbeddedObject::PluginMissing);
return nullptr;
}
m_containsPlugins = true;
return widget;
}
示例4: setJSHTMLAppletElementWidth
void setJSHTMLAppletElementWidth(ExecState* exec, JSObject* thisObject, JSValue value)
{
JSHTMLAppletElement* castedThis = static_cast<JSHTMLAppletElement*>(thisObject);
HTMLAppletElement* imp = static_cast<HTMLAppletElement*>(castedThis->impl());
imp->setAttribute(WebCore::HTMLNames::widthAttr, valueToStringWithNullCheck(exec, value));
}
示例5: setJSHTMLAppletElementVspace
void setJSHTMLAppletElementVspace(ExecState* exec, JSObject* thisObject, JSValue value)
{
JSHTMLAppletElement* castedThisObj = static_cast<JSHTMLAppletElement*>(thisObject);
HTMLAppletElement* imp = static_cast<HTMLAppletElement*>(castedThisObj->impl());
imp->setAttribute(HTMLNames::vspaceAttr, valueToStringWithNullCheck(exec, value));
}