本文整理汇总了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;
}
示例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;
}
}
}
}
}
示例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();
}
示例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);
}
示例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();
}
示例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()));
}
示例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();
}
示例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();
}
示例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;
}
示例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();
}
示例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;
}
示例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;
}
示例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);
}
示例14: setData
void ProcessingInstructionImpl::setData( const DOMString &_data )
{
if (m_data)
m_data->deref();
m_data = _data.implementation();
if (m_data)
m_data->ref();
}
示例15: setPrefix
void AttrImpl::setPrefix(const DOMString &_prefix, int &exceptioncode )
{
checkSetPrefix(_prefix, exceptioncode);
if (exceptioncode)
return;
m_attribute->setPrefix(_prefix.implementation());
}