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


C++ DOMString::implementation方法代码示例

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


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

示例1: initMutationEvent

void MutationEventImpl::initMutationEvent(const DOMString &typeArg,
					  bool canBubbleArg,
					  bool cancelableArg,
					  const Node &relatedNodeArg,
					  const DOMString &prevValueArg,
					  const DOMString &newValueArg,
					  const DOMString &attrNameArg,
					  unsigned short attrChangeArg)
{
    EventImpl::initEvent(typeArg,canBubbleArg,cancelableArg);

    if (m_relatedNode)
	m_relatedNode->deref();
    if (m_prevValue)
	m_prevValue->deref();
    if (m_newValue)
	m_newValue->deref();
    if (m_attrName)
	m_attrName->deref();

    m_relatedNode = relatedNodeArg.handle();
    if (m_relatedNode)
	m_relatedNode->ref();
    m_prevValue = prevValueArg.implementation();
    if (m_prevValue)
	m_prevValue->ref();
    m_newValue = newValueArg.implementation();
    if (m_newValue)
	m_newValue->ref();
    m_attrName = attrNameArg.implementation();
    if (m_newValue)
	m_newValue->ref();
    m_attrChange = attrChangeArg;
}
开发者ID:,项目名称:,代码行数:34,代码来源:

示例2: parseClassAttribute

void HTMLNamedAttrMapImpl::parseClassAttribute(const DOMString& classStr)
{
    m_classList.clear();
    if (!element->hasClass())
        return;
    
    DOMString classAttr = element->getDocument()->inCompatMode() ? 
        (classStr.implementation()->isLower() ? classStr : DOMString(classStr.implementation()->lower())) :
        classStr;
    
    if (classAttr.find(' ') == -1)
        m_classList.setString(AtomicString(classAttr));
    else {
        QString val = classAttr.string();
        QStringList list = QStringList::split(' ', val);
        
        AtomicStringList* curr = 0;
        for (QStringList::Iterator it = list.begin(); it != list.end(); ++it)
        {
            const QString& singleClass = *it;
            if (!singleClass.isEmpty()) {
                if (curr) {
                    curr->setNext(new AtomicStringList(AtomicString(singleClass)));
                    curr = curr->next();
                }
                else {
                    m_classList.setString(AtomicString(singleClass));
                    curr = &m_classList;
                }
            }
        }
    }
}
开发者ID:BackupTheBerlios,项目名称:nirvana-svn,代码行数:33,代码来源:html_elementimpl.cpp

示例3: addCSSLength

void HTMLElementImpl::addCSSLength(int id, const DOMString &value, bool numOnly, bool multiLength)
{
    if (!m_hasCombinedStyle) {
        createNonCSSDecl();
    }

    // strip attribute garbage to avoid CSS parsing errors
    // ### create specialized hook that avoids parsing every
    // value twice!
    if (value.implementation()) {
        // match \s*[+-]?\d*(\.\d*)?[%\*]?
        unsigned i = 0, j = 0;
        QChar *s = value.implementation()->s;
        unsigned l = value.implementation()->l;

        while (i < l && s[i].isSpace()) {
            ++i;
        }
        if (i < l && (s[i] == '+' || s[i] == '-')) {
            ++i;
        }
        while (i < l && s[i].isDigit()) {
            ++i, ++j;
        }

        // no digits!
        if (j == 0) {
            return;
        }

        int v = qBound(-8192, QString::fromRawData(s, i).toInt(), 8191);
        const char *suffix = "px";
        if (!numOnly || multiLength) {
            // look if we find a % or *
            while (i < l) {
                if (multiLength && s[i] == '*') {
                    suffix = "";
                    break;
                }
                if (s[i] == '%') {
                    suffix = "%";
                    break;
                }
                ++i;
            }
        }
        if (numOnly) {
            suffix = "";
        }

        QString ns = QString::number(v) + suffix;
        nonCSSStyleDecls()->setLengthProperty(id, DOMString(ns), false, multiLength);
        setChanged();
        return;
    }

    nonCSSStyleDecls()->setLengthProperty(id, value, false, multiLength);
    setChanged();
}
开发者ID:KDE,项目名称:khtml,代码行数:59,代码来源:html_elementimpl.cpp

示例4: mapId

