本文整理汇总了C++中SVGForeignObjectElement类的典型用法代码示例。如果您正苦于以下问题:C++ SVGForeignObjectElement类的具体用法?C++ SVGForeignObjectElement怎么用?C++ SVGForeignObjectElement使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SVGForeignObjectElement类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: jsSVGForeignObjectElementTransform
JSValue jsSVGForeignObjectElementTransform(ExecState* exec, const Identifier&, const PropertySlot& slot)
{
UNUSED_PARAM(exec);
SVGForeignObjectElement* imp = static_cast<SVGForeignObjectElement*>(static_cast<JSSVGForeignObjectElement*>(asObject(slot.slotBase()))->impl());
RefPtr<SVGAnimatedTransformList> obj = imp->transformAnimated();
return toJS(exec, obj.get(), imp);
}
示例2: gfxMatrix
gfxMatrix
nsSVGForeignObjectFrame::GetCanvasTM(uint32_t aFor, nsIFrame* aTransformRoot)
{
if (!(GetStateBits() & NS_FRAME_IS_NONDISPLAY) && !aTransformRoot) {
if (aFor == FOR_PAINTING && NS_SVGDisplayListPaintingEnabled()) {
return nsSVGIntegrationUtils::GetCSSPxToDevPxMatrix(this);
}
if (aFor == FOR_HIT_TESTING && NS_SVGDisplayListHitTestingEnabled()) {
return gfxMatrix();
}
}
if (!mCanvasTM) {
NS_ASSERTION(GetParent(), "null parent");
nsSVGContainerFrame *parent = static_cast<nsSVGContainerFrame*>(GetParent());
SVGForeignObjectElement *content =
static_cast<SVGForeignObjectElement*>(mContent);
gfxMatrix tm = content->PrependLocalTransformsTo(
this == aTransformRoot ? gfxMatrix() :
parent->GetCanvasTM(aFor, aTransformRoot));
mCanvasTM = new gfxMatrix(tm);
}
return *mCanvasTM;
}
示例3: jsSVGForeignObjectElementExternalResourcesRequired
JSValue jsSVGForeignObjectElementExternalResourcesRequired(ExecState* exec, const Identifier&, const PropertySlot& slot)
{
UNUSED_PARAM(exec);
SVGForeignObjectElement* imp = static_cast<SVGForeignObjectElement*>(static_cast<JSSVGForeignObjectElement*>(asObject(slot.slotBase()))->impl());
RefPtr<SVGAnimatedBoolean> obj = imp->externalResourcesRequiredAnimated();
return toJS(exec, obj.get(), imp);
}
示例4: jsSVGForeignObjectElementXmlspace
JSValue jsSVGForeignObjectElementXmlspace(ExecState* exec, JSValue slotBase, const Identifier&)
{
JSSVGForeignObjectElement* castedThis = static_cast<JSSVGForeignObjectElement*>(asObject(slotBase));
UNUSED_PARAM(exec);
SVGForeignObjectElement* imp = static_cast<SVGForeignObjectElement*>(castedThis->impl());
JSValue result = jsString(exec, imp->xmlspace());
return result;
}
示例5: jsSVGForeignObjectElementFarthestViewportElement
JSValue jsSVGForeignObjectElementFarthestViewportElement(ExecState* exec, JSValue slotBase, const Identifier&)
{
JSSVGForeignObjectElement* castedThis = static_cast<JSSVGForeignObjectElement*>(asObject(slotBase));
UNUSED_PARAM(exec);
SVGForeignObjectElement* imp = static_cast<SVGForeignObjectElement*>(castedThis->impl());
JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->farthestViewportElement()));
return result;
}
示例6: jsSVGForeignObjectElementRequiredExtensions
JSValue jsSVGForeignObjectElementRequiredExtensions(ExecState* exec, JSValue slotBase, const Identifier&)
{
JSSVGForeignObjectElement* castedThis = static_cast<JSSVGForeignObjectElement*>(asObject(slotBase));
UNUSED_PARAM(exec);
SVGForeignObjectElement* imp = static_cast<SVGForeignObjectElement*>(castedThis->impl());
JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->requiredExtensions()), imp);
return result;
}
示例7: jsSVGForeignObjectElementExternalResourcesRequired
JSValue jsSVGForeignObjectElementExternalResourcesRequired(ExecState* exec, JSValue slotBase, const Identifier&)
{
JSSVGForeignObjectElement* castedThis = static_cast<JSSVGForeignObjectElement*>(asObject(slotBase));
UNUSED_PARAM(exec);
SVGForeignObjectElement* imp = static_cast<SVGForeignObjectElement*>(castedThis->impl());
RefPtr<SVGAnimatedBoolean> obj = imp->externalResourcesRequiredAnimated();
JSValue result = toJS(exec, castedThis->globalObject(), obj.get(), imp);
return result;
}
示例8: jsSVGForeignObjectElementTransform
JSValue jsSVGForeignObjectElementTransform(ExecState* exec, JSValue slotBase, const Identifier&)
{
JSSVGForeignObjectElement* castedThis = static_cast<JSSVGForeignObjectElement*>(asObject(slotBase));
UNUSED_PARAM(exec);
SVGForeignObjectElement* imp = static_cast<SVGForeignObjectElement*>(castedThis->impl());
RefPtr<SVGAnimatedTransformList> obj = imp->transformAnimated();
JSValue result = toJS(exec, castedThis->globalObject(), obj.get(), imp);
return result;
}
示例9: jsSVGForeignObjectElementPrototypeFunctionGetBBox
JSValue JSC_HOST_CALL jsSVGForeignObjectElementPrototypeFunctionGetBBox(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
{
UNUSED_PARAM(args);
if (!thisValue.isObject(&JSSVGForeignObjectElement::s_info))
return throwError(exec, TypeError);
JSSVGForeignObjectElement* castedThisObj = static_cast<JSSVGForeignObjectElement*>(asObject(thisValue));
SVGForeignObjectElement* imp = static_cast<SVGForeignObjectElement*>(castedThisObj->impl());
JSC::JSValue result = toJS(exec, JSSVGStaticPODTypeWrapper<FloatRect>::create(imp->getBBox()).get(), imp);
return result;
}
示例10: ASSERT
void LayoutSVGForeignObject::layout() {
ASSERT(needsLayout());
SVGForeignObjectElement* foreign = toSVGForeignObjectElement(node());
bool updateCachedBoundariesInParents = false;
if (m_needsTransformUpdate) {
m_localTransform = foreign->calculateAnimatedLocalTransform();
m_needsTransformUpdate = false;
updateCachedBoundariesInParents = true;
}
FloatRect oldViewport = m_viewport;
// Cache viewport boundaries
SVGLengthContext lengthContext(foreign);
FloatPoint viewportLocation(
lengthContext.valueForLength(styleRef().svgStyle().x(), styleRef(),
SVGLengthMode::Width),
lengthContext.valueForLength(styleRef().svgStyle().y(), styleRef(),
SVGLengthMode::Height));
m_viewport = FloatRect(
viewportLocation,
FloatSize(lengthContext.valueForLength(styleRef().width(), styleRef(),
SVGLengthMode::Width),
lengthContext.valueForLength(styleRef().height(), styleRef(),
SVGLengthMode::Height)));
if (!updateCachedBoundariesInParents)
updateCachedBoundariesInParents = oldViewport != m_viewport;
// Set box origin to the foreignObject x/y translation, so positioned objects
// in XHTML content get correct positions. A regular LayoutBoxModelObject
// would pull this information from ComputedStyle - in SVG those properties
// are ignored for non <svg> elements, so we mimic what happens when
// specifying them through CSS.
// FIXME: Investigate in location rounding issues - only affects
// LayoutSVGForeignObject & LayoutSVGText
setLocation(roundedIntPoint(viewportLocation));
bool layoutChanged = everHadLayout() && selfNeedsLayout();
LayoutBlock::layout();
ASSERT(!needsLayout());
// If our bounds changed, notify the parents.
if (updateCachedBoundariesInParents)
LayoutSVGBlock::setNeedsBoundariesUpdate();
// Invalidate all resources of this client if our layout changed.
if (layoutChanged)
SVGResourcesCache::clientLayoutChanged(this);
}
示例11: jsSVGForeignObjectElementPrototypeFunctionHasExtension
JSValue JSC_HOST_CALL jsSVGForeignObjectElementPrototypeFunctionHasExtension(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
{
UNUSED_PARAM(args);
if (!thisValue.inherits(&JSSVGForeignObjectElement::s_info))
return throwError(exec, TypeError);
JSSVGForeignObjectElement* castedThisObj = static_cast<JSSVGForeignObjectElement*>(asObject(thisValue));
SVGForeignObjectElement* imp = static_cast<SVGForeignObjectElement*>(castedThisObj->impl());
const UString& extension = args.at(0).toString(exec);
JSC::JSValue result = jsBoolean(imp->hasExtension(extension));
return result;
}
示例12: jsSVGForeignObjectElementPrototypeFunctionGetPresentationAttribute
JSValue JSC_HOST_CALL jsSVGForeignObjectElementPrototypeFunctionGetPresentationAttribute(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
{
UNUSED_PARAM(args);
if (!thisValue.inherits(&JSSVGForeignObjectElement::s_info))
return throwError(exec, TypeError);
JSSVGForeignObjectElement* castedThisObj = static_cast<JSSVGForeignObjectElement*>(asObject(thisValue));
SVGForeignObjectElement* imp = static_cast<SVGForeignObjectElement*>(castedThisObj->impl());
const UString& name = args.at(0).toString(exec);
JSC::JSValue result = toJS(exec, castedThisObj->globalObject(), WTF::getPtr(imp->getPresentationAttribute(name)));
return result;
}
示例13: NS_ASSERTION
gfxMatrix
nsSVGForeignObjectFrame::GetCanvasTM()
{
if (!mCanvasTM) {
NS_ASSERTION(GetParent(), "null parent");
nsSVGContainerFrame *parent = static_cast<nsSVGContainerFrame*>(GetParent());
SVGForeignObjectElement *content =
static_cast<SVGForeignObjectElement*>(mContent);
gfxMatrix tm = content->PrependLocalTransformsTo(parent->GetCanvasTM());
mCanvasTM = new gfxMatrix(tm);
}
return *mCanvasTM;
}
示例14: ASSERT
void RenderSVGForeignObject::layout()
{
StackStats::LayoutCheckPoint layoutCheckPoint;
ASSERT(needsLayout());
ASSERT(!view()->layoutStateEnabled()); // RenderSVGRoot disables layoutState for the SVG rendering tree.
LayoutRepainter repainter(*this, checkForRepaintDuringLayout());
SVGForeignObjectElement* foreign = static_cast<SVGForeignObjectElement*>(node());
bool updateCachedBoundariesInParents = false;
if (m_needsTransformUpdate) {
m_localTransform = foreign->animatedLocalTransform();
m_needsTransformUpdate = false;
updateCachedBoundariesInParents = true;
}
FloatRect oldViewport = m_viewport;
// Cache viewport boundaries
SVGLengthContext lengthContext(foreign);
FloatPoint viewportLocation(foreign->x().value(lengthContext), foreign->y().value(lengthContext));
m_viewport = FloatRect(viewportLocation, FloatSize(foreign->width().value(lengthContext), foreign->height().value(lengthContext)));
if (!updateCachedBoundariesInParents)
updateCachedBoundariesInParents = oldViewport != m_viewport;
// Set box origin to the foreignObject x/y translation, so positioned objects in XHTML content get correct
// positions. A regular RenderBoxModelObject would pull this information from RenderStyle - in SVG those
// properties are ignored for non <svg> elements, so we mimic what happens when specifying them through CSS.
// FIXME: Investigate in location rounding issues - only affects RenderSVGForeignObject & RenderSVGText
setLocation(roundedIntPoint(viewportLocation));
bool layoutChanged = everHadLayout() && selfNeedsLayout();
RenderBlock::layout();
ASSERT(!needsLayout());
// If our bounds changed, notify the parents.
if (updateCachedBoundariesInParents)
RenderSVGBlock::setNeedsBoundariesUpdate();
// Invalidate all resources of this client if our layout changed.
if (layoutChanged)
SVGResourcesCache::clientLayoutChanged(this);
repainter.repaintAfterLayout();
}
示例15: SVGBBox
SVGBBox
nsSVGForeignObjectFrame::GetBBoxContribution(const Matrix &aToBBoxUserspace,
uint32_t aFlags)
{
SVGForeignObjectElement *content =
static_cast<SVGForeignObjectElement*>(mContent);
float x, y, w, h;
content->GetAnimatedLengthValues(&x, &y, &w, &h, nullptr);
if (w < 0.0f) w = 0.0f;
if (h < 0.0f) h = 0.0f;
if (aToBBoxUserspace.IsSingular()) {
// XXX ReportToConsole
return SVGBBox();
}
return aToBBoxUserspace.TransformBounds(gfx::Rect(0.0, 0.0, w, h));
}