本文整理汇总了C++中dom::DOMString类的典型用法代码示例。如果您正苦于以下问题:C++ DOMString类的具体用法?C++ DOMString怎么用?C++ DOMString使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了DOMString类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: recomputeNamespaceInfo
void CSSStyleSheetImpl::recomputeNamespaceInfo()
{
assert(!m_namespaces);
m_namespaces = new QList<CSSNamespaceRuleImpl *>;
m_defaultNamespace = NamespaceName::fromId(anyNamespace);
// Compute list of all the @namespace nodes, as well as the default one.
for (int i = 0; i < m_lstChildren->count(); ++i) {
StyleBaseImpl *b = m_lstChildren->at(i);
if (b->isRule() && static_cast<CSSRuleImpl *>(b)->type() == DOM::CSSRule::NAMESPACE_RULE) {
CSSNamespaceRuleImpl *nr = static_cast<CSSNamespaceRuleImpl *>(b);
DOM::DOMString prefix = nr->prefix();
DOM::DOMString uri = nr->namespaceURI();
if (uri.isNull()) {
continue;
}
if (nr->isDefault()) {
m_defaultNamespace = NamespaceName::fromString(uri);
}
m_namespaces->append(nr);
}
}
}
开发者ID:KDE,项目名称:khtml,代码行数:27,代码来源:css_stylesheetimpl.cpp
示例2: tryGet
Value DOMCSSStyleDeclaration::tryGet(ExecState *exec, const Identifier &propertyName) const
{
#ifdef KJS_VERBOSE
kdDebug(6070) << "DOMCSSStyleDeclaration::tryGet " << propertyName.qstring() << endl;
#endif
const HashEntry *entry = Lookup::findEntry(&DOMCSSStyleDeclarationTable, propertyName);
if(entry)
switch(entry->value)
{
case CssText:
return String(styleDecl.cssText());
case Length:
return Number(styleDecl.length());
case ParentRule:
return getDOMCSSRule(exec, styleDecl.parentRule());
default:
break;
}
// Look in the prototype (for functions) before assuming it's a name
Object proto = Object::dynamicCast(prototype());
if(proto.isValid() && proto.hasProperty(exec, propertyName))
return proto.get(exec, propertyName);
bool ok;
long unsigned int u = propertyName.toULong(&ok);
if(ok)
return String(DOM::CSSStyleDeclaration(styleDecl).item(u));
// pixelTop returns "CSS Top" as number value in unit pixels
// posTop returns "CSS top" as number value in unit pixels _if_ its a
// positioned element. if it is not a positioned element, return 0
// from MSIE documentation ### IMPLEMENT THAT (Dirk)
bool asNumber;
QString p = cssPropertyName(propertyName, asNumber);
#ifdef KJS_VERBOSE
kdDebug(6070) << "DOMCSSStyleDeclaration: converting to css property name: " << p << (asNumber ? "px" : "") << endl;
#endif
if(asNumber)
{
DOM::CSSValue v = styleDecl.getPropertyCSSValue(p);
if(!v.isNull() && v.cssValueType() == DOM::CSSValue::CSS_PRIMITIVE_VALUE)
return Number(static_cast< DOM::CSSPrimitiveValue >(v).getFloatValue(DOM::CSSPrimitiveValue::CSS_PX));
}
DOM::DOMString str = const_cast< DOM::CSSStyleDeclaration & >(styleDecl).getPropertyValue(p);
if(!str.isNull())
return String(str);
// see if we know this css property, return empty then
if(DOM::getPropertyID(p.latin1(), p.length()))
return String(DOM::DOMString(""));
return DOMObject::tryGet(exec, propertyName);
}
开发者ID:,项目名称:,代码行数:57,代码来源:
示例3: attach
UString::UString(const DOM::DOMString &d)
{
if (d.isNull()) {
attach(&Rep::null);
return;
}
unsigned int len = d.length();
UChar *dat = new UChar[len];
memcpy(dat, d.unicode(), len * sizeof(UChar));
rep = UString::Rep::create(dat, len);
}
开发者ID:BackupTheBerlios,项目名称:nirvana-svn,代码行数:12,代码来源:kjs_binding.cpp
示例4: addNamespace
void CSSStyleSheetImpl::addNamespace(CSSParser* p, const DOM::DOMString& prefix, const DOM::DOMString& uri)
{
if (uri.isEmpty())
return;
m_namespaces = new CSSNamespace(prefix, uri, m_namespaces);
if (prefix.isEmpty())
// Set the default namespace on the parser so that selectors that omit namespace info will
// be able to pick it up easily.
p->defaultNamespace = XmlNamespaceTable::getNamespaceID(uri, false);
}
开发者ID:BackupTheBerlios,项目名称:nirvana-svn,代码行数:12,代码来源:css_stylesheetimpl.cpp
示例5: setMediaText
void MediaListImpl::setMediaText(const DOM::DOMString &value)
{
m_lstMedia.clear();
QString val = value.string();
QStringList list = QStringList::split( ',', value.string() );
for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it )
{
DOMString medium = (*it).stripWhiteSpace();
if( medium != "" )
m_lstMedia.append( medium );
}
}
开发者ID:crutchwalkfactory,项目名称:motocakerteam,代码行数:12,代码来源:css_stylesheetimpl.cpp
示例6: addNamespace
void CSSStyleSheetImpl::addNamespace(CSSParser* p, const DOM::DOMString& prefix, const DOM::DOMString& uri)
{
int exceptioncode = 0;
if (uri.isEmpty())
return;
m_namespaces = new CSSNamespace(prefix, uri, m_namespaces);
if (prefix.isEmpty()) {
Q_ASSERT(m_doc != 0);
m_defaultNamespace = m_doc->getId(NodeImpl::NamespaceId, uri.implementation(), false, false, &exceptioncode);
}
}
开发者ID:,项目名称:,代码行数:14,代码来源:
示例7: toggle
void MetabarFunctions::toggle(DOM::DOMString item)
{
DOM::HTMLDocument doc = m_html->htmlDocument();
DOM::HTMLElement node = static_cast<DOM::HTMLElement>(doc.getElementById(item));
if(!node.isNull()) {
DOM::NodeList children = node.childNodes();
DOM::CSSStyleDeclaration style = node.style();
DOM::DOMString expanded = node.getAttribute("expanded");
bool isExpanded = expanded == "true";
int height = 0;
if(!isExpanded) {
height = getHeight(node);
}
DOM::DOMString att = isExpanded ? "false" : "true";
node.setAttribute("expanded", att);
KConfig config("metabarrc");
config.setGroup("General");
if(config.readBoolEntry("AnimateResize", false)) {
resizeMap[item.string()] = height;
if(!timer->isActive()) {
timer->start(RESIZE_SPEED);
}
}
else {
style.setProperty("height", QString("%1px").arg(height), CSS_PRIORITY);
}
}
}
开发者ID:,项目名称:,代码行数:35,代码来源:
示例8: getString
KJSO KJS::getString(DOM::DOMString s)
{
if (s.isNull())
return Null();
else
return String(s);
}
开发者ID:BackupTheBerlios,项目名称:nirvana-svn,代码行数:7,代码来源:kjs_binding.cpp
示例9: attach
UString::UString(const DOM::DOMString &d)
{
if(d.isNull())
{
// we do a conversion here as null DOMStrings shouldn't cross
// the boundary to kjs. They should either be empty strings
// or explicitly converted to KJS::Null via getString().
attach(&Rep::empty);
return;
}
unsigned int len = d.length();
UChar *dat = new UChar[len];
memcpy(dat, d.unicode(), len * sizeof(UChar));
rep = UString::Rep::create(dat, len);
}
开发者ID:,项目名称:,代码行数:16,代码来源:
示例10: to_lower_case_ascii
inline void to_lower_case_ascii(dom::DOMString &s)
{
typedef dom::DOMString::const_iterator iter;
typedef dom::DOMString::value_type char_type;
typedef dom::DOMString::traits_type traits;
iter const b = s.begin();
iter const e = s.end();
iter i = b;
traits::int_type v;
for (;;) {
if (i == e) return; // Nothing needs to be done
v = traits::to_int_type(*i);
if (0x7F < v) {
s = dom::to_lower_case(s); // Full Unicode upper casing
return;
}
if (0x41 <= v && v <= 0x5A) break; // Detect upper case ASCII
++i;
}
dom::DOMString s2;
s2.reserve(s.size());
s2.append(b, i);
s2.append(1, traits::to_char_type(v + 0x20)); // Convert detected character
for (;;) {
if (++i == e) break;
char_type c = *i;
v = traits::to_int_type(c);
if (0x7F < v) {
s = dom::to_lower_case(s); // Full Unicode upper casing
return;
}
if (0x41 <= v && v <= 0x5A) c = traits::to_char_type(v + 0x20);
s2.append(1, c);
}
s = s2;
}
开发者ID:kspangsege,项目名称:archon,代码行数:38,代码来源:util.hpp
示例11: setMediaText
void MediaListImpl::setMediaText(const DOM::DOMString &value)
{
m_lstMedia.clear();
const QString val = value.string();
const QStringList list = QStringList::split( ',', val );
const QStringList::ConstIterator itEnd = list.end();
for ( QStringList::ConstIterator it = list.begin(); it != itEnd; ++it )
{
const DOMString medium = (*it).stripWhiteSpace();
if( !medium.isEmpty() )
m_lstMedia.append( medium );
}
}
开发者ID:,项目名称:,代码行数:15,代码来源:
示例12: initializeCSSInfoFromElement
void DOMTreeView::initializeCSSInfoFromElement(const DOM::Element &element)
{
DOM::Document doc = element.ownerDocument();
DOM::AbstractView view = doc.defaultView();
DOM::CSSStyleDeclaration styleDecl = view.getComputedStyle(element,
DOM::DOMString());
unsigned long l = styleDecl.length();
cssProperties->clear();
cssProperties->setEnabled(true);
QList<QTreeWidgetItem *> items;
for (unsigned long i = 0; i < l; ++i) {
DOM::DOMString name = styleDecl.item(i);
DOM::DOMString value = styleDecl.getPropertyValue(name);
QStringList values;
values.append(name.string());
values.append(value.string());
items.append(new QTreeWidgetItem(static_cast<QTreeWidget*>(0), values));
}
cssProperties->insertTopLevelItems(0, items);
cssProperties->resizeColumnToContents(0);
}
开发者ID:blue-shell,项目名称:folderview,代码行数:24,代码来源:domtreeview.cpp
示例13: determineNamespace
void CSSStyleSheetImpl::determineNamespace(Q_UINT32& id, const DOM::DOMString& prefix)
{
// If the stylesheet has no namespaces we can just return. There won't be any need to ever check
// namespace values in selectors.
if (!m_namespaces)
return;
if (prefix.isEmpty())
id = makeId(noNamespace, localNamePart(id)); // No namespace. If an element/attribute has a namespace, we won't match it.
else if (prefix == "*")
id = makeId(anyNamespace, localNamePart(id)); // We'll match any namespace.
else {
CSSNamespace* ns = m_namespaces->namespaceForPrefix(prefix);
if (ns)
// Look up the id for this namespace URI.
id = makeId(XmlNamespaceTable::getNamespaceID(ns->uri(), false), localNamePart(id));
}
}
开发者ID:BackupTheBerlios,项目名称:nirvana-svn,代码行数:18,代码来源:css_stylesheetimpl.cpp
示例14: determineNamespace
void CSSStyleSheetImpl::determineNamespace(NamespaceName &namespacename, const DOM::DOMString &prefix)
{
if (prefix.isEmpty()) {
namespacename = NamespaceName::fromId(emptyNamespace); // No namespace. If an element/attribute has a namespace, we won't match it.
} else if (prefix == "*") {
namespacename = NamespaceName::fromId(anyNamespace); // We'll match any namespace.
} else {
if (!m_namespaces) {
recomputeNamespaceInfo();
}
// To lookup the name, we go backwards, so the latest one wins
for (int p = m_namespaces->count() - 1; p >= 0; --p) {
CSSNamespaceRuleImpl *ns = m_namespaces->at(p);
if (ns->prefix() == prefix) {
namespacename = NamespaceName::fromString(ns->namespaceURI());
return;
}
}
}
}
开发者ID:KDE,项目名称:khtml,代码行数:21,代码来源:css_stylesheetimpl.cpp
示例15: determineNamespace
void CSSStyleSheetImpl::determineNamespace(Q_UINT32& id, const DOM::DOMString& prefix)
{
// If the stylesheet has no namespaces we can just return. There won't be any need to ever check
// namespace values in selectors.
if (!m_namespaces)
return;
if (prefix.isEmpty())
id = makeId(emptyNamespace, localNamePart(id)); // No namespace. If an element/attribute has a namespace, we won't match it.
else if (prefix == "*")
id = makeId(anyNamespace, localNamePart(id)); // We'll match any namespace.
else {
int exceptioncode = 0;
CSSNamespace* ns = m_namespaces->namespaceForPrefix(prefix);
if (ns) {
Q_ASSERT(m_doc != 0);
// Look up the id for this namespace URI.
Q_UINT16 nsid = m_doc->getId(NodeImpl::NamespaceId, 0, 0, ns->uri().implementation(), false, false, &exceptioncode);
id = makeId(nsid, localNamePart(id));
}
}
}
开发者ID:,项目名称:,代码行数:23,代码来源:
示例16: validate_xml_1_0_name
inline bool validate_xml_1_0_name(dom::DOMString const &name)
{
typedef dom::DOMString::const_iterator iter;
typedef dom::DOMString::traits_type traits;
typedef traits::int_type int_type;
iter const begin = name.begin(), end = name.end();
for (iter i=begin; i!=end; ++i) {
int_type const v = traits::to_int_type(*i);
if (v < 0xC0) { // 0x0 <= v < 0xC0
if (v < 0x5B) { // 0x0 <= v < 0x5B
if (v < 0x41) { // 0x0 <= v < 0x41
if (v < 0x30) { // 0x0 <= v < 0x30
if (v != 0x2D && v != 0x2E) return 0;
// '-' or '.' --> good unless first char!
if (i == begin) return 0;
}
else if (0x3A <= v) { // 0x3A <= v < 0x41
if (v != 0x3A) return 0;
// ':' --> good!
}
else { // '0' <= v <= '9' --> good unless first char!
if (i == begin) return 0;
}
}
else {} // 'A' <= v <= 'Z' --> good!
}
else if (v < 0x7B) { // 0x5B <= v < 0x7B
if (v < 0x61) { // 0x5B <= v < 0x61
if (v != 0x5F) return 0;
// '_' --> good!
}
else {} // 'a' <= v <= 'z' --> good!
}
else { // 0x7B <= v < 0xC0
if (v != 0xB7) return 0;
// 0xB7 --> good unless first char!
if (i == begin) return 0;
}
}
else if (v <= 0x3000) { // 0xC0 <= v <= 0x3000
if (v < 0x2000) { // 0xC0 <= v < 0x2000
if (v <= 0x37E) { // 0xC0 <= v <= 0x37E
if (v < 0x300) { // 0xC0 <= v < 0x300
if (v <= 0xF7) { // 0xC0 <= v <= 0xF7
if (v == 0xD7 || v == 0xF7) return 0;
// 0xC0 <= v < 0xD7 or 0xD7 < v < 0xF7 --> good!
}
else {} // 0xF7 < v < 0x300 --> good!
}
else { // 0x300 <= v <= 0x37E
if (v < 0x370) { // 0x300 <= v < 0x370 --> good unless first char!
if (i == begin) return 0;
}
else { // 0x370 <= v <= 0x37E
if (v == 0x37E) return 0;
// 0x370 <= v < 0x37E --> good!
}
}
}
else {} // 0x37E < v < 0x2000 --> good!
}
else { // 0x2000 <= v <= 0x3000
if (v < 0x2190) { // 0x2000 <= v < 0x2190
if (v < 0x2070) { // 0x2000 <= v < 0x2070
if (v <= 0x203E) { // 0x2000 <= v <= 0x203E
if (v < 0x200E) { // 0x2000 <= v < 0x200E
if (v <= 0x200B) return 0; // 0x2000 <= v <= 0x200B --> bad!
// 0x200B < v < 0x200E --> good!
}
else return 0; // 0x200E <= v <= 0x203E --> bad!
}
else { // 0x203E < v < 0x2070
if (v <= 0x2040) { // 0x203E < v <= 0x2040 --> good unless first char!
if (i == begin) return 0;
}
else return 0; // 0x2040 < v < 0x2070 --> bad!
}
}
else {} // 0x2070 <= v < 0x2190 --> good!
}
else { // 0x2190 <= v <= 0x3000
if (v < 0x2C00) return 0; // 0x2190 <= v < 0x2C00 --> bad!
if (0x2FF0 <= v) return 0; // 0x2FF0 <= v <= 0x3000 --> bad!
// 0x2C00 <= v < 0x2FF0 --> good!
}
}
}
else { // 0x3000 < v <= 0xFFFF
if (0xD800 <= v) { // 0xD800 <= v <= 0xFFFF
if (v < 0xDC00) { // 0xD800 <= v < 0xDC00
// Combine UTF-16 surrogates
if (++i == end) return 0; // Incomplete surrogate pair
int_type const v2 = traits::to_int_type(*i);
if (v2 < 0xDC00 || 0xE000 <= v2) return 0; // Invalid high surrogate
core::UIntFast32 w = 0x10000 + (core::UIntFast32(v-0xD800)<<10) + (v2-0xDC00);
if (0xF0000 <= w) return 0; // 0xF0000 <= w --> bad!
// 0x10000 <= w < 0xF0000 --> good!
}
else { // 0xDC00 <= v <= 0xFFFF
if (v < 0xFDD0) { // 0xDC00 <= v < 0xFDD0
//.........这里部分代码省略.........
开发者ID:kspangsege,项目名称:archon,代码行数:101,代码来源:util.hpp
示例17: setPrototypeBinding
void XBLDocumentImpl::setPrototypeBinding(const DOM::DOMString& id, XBLPrototypeBinding* binding)
{
m_prototypeBindingTable.replace(id.string(), binding);
}
开发者ID:BackupTheBerlios,项目名称:wxwebcore-svn,代码行数:4,代码来源:xbl_docimpl.cpp
注:本文中的dom::DOMString类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论