本文整理汇总了C++中DOMString::lower方法的典型用法代码示例。如果您正苦于以下问题:C++ DOMString::lower方法的具体用法?C++ DOMString::lower怎么用?C++ DOMString::lower使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DOMString
的用法示例。
在下文中一共展示了DOMString::lower方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MediaQueryEvaluator
MediaQueryEvaluator:: MediaQueryEvaluator(const DOMString& acceptedMediaType, KHTMLPart* part, RenderStyle* style)
: m_mediaType(acceptedMediaType.lower())
, m_part(part)
, m_style(style)
, m_expResult(false) // doesn't matter when we have m_part and m_style
{
}
示例2: setDomain
void HTMLDocumentImpl::setDomain(const DOMString &newDomain)
{
if ( m_domain.isEmpty() ) // not set yet (we set it on demand to save time and space)
m_domain = KURL(URL()).host().lower(); // Initially set to the host
if ( m_domain.isEmpty() /*&& view() && view()->part()->openedByJS()*/ )
m_domain = newDomain.lower();
// Both NS and IE specify that changing the domain is only allowed when
// the new domain is a suffix of the old domain.
int oldLength = m_domain.length();
int newLength = newDomain.length();
if ( newLength < oldLength ) // e.g. newDomain=kde.org (7) and m_domain=www.kde.org (11)
{
DOMString test = m_domain.copy();
DOMString reference = newDomain.lower();
if ( test[oldLength - newLength - 1] == '.' ) // Check that it's a subdomain, not e.g. "de.org"
{
test.remove( 0, oldLength - newLength ); // now test is "kde.org" from m_domain
if ( test == reference ) // and we check that it's the same thing as newDomain
m_domain = reference;
}
}
}
示例3: requestFamilyName
void CSSFontSelector::requestFamilyName(const DOMString &familyName)
{
QHash<DOMString, CSSFontFace*>::const_iterator it = m_locallyInstalledFontFaces.constBegin();
QHash<DOMString, CSSFontFace*>::const_iterator end = m_locallyInstalledFontFaces.constEnd();
if (it == end) {
return;
}
const DOMString familyNameLower = familyName.lower();
do {
if (it.key() == familyNameLower) {
it.value()->refLoaders();
}
++it;
} while (it != end);
}
示例4: name
DOMString AttrImpl::name() const
{
DOMString n = getDocument()->getName(AttributeId, m_attrId);
// compat mode always return attribute names in lowercase.
// that's not formally in the specification, but common
// practice - a w3c erratum to DOM L2 is pending.
if(m_htmlCompat)
n = n.lower();
if(m_prefix && m_prefix->l)
return DOMString(m_prefix) + ":" + n;
return n;
}
示例5: addFontFaceRule
//.........这里部分代码省略.........
}
}
if (!fontFace || !fontFace->isValid()) {
delete fontFace;
return;
}
/*
if (rangeList) {
unsigned numRanges = rangeList->length();
for (unsigned i = 0; i < numRanges; i++) {
CSSUnicodeRangeValueImpl* range = static_cast<CSSUnicodeRangeValueImpl*>(rangeList->item(i));
fontFace->addRange(range->from(), range->to());
}
}
*/
// Hash under every single family name.
int familyLength = familyList->length();
for (int i = 0; i < familyLength; i++) {
CSSPrimitiveValueImpl *item = static_cast<CSSPrimitiveValueImpl *>(familyList->item(i));
DOMString familyName;
if (item->primitiveType() == CSSPrimitiveValue::CSS_STRING) {
familyName = DOMString(static_cast<FontFamilyValueImpl *>(item)->fontName());
} else if (item->primitiveType() == CSSPrimitiveValue::CSS_IDENT) {
// We need to use the raw text for all the generic family types, since @font-face is a way of actually
// defining what font to use for those types.
switch (item->getIdent()) {
case CSS_VAL_SERIF:
familyName = "-khtml-serif";
break;
case CSS_VAL_SANS_SERIF:
familyName = "-khtml-sans-serif";
break;
case CSS_VAL_CURSIVE:
familyName = "-khtml-cursive";
break;
case CSS_VAL_FANTASY:
familyName = "-khtml-fantasy";
break;
case CSS_VAL_MONOSPACE:
familyName = "-khtml-monospace";
break;
default:
break;
}
}
if (familyName.isEmpty()) {
continue;
}
fontFace->addFamilyName(familyName);
m_locallyInstalledFontFaces.insertMulti(familyName.lower(), fontFace);
fontFace->ref();
#if 0
// ENABLE(SVG_FONTS)
// SVG allows several <font> elements with the same font-family, differing only
// in ie. font-variant. Be sure to pick up the right one - in getFontData below.
if (foundSVGFont && (traitsMask & FontVariantSmallCapsMask)) {
familyName += "-webkit-svg-small-caps";
}
#endif
/*
Vector<RefPtr<CSSFontFace> >* familyFontFaces = m_fontFaces.get(familyName);
if (!familyFontFaces) {
familyFontFaces = new Vector<RefPtr<CSSFontFace> >;
m_fontFaces.set(familyName, familyFontFaces);
ASSERT(!m_locallyInstalledFontFaces.contains(familyName));
Vector<RefPtr<CSSFontFace> >* familyLocallyInstalledFaces;
Vector<unsigned> locallyInstalledFontsTraitsMasks;
fontCache()->getTraitsInFamily(familyName, locallyInstalledFontsTraitsMasks);
unsigned numLocallyInstalledFaces = locallyInstalledFontsTraitsMasks.size();
if (numLocallyInstalledFaces) {
familyLocallyInstalledFaces = new Vector<RefPtr<CSSFontFace> >;
m_locallyInstalledFontFaces.set(familyName, familyLocallyInstalledFaces);
for (unsigned i = 0; i < numLocallyInstalledFaces; ++i) {
RefPtr<CSSFontFace> locallyInstalledFontFace = CSSFontFace::create(static_cast<FontTraitsMask>(locallyInstalledFontsTraitsMasks[i]));
locallyInstalledFontFace->addSource(new CSSFontFaceSource(familyName));
ASSERT(locallyInstalledFontFace->isValid());
familyLocallyInstalledFaces->append(locallyInstalledFontFace);
}
}
}
familyFontFaces->append(fontFace);
*/
}
// Should be impossible, but in case empty/invalid family name makes it through...
if (fontFace->refCount() < 1) {
delete fontFace;
}
}