本文整理汇总了C++中ownerDocument函数的典型用法代码示例。如果您正苦于以下问题:C++ ownerDocument函数的具体用法?C++ ownerDocument怎么用?C++ ownerDocument使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ownerDocument函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: reportMediaQueryWarningIfNeeded
void CSSStyleSheet::setMediaQueries(PassRefPtr<MediaQuerySet> mediaQueries)
{
m_mediaQueries = mediaQueries;
// Add warning message to inspector whenever dpi/dpcm values are used for "screen" media.
reportMediaQueryWarningIfNeeded(ownerDocument(), m_mediaQueries.get());
}
示例2: poco_check_ptr
Attr* Element::setAttributeNodeNS(Attr* newAttr)
{
poco_check_ptr (newAttr);
if (newAttr->ownerDocument() != ownerDocument())
throw DOMException(DOMException::WRONG_DOCUMENT_ERR);
if (newAttr->ownerElement())
throw DOMException(DOMException::INUSE_ATTRIBUTE_ERR);
Attr* oldAttr = getAttributeNodeNS(newAttr->namespaceURI(), newAttr->localName());
if (oldAttr) removeAttributeNode(oldAttr);
Attr* pCur = _pFirstAttr;
if (pCur)
{
while (pCur->_pNext) pCur = static_cast<Attr*>(pCur->_pNext);
pCur->_pNext = newAttr;
}
else _pFirstAttr = newAttr;
newAttr->_pParent = this;
newAttr->duplicate();
if (_pOwner->events())
dispatchAttrModified(newAttr, MutationEvent::ADDITION, EMPTY_STRING, newAttr->getValue());
return oldAttr;
}
示例3: ownerDocument
CachedResourceLoader* XSLStyleSheet::cachedResourceLoader()
{
Document* document = ownerDocument();
if (!document)
return 0;
return document->cachedResourceLoader();
}
示例4: ownerDocument
void CSSStyleSheet::didMutate()
{
Document* owner = ownerDocument();
if (!owner)
return;
owner->styleResolverChanged(DeferRecalcStyle);
}
示例5: WTFMove
void CSSStyleSheet::setMediaQueries(Ref<MediaQuerySet>&& mediaQueries)
{
m_mediaQueries = WTFMove(mediaQueries);
if (m_mediaCSSOMWrapper && m_mediaQueries)
m_mediaCSSOMWrapper->reattach(m_mediaQueries.get());
reportMediaQueryWarningIfNeeded(ownerDocument(), m_mediaQueries.get());
}
示例6: notifyAttributeChange
void SVGPolyElement::notifyAttributeChange() const
{
if (m_ignoreAttributeChanges || ownerDocument()->parsing())
return;
m_ignoreAttributeChanges = true;
rebuildRenderer();
ExceptionCode ec = 0;
// Spec: Additionally, the 'points' attribute on the original element
// accessed via the XML DOM (e.g., using the getAttribute() method call)
// will reflect any changes made to points.
String _points;
int len = points()->numberOfItems();
for (int i = 0; i < len; ++i) {
FloatPoint p = points()->getItem(i, ec);
_points += String::format("%.6lg %.6lg ", p.x(), p.y());
}
RefPtr<Attr> attr = const_cast<SVGPolyElement*>(this)->getAttributeNode(SVGNames::pointsAttr.localName());
if (attr) {
ExceptionCode ec = 0;
attr->setValue(_points, ec);
}
m_ignoreAttributeChanges = false;
SVGStyledElement::notifyAttributeChange();
}
示例7: insertRule
ExceptionOr<unsigned> CSSStyleSheet::deprecatedInsertRule(const String& ruleString)
{
if (auto* document = ownerDocument())
document->addConsoleMessage(MessageSource::JS, MessageLevel::Warning, ASCIILiteral("Calling CSSStyleSheet.insertRule() with one argument is deprecated. Please pass the index argument as well: insertRule(x, 0)."));
return insertRule(ruleString, 0);
}
示例8: notifyAttributeChange
void SVGPathElement::notifyAttributeChange() const
{
if (!ownerDocument()->parsing())
rebuildRenderer();
SVGStyledElement::notifyAttributeChange();
}
示例9: screenEval
void SVGStyleElement::childrenChanged()
{
SVGElement::childrenChanged();
if(m_sheet)
m_sheet = 0;
m_loading = false;
MediaQueryEvaluator screenEval("screen", true);
MediaQueryEvaluator printEval("print", true);
RefPtr<MediaList> mediaList = new MediaList((CSSStyleSheet*)0, media());
if ((type().isEmpty() || type() == "text/css") && (screenEval.eval(mediaList.get()) || printEval.eval(mediaList.get()))) {
ownerDocument()->addPendingSheet();
m_loading = true;
m_sheet = new CSSStyleSheet(this);
m_sheet->parseString(textContent()); // SVG css is always parsed in strict mode
m_sheet->setMedia(mediaList.get());
m_loading = false;
}
if(!isLoading() && m_sheet)
document()->stylesheetLoaded();
}
示例10: createWebVTTNodeTree
PassRefPtr<DocumentFragment> TextTrackCue::getCueAsHTML()
{
createWebVTTNodeTree();
RefPtr<DocumentFragment> clonedFragment = DocumentFragment::create(ownerDocument());
copyWebVTTNodeToDOMTree(m_webVTTNodeTree.get(), clonedFragment.get());
return clonedFragment.release();
}
示例11: ownerDocument
ResourceFetcher* XSLStyleSheet::fetcher()
{
Document* document = ownerDocument();
if (!document)
return 0;
return document->fetcher();
}
示例12: document
void SVGFEImageElement::requestImageResource()
{
if (m_cachedImage) {
m_cachedImage->removeClient(this);
m_cachedImage = 0;
}
Element* hrefElement = SVGURIReference::targetElementFromIRIString(href(), document());
if (hrefElement && hrefElement->isSVGElement() && hrefElement->renderer())
return;
ResourceRequest request(ownerDocument()->completeURL(href()));
m_cachedImage = ownerDocument()->cachedResourceLoader()->requestImage(request);
if (m_cachedImage)
m_cachedImage->addClient(this);
}
示例13: request
void SVGFEImageElement::requestImageResource()
{
ResourceRequest request(ownerDocument()->completeURL(href()));
m_cachedImage = document()->cachedResourceLoader()->requestImage(request);
if (m_cachedImage)
m_cachedImage->addClient(this);
}
示例14: while
LinearGradientAttributes SVGLinearGradientElement::collectGradientProperties() const
{
LinearGradientAttributes attributes;
HashSet<const SVGGradientElement*> processedGradients;
bool isLinear = true;
const SVGGradientElement* current = this;
while (current) {
if (!attributes.hasSpreadMethod() && current->hasAttribute(SVGNames::spreadMethodAttr))
attributes.setSpreadMethod((GradientSpreadMethod) current->spreadMethod());
if (!attributes.hasBoundingBoxMode() && current->hasAttribute(SVGNames::gradientUnitsAttr))
attributes.setBoundingBoxMode(current->gradientUnits() == SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX);
if (!attributes.hasGradientTransform() && current->hasAttribute(SVGNames::gradientTransformAttr))
attributes.setGradientTransform(current->gradientTransform()->consolidate().matrix());
if (!attributes.hasStops()) {
const Vector<SVGGradientStop>& stops(current->buildStops());
if (!stops.isEmpty())
attributes.setStops(stops);
}
if (isLinear) {
const SVGLinearGradientElement* linear = static_cast<const SVGLinearGradientElement*>(current);
if (!attributes.hasX1() && current->hasAttribute(SVGNames::x1Attr))
attributes.setX1(linear->x1());
if (!attributes.hasY1() && current->hasAttribute(SVGNames::y1Attr))
attributes.setY1(linear->y1());
if (!attributes.hasX2() && current->hasAttribute(SVGNames::x2Attr))
attributes.setX2(linear->x2());
if (!attributes.hasY2() && current->hasAttribute(SVGNames::y2Attr))
attributes.setY2(linear->y2());
}
processedGradients.add(current);
// Respect xlink:href, take attributes from referenced element
Node* refNode = ownerDocument()->getElementById(SVGURIReference::getTarget(current->href()));
if (refNode && (refNode->hasTagName(SVGNames::linearGradientTag) || refNode->hasTagName(SVGNames::radialGradientTag))) {
current = static_cast<const SVGGradientElement*>(const_cast<const Node*>(refNode));
// Cycle detection
if (processedGradients.contains(current))
return LinearGradientAttributes();
isLinear = current->gradientType() == LinearGradientPaintServer;
} else
current = 0;
}
return attributes;
}
示例15: ownerDocument
void SVGTRefElement::updateReferencedText()
{
Element* targetElement = ownerDocument()->getElementById(SVGURIReference::getTarget(href()));
SVGElement* target = svg_dynamic_cast(targetElement);
if (target) {
ExceptionCode ignore = 0;
setTextContent(target->textContent(), ignore);
}
}