本文整理汇总了C++中MutationEvent::relatedNode方法的典型用法代码示例。如果您正苦于以下问题:C++ MutationEvent::relatedNode方法的具体用法?C++ MutationEvent::relatedNode怎么用?C++ MutationEvent::relatedNode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MutationEvent
的用法示例。
在下文中一共展示了MutationEvent::relatedNode方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getValueProperty
JSValue* JSMutationEvent::getValueProperty(ExecState* exec, int token) const
{
switch (token) {
case RelatedNodeAttrNum: {
MutationEvent* imp = static_cast<MutationEvent*>(impl());
return toJS(exec, WTF::getPtr(imp->relatedNode()));
}
case PrevValueAttrNum: {
MutationEvent* imp = static_cast<MutationEvent*>(impl());
return jsString(exec, imp->prevValue());
}
case NewValueAttrNum: {
MutationEvent* imp = static_cast<MutationEvent*>(impl());
return jsString(exec, imp->newValue());
}
case AttrNameAttrNum: {
MutationEvent* imp = static_cast<MutationEvent*>(impl());
return jsString(exec, imp->attrName());
}
case AttrChangeAttrNum: {
MutationEvent* imp = static_cast<MutationEvent*>(impl());
return jsNumber(exec, imp->attrChange());
}
case ConstructorAttrNum:
return getConstructor(exec);
}
return 0;
}
示例2: jsMutationEventRelatedNode
JSValue jsMutationEventRelatedNode(ExecState* exec, JSValue slotBase, const Identifier&)
{
JSMutationEvent* castedThis = static_cast<JSMutationEvent*>(asObject(slotBase));
UNUSED_PARAM(exec);
MutationEvent* imp = static_cast<MutationEvent*>(castedThis->impl());
JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->relatedNode()));
return result;
}
示例3: relatedNodeAttrGetter
static v8::Handle<v8::Value> relatedNodeAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
MutationEvent* imp = V8MutationEvent::toNative(info.Holder());
return toV8Fast(imp->relatedNode(), info, imp);
}
示例4: handleEvent
void handleEvent(Event* evt)
{
XMLString type = evt->type();
XMLString phase;
switch (evt->eventPhase())
{
case Event::CAPTURING_PHASE:
phase = "CAPTURING_PHASE";
break;
case Event::AT_TARGET:
phase = "AT_TARGET";
break;
case Event::BUBBLING_PHASE:
phase = "BUBBLING_PHASE";
break;
}
Node* pTarget = static_cast<Node*>(evt->target());
Node* pCurrentTarget = static_cast<Node*>(evt->currentTarget());
_log.append(_name);
_log.append(":");
_log.append(type);
_log.append(":");
_log.append(phase);
_log.append(":");
_log.append(pTarget->nodeName());
_log.append(":");
_log.append(pCurrentTarget->nodeName());
_log.append(":");
_log.append(evt->bubbles() ? "B" : "-");
_log.append(":");
_log.append(evt->cancelable() ? "C" : "-");
MutationEvent* pME = dynamic_cast<MutationEvent*>(evt);
if (pME)
{
XMLString attrChange;
switch (pME->attrChange())
{
case MutationEvent::MODIFICATION:
attrChange = "MODIFICATION";
break;
case MutationEvent::ADDITION:
attrChange = "ADDITION";
break;
case MutationEvent::REMOVAL:
attrChange = "REMOVAL";
break;
}
XMLString relatedNode;
Node* pRelatedNode = pME->relatedNode();
if (pRelatedNode) relatedNode = pRelatedNode->nodeName();
_log.append(":");
_log.append(attrChange);
_log.append(":");
_log.append(relatedNode);
_log.append(":");
_log.append(pME->attrName());
_log.append(":");
_log.append(pME->prevValue());
_log.append(":");
_log.append(pME->newValue());
}
_log.append("\n");
if (_cancel) evt->stopPropagation();
if (_readd)
pCurrentTarget->addEventListener(type, this, _capture);
}