NodeImpl::Id NamedAttrMapImpl::mapId(const DOMString& namespaceURI,
                                     const DOMString& localName, bool readonly)
{
    assert(element);
    if (!element) return 0;
    return element->getDocument()->attrId(namespaceURI.implementation(),
                                            localName.implementation(), readonly);
}
开发者ID:BackupTheBerlios,项目名称:wxwebcore-svn,代码行数:8,代码来源:dom_elementimpl.cpp

示例5: NodeBaseImpl

ProcessingInstructionImpl::ProcessingInstructionImpl(DocumentImpl *doc, DOMString _target, DOMString _data) : NodeBaseImpl(doc)
{
    m_target = _target.implementation();
    if (m_target)
	m_target->ref();
    m_data = _data.implementation();
    if (m_data)
	m_data->ref();
}
开发者ID:BackupTheBerlios,项目名称:nirvana-svn,代码行数:9,代码来源:dom_xmlimpl.cpp

示例6: setAttribute

void ElementImpl::setAttribute(NodeImpl::Id id, const DOMString &value, const DOMString &qName, int &exceptioncode)
{
    // NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly
    if(isReadOnly())
    {
        exceptioncode = DOMException::NO_MODIFICATION_ALLOWED_ERR;
        return;
    }
    attributes()->setValue(id, value.implementation(), (qName.isEmpty() ? 0 : qName.implementation()));
}
开发者ID:,项目名称:,代码行数:10,代码来源:

示例7: NodeBaseImpl

NotationImpl::NotationImpl(DocumentPtr *doc, DOMString _name, DOMString _publicId, DOMString _systemId) : NodeBaseImpl(doc)
{
    m_name = _name.implementation();
    if (m_name)
        m_name->ref();
    m_publicId = _publicId.implementation();
    if (m_publicId)
        m_publicId->ref();
    m_systemId = _systemId.implementation();
    if (m_systemId)
        m_systemId->ref();
}
开发者ID:crutchwalkfactory,项目名称:motocakerteam,代码行数:12,代码来源:dom_xmlimpl.cpp

示例8: setPrefix

void AttrImpl::setPrefix(const DOMString &_prefix, int &exceptioncode)
{
    checkSetPrefix(_prefix, exceptioncode);
    if(exceptioncode)
        return;

    if(m_prefix == _prefix.implementation())
        return;

    if(m_prefix)
        m_prefix->deref();
    m_prefix = _prefix.implementation();
    if(m_prefix)
        m_prefix->ref();
}
开发者ID:,项目名称:,代码行数:15,代码来源:

示例9: setInnerText

bool HTMLElementImpl::setInnerText( const DOMString &text )
{
    // following the IE specs.
    if( endTag[id()] == FORBIDDEN )
        return false;
    // IE disallows innerHTML on inline elements. I don't see why we should have this restriction, as our
    // dhtml engine can cope with it. Lars
    //if ( isInline() ) return false;
    switch( id() ) {
        case ID_COL:
        case ID_COLGROUP:
        case ID_FRAMESET:
        case ID_HEAD:
        case ID_HTML:
        case ID_TABLE:
        case ID_TBODY:
        case ID_TFOOT:
        case ID_THEAD:
        case ID_TR:
            return false;
        default:
            break;
    }

    removeChildren();

    TextImpl *t = new TextImpl( docPtr(), text.implementation() );
    int ec = 0;
    appendChild( t, ec );
    if ( !ec )
        return true;
    return false;
}
开发者ID:crutchwalkfactory,项目名称:motocakerteam,代码行数:33,代码来源:html_elementimpl.cpp

示例10: addCSSLength

void HTMLElementImpl::addCSSLength(int id, const DOMString &value, bool numOnly, bool multiLength)
{
    if(!m_styleDecls) createDecl();

    // strip attribute garbage..
    DOMStringImpl* v = value.implementation();
    if ( v ) {
        unsigned int l = 0;

        while ( l < v->l && v->s[l].unicode() <= ' ') l++;

        for ( ;l < v->l; l++ ) {
            char cc = v->s[l].latin1();
            if ( cc > '9' || ( cc < '0' && ( numOnly || (cc != '%' && cc != '.' &&
							 !( multiLength && cc == '*') ) ) ) )
                break;
        }
        if ( l != v->l ) {
            m_styleDecls->setLengthProperty( id, DOMString( v->s, l ), false, true, multiLength );
            setChanged();
            return;
        }
    }

    m_styleDecls->setLengthProperty(id, value, false, true, multiLength);
    setChanged();
}
开发者ID:crutchwalkfactory,项目名称:motocakerteam,代码行数:27,代码来源:html_elementimpl.cpp

