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


C++ MutationEvent::relatedNode方法代码示例

本文整理汇总了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;
}
开发者ID:Gin-Rye,项目名称:duibrowser,代码行数:28,代码来源:JSMutationEvent.cpp

示例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;
}
开发者ID:mulriple,项目名称:Webkit-Projects,代码行数:8,代码来源:JSMutationEvent.cpp

示例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);
}
开发者ID:sanyaade-embedded-systems,项目名称:armhf-node-webkit,代码行数:5,代码来源:V8MutationEvent.cpp

示例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);
    }
开发者ID:JerkWisdom,项目名称:zpublic,代码行数:70,代码来源:EventTest.cpp


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