当前位置: 首页>>代码示例>>C++>>正文


C++ SVGSVGElement::document方法代码示例

本文整理汇总了C++中SVGSVGElement::document方法的典型用法代码示例。如果您正苦于以下问题:C++ SVGSVGElement::document方法的具体用法?C++ SVGSVGElement::document怎么用?C++ SVGSVGElement::document使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SVGSVGElement的用法示例。


在下文中一共展示了SVGSVGElement::document方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: dispatchSVGLoadEventToOutermostSVGElements

void SVGDocumentExtensions::dispatchSVGLoadEventToOutermostSVGElements()
{
    WillBeHeapVector<RefPtrWillBeMember<SVGSVGElement>> timeContainers;
    copyToVector(m_timeContainers, timeContainers);
    for (const auto& container : timeContainers) {
        SVGSVGElement* outerSVG = container.get();
        if (!outerSVG->isOutermostSVGSVGElement())
            continue;

        // don't dispatch the load event document is not wellformed (for XML/standalone svg)
        if (outerSVG->document().wellFormed() || !outerSVG->document().isSVGDocument())
            outerSVG->sendSVGLoadEventIfPossible();
    }
}
开发者ID:astojilj,项目名称:chromium-crosswalk,代码行数:14,代码来源:SVGDocumentExtensions.cpp

示例2: dispatchSVGLoadEventToOutermostSVGElements

void SVGDocumentExtensions::dispatchSVGLoadEventToOutermostSVGElements()
{
    Vector<RefPtr<SVGSVGElement> > timeContainers;
    timeContainers.appendRange(m_timeContainers.begin(), m_timeContainers.end());

    Vector<RefPtr<SVGSVGElement> >::iterator end = timeContainers.end();
    for (Vector<RefPtr<SVGSVGElement> >::iterator it = timeContainers.begin(); it != end; ++it) {
        SVGSVGElement* outerSVG = (*it).get();
        if (!outerSVG->isOutermostSVGSVGElement())
            continue;

        // don't dispatch the load event document is not wellformed (for XML/standalone svg)
        if (outerSVG->document().wellFormed() || !outerSVG->document().isSVGDocument())
            outerSVG->sendSVGLoadEventIfPossible();
    }
}
开发者ID:coinpayee,项目名称:blink,代码行数:16,代码来源:SVGDocumentExtensions.cpp

示例3: setupInitialView

void SVGSVGElement::setupInitialView(const String& fragmentIdentifier,
                                     Element* anchorNode) {
  if (fragmentIdentifier.startsWith("svgView(")) {
    SVGViewSpec* viewSpec = SVGViewSpec::createForElement(*this);
    if (viewSpec->parseViewSpec(fragmentIdentifier)) {
      UseCounter::count(document(), UseCounter::SVGSVGElementFragmentSVGView);
      setViewSpec(viewSpec);
      return;
    }
  }

  setViewSpec(nullptr);

  if (!isSVGViewElement(anchorNode))
    return;

  SVGViewElement& viewElement = toSVGViewElement(*anchorNode);

  // Spec: If the SVG fragment identifier addresses a 'view' element
  // within an SVG document (e.g., MyDrawing.svg#MyView) then the
  // closest ancestor 'svg' element is displayed in the
  // viewport. Any view specification attributes included on the
  // given 'view' element override the corresponding view
  // specification attributes on the closest ancestor 'svg' element.
  // TODO(ed): The spec text above is a bit unclear.
  // Should the transform from outermost svg to nested svg be applied to
  // "display" the inner svg in the viewport, then let the view element
  // override the inner svg's view specification attributes. Should it
  // fill/override the outer viewport?
  SVGSVGElement* svg = viewElement.ownerSVGElement();
  if (!svg)
    return;
  SVGViewSpec* viewSpec = SVGViewSpec::createForElement(*svg);
  viewSpec->inheritViewAttributesFromElement(viewElement);
  UseCounter::count(svg->document(),
                    UseCounter::SVGSVGElementFragmentSVGViewElement);
  svg->setViewSpec(viewSpec);
}
开发者ID:,项目名称:,代码行数:38,代码来源:


注:本文中的SVGSVGElement::document方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。