本文整理汇总了C++中JSNode::hasCustomProperties方法的典型用法代码示例。如果您正苦于以下问题:C++ JSNode::hasCustomProperties方法的具体用法?C++ JSNode::hasCustomProperties怎么用?C++ JSNode::hasCustomProperties使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JSNode
的用法示例。
在下文中一共展示了JSNode::hasCustomProperties方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: markDOMNodesForDocument
void markDOMNodesForDocument(Document* doc)
{
// If a node's JS wrapper holds custom properties, those properties must
// persist every time the node is fetched from the DOM. So, we keep JS
// wrappers like that from being garbage collected.
JSWrapperCache& nodeDict = doc->wrapperCache();
JSWrapperCache::iterator nodeEnd = nodeDict.end();
for (JSWrapperCache::iterator nodeIt = nodeDict.begin(); nodeIt != nodeEnd; ++nodeIt) {
JSNode* jsNode = nodeIt->second;
Node* node = jsNode->impl();
if (jsNode->marked())
continue;
// No need to preserve a wrapper that has no custom properties or is no
// longer fetchable through the DOM.
if (!jsNode->hasCustomProperties() || !node->inDocument()) {
//... unless the wrapper wraps a loading image, since the "new Image"
// syntax allows an orphan image wrapper to be the last reference
// to a loading image, whose load event might have important side-effects.
if (!node->hasTagName(imgTag) || static_cast<HTMLImageElement*>(node)->haveFiredLoadEvent())
continue;
}
jsNode->mark();
}
}