示例11: initKeyboardEvent

void KeyboardEventImpl::initKeyboardEvent(const DOMString &typeArg,
                        bool canBubbleArg,
                        bool cancelableArg,
                        const AbstractView &viewArg, 
                        const DOMString &keyIdentifierArg, 
                        unsigned long keyLocationArg, 
                        bool ctrlKeyArg, 
                        bool altKeyArg, 
                        bool shiftKeyArg, 
                        bool metaKeyArg, 
                        bool altGraphKeyArg)
{
    if (m_keyIdentifier)
        m_keyIdentifier->deref();

    UIEventImpl::initUIEvent(typeArg, canBubbleArg, cancelableArg, viewArg, 0);
    m_keyIdentifier = keyIdentifierArg.implementation();
    if (m_keyIdentifier)
        m_keyIdentifier->ref();
    m_keyLocation = keyLocationArg;
    m_ctrlKey = ctrlKeyArg;
    m_shiftKey = shiftKeyArg;
    m_altKey = altKeyArg;
    m_metaKey = metaKeyArg;
    m_altGraphKey = altGraphKeyArg;
}
开发者ID:BackupTheBerlios,项目名称:wxwebcore-svn,代码行数:26,代码来源:dom2_eventsimpl.cpp

示例12: HTMLFormElementImpl

NodeImpl *KHTMLParser::handleIsindex( Token *t )
{
    NodeImpl *n;
    HTMLFormElementImpl *myform = form;
    if ( !myform ) {
        myform = new HTMLFormElementImpl(document, true);
        n = myform;
    } else
        n = new HTMLDivElementImpl( document, ID_DIV );
    NodeImpl *child = new HTMLHRElementImpl( document );
    n->addChild( child );
    AttributeImpl* a = t->attrs ? t->attrs->getAttributeItem(ATTR_PROMPT) : 0;
    DOMString text = i18n("This is a searchable index. Enter search keywords: ");
    if (a)
        text = a->value();
    child = new TextImpl(document, text.implementation());
    n->addChild( child );
    child = new HTMLIsIndexElementImpl(document, myform);
    static_cast<ElementImpl *>(child)->setAttribute(ATTR_TYPE, "khtml_isindex");
    n->addChild( child );
    child = new HTMLHRElementImpl( document );
    n->addChild( child );

    return n;
}
开发者ID:crutchwalkfactory,项目名称:motocakerteam,代码行数:25,代码来源:htmlparser.cpp

示例13: addCSSLength

void HTMLElementImpl::addCSSLength(HTMLAttributeImpl* attr, int id, const DOMString &value)
{
    // FIXME: This function should not spin up the CSS parser, but should instead just figure out the correct
    // length unit and make the appropriate parsed value.
    if (!attr->decl()) createMappedDecl(attr);

    // strip attribute garbage..
    DOMStringImpl* v = value.implementation();
    if ( v ) {
        unsigned int l = 0;
        
        while ( l < v->l && v->s[l].unicode() <= ' ') l++;
        
        for ( ;l < v->l; l++ ) {
            char cc = v->s[l].latin1();
            if ( cc > '9' || ( cc < '0' && cc != '*' && cc != '%' && cc != '.') )
                break;
        }
        if ( l != v->l ) {
            attr->decl()->setLengthProperty(id, DOMString( v->s, l ), false);
            return;
        }
    }
    
    attr->decl()->setLengthProperty(id, value, false);
}
开发者ID:BackupTheBerlios,项目名称:nirvana-svn,代码行数:26,代码来源:html_elementimpl.cpp

示例14: setData

void ProcessingInstructionImpl::setData( const DOMString &_data )
{
    if (m_data)
	m_data->deref();
    m_data = _data.implementation();
    if (m_data)
	m_data->ref();
}
开发者ID:BackupTheBerlios,项目名称:nirvana-svn,代码行数:8,代码来源:dom_xmlimpl.cpp

示例15: setPrefix

void AttrImpl::setPrefix(const DOMString &_prefix, int &exceptioncode )
{
    checkSetPrefix(_prefix, exceptioncode);
    if (exceptioncode)
        return;

    m_attribute->setPrefix(_prefix.implementation());
}
开发者ID:BackupTheBerlios,项目名称:wxwebcore-svn,代码行数:8,代码来源:dom_elementimpl.cpp


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