本文整理汇总了C++中AtomicString::impl方法的典型用法代码示例。如果您正苦于以下问题:C++ AtomicString::impl方法的具体用法?C++ AtomicString::impl怎么用?C++ AtomicString::impl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AtomicString
的用法示例。
在下文中一共展示了AtomicString::impl方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: removeEventListener
void XMLHttpRequest::removeEventListener(const AtomicString& eventType, EventListener* eventListener, bool)
{
EventListenersMap::iterator iter = m_eventListeners.find(eventType.impl());
if (iter == m_eventListeners.end())
return;
ListenerVector& listeners = iter->second;
for (ListenerVector::const_iterator listenerIter = listeners.begin(); listenerIter != listeners.end(); ++listenerIter)
if (*listenerIter == eventListener) {
listeners.remove(listenerIter - listeners.begin());
return;
}
}
示例2: appendNamespace
static void appendNamespace(Vector<UChar>& result, const AtomicString& prefix, const AtomicString& ns, HashMap<AtomicStringImpl*, AtomicStringImpl*>& namespaces)
{
if (ns.isEmpty())
return;
// Use emptyAtoms's impl() for both null and empty strings since the HashMap can't handle 0 as a key
AtomicStringImpl* pre = prefix.isEmpty() ? emptyAtom.impl() : prefix.impl();
AtomicStringImpl* foundNS = namespaces.get(pre);
if (foundNS != ns.impl()) {
namespaces.set(pre, ns.impl());
DEFINE_STATIC_LOCAL(const String, xmlns, ("xmlns"));
result.append(' ');
append(result, xmlns);
if (!prefix.isEmpty()) {
result.append(':');
append(result, prefix);
}
result.append('=');
result.append('"');
appendAttributeValue(result, ns, false);
result.append('"');
}
示例3: removeEventListener
void DOMApplicationCache::removeEventListener(const AtomicString& eventType, EventListener* eventListener, bool useCapture)
{
EventListenersMap::iterator iter = m_eventListeners.find(eventType.impl());
if (iter == m_eventListeners.end())
return;
ListenerVector& listeners = iter->second;
for (ListenerVector::const_iterator listenerIter = listeners.begin(); listenerIter != listeners.end(); ++listenerIter) {
if (*listenerIter == eventListener) {
listeners.remove(listenerIter - listeners.begin());
return;
}
}
}
示例4: takeControlState
FormControlState SavedFormState::takeControlState(const AtomicString& name, const AtomicString& type)
{
if (m_stateForNewFormElements.isEmpty())
return FormControlState();
FormElementStateMap::iterator it = m_stateForNewFormElements.find(FormElementKey(name.impl(), type.impl()));
if (it == m_stateForNewFormElements.end())
return FormControlState();
ASSERT(it->value.size());
FormControlState state = it->value.takeFirst();
m_controlStateCount--;
if (!it->value.size())
m_stateForNewFormElements.remove(it);
return state;
}
示例5: nonCacheRequestComplete
void Loader::nonCacheRequestComplete(const KURL& url)
{
if (!url.protocolInHTTPFamily())
return;
AtomicString hostName = url.host();
m_hosts.checkConsistency();
RefPtr<Host> host = m_hosts.get(hostName.impl());
ASSERT(host);
if (!host)
return;
host->nonCacheRequestComplete();
}
示例6: appendNamespace
void MarkupAccumulator::appendNamespace(StringBuilder& result, const AtomicString& prefix, const AtomicString& namespaceURI, Namespaces& namespaces, bool allowEmptyDefaultNS)
{
namespaces.checkConsistency();
if (namespaceURI.isEmpty()) {
// http://www.whatwg.org/specs/web-apps/current-work/multipage/the-xhtml-syntax.html#xml-fragment-serialization-algorithm
if (allowEmptyDefaultNS && namespaces.get(emptyAtom.impl())) {
result.append(' ');
result.append(xmlnsAtom.string());
result.appendLiteral("=\"\"");
}
return;
}
// Use emptyAtoms's impl() for both null and empty strings since the HashMap can't handle 0 as a key
AtomicStringImpl* pre = prefix.isEmpty() ? emptyAtom.impl() : prefix.impl();
AtomicStringImpl* foundNS = namespaces.get(pre);
if (foundNS != namespaceURI.impl()) {
namespaces.set(pre, namespaceURI.impl());
// Add namespace to prefix pair so we can do constraint checking later.
if (inXMLFragmentSerialization() && !prefix.isEmpty())
namespaces.set(namespaceURI.impl(), pre);
// Make sure xml prefix and namespace are always known to uphold the constraints listed at http://www.w3.org/TR/xml-names11/#xmlReserved.
if (namespaceURI.impl() == XMLNames::xmlNamespaceURI.impl())
return;
result.append(' ');
result.append(xmlnsAtom.string());
if (!prefix.isEmpty()) {
result.append(':');
result.append(prefix);
}
result.append('=');
result.append('"');
appendAttributeValue(result, namespaceURI, false);
result.append('"');
}
}
示例7: func
PassRefPtr<HTMLElement> HTMLElementFactory::createHTMLElement(const AtomicString& tagName, Document* doc, HTMLFormElement* form, bool createdByParser)
{
if (!doc)
return 0; // Don't allow elements to ever be made without having a doc.
if (!gFunctionMap)
createFunctionMap();
ConstructorFunc func = gFunctionMap->get(tagName.impl());
if (func)
return func(tagName, doc, form, createdByParser);
// elements with no special representation in the DOM
return new HTMLElement(QualifiedName(nullAtom, tagName, xhtmlNamespaceURI), doc);
}
示例8: appendNamespace
void MarkupAccumulator::appendNamespace(StringBuilder& result, const AtomicString& prefix, const AtomicString& namespaceURI, Namespaces& namespaces)
{
namespaces.checkConsistency();
if (namespaceURI.isEmpty())
return;
// Use emptyAtoms's impl() for both null and empty strings since the HashMap can't handle 0 as a key
AtomicStringImpl* pre = prefix.isEmpty() ? emptyAtom.impl() : prefix.impl();
AtomicStringImpl* foundNS = namespaces.get(pre);
if (foundNS != namespaceURI.impl()) {
namespaces.set(pre, namespaceURI.impl());
result.append(' ');
result.append(xmlnsAtom.string());
if (!prefix.isEmpty()) {
result.append(':');
result.append(prefix);
}
result.append('=');
result.append('"');
appendAttributeValue(result, namespaceURI, false);
result.append('"');
}
}
示例9: getImageMap
HTMLMapElement* TreeScope::getImageMap(const String& url) const
{
if (url.isNull())
return nullptr;
if (!m_imageMapsByName)
return nullptr;
size_t hashPos = url.find('#');
String name = (hashPos == notFound ? String() : url.substring(hashPos + 1)).impl();
if (name.isEmpty())
return nullptr;
if (m_rootNode.document().isHTMLDocument()) {
AtomicString lowercasedName = name.lower();
return m_imageMapsByName->getElementByLowercasedMapName(*lowercasedName.impl(), *this);
}
return m_imageMapsByName->getElementByMapName(*AtomicString(name).impl(), *this);
}
示例10: pauseAnimationAtTime
bool CompositeAnimationPrivate::pauseAnimationAtTime(const AtomicString& name, double t)
{
if (!name)
return false;
RefPtr<KeyframeAnimation> keyframeAnim = m_keyframeAnimations.get(name.impl());
if (!keyframeAnim || !keyframeAnim->running())
return false;
int count = keyframeAnim->m_animation->iterationCount();
if ((t >= 0.0) && (!count || (t <= count * keyframeAnim->duration()))) {
keyframeAnim->pauseAtTime(t);
return true;
}
return false;
}
示例11: servePendingRequests
void Loader::servePendingRequests(Priority minimumPriority)
{
m_requestTimer.stop();
m_nonHTTPProtocolHost.servePendingRequests(minimumPriority);
Vector<Host*> hostsToServe;
copyValuesToVector(m_hosts, hostsToServe);
for (unsigned n = 0; n < hostsToServe.size(); ++n) {
Host* host = hostsToServe[n];
if (host->hasRequests())
host->servePendingRequests(minimumPriority);
else if (!host->processingResource()){
AtomicString name = host->name();
delete host;
m_hosts.remove(name.impl());
}
}
}
示例12: collectStyleForPresentationAttribute
void HTMLHRElement::collectStyleForPresentationAttribute(const QualifiedName& name, const AtomicString& value, MutableStyleProperties& style)
{
if (name == alignAttr) {
if (equalLettersIgnoringASCIICase(value, "left")) {
addPropertyToPresentationAttributeStyle(style, CSSPropertyMarginLeft, 0, CSSPrimitiveValue::CSS_PX);
addPropertyToPresentationAttributeStyle(style, CSSPropertyMarginRight, CSSValueAuto);
} else if (equalLettersIgnoringASCIICase(value, "right")) {
addPropertyToPresentationAttributeStyle(style, CSSPropertyMarginLeft, CSSValueAuto);
addPropertyToPresentationAttributeStyle(style, CSSPropertyMarginRight, 0, CSSPrimitiveValue::CSS_PX);
} else {
addPropertyToPresentationAttributeStyle(style, CSSPropertyMarginLeft, CSSValueAuto);
addPropertyToPresentationAttributeStyle(style, CSSPropertyMarginRight, CSSValueAuto);
}
} else if (name == widthAttr) {
bool ok;
int v = value.toInt(&ok);
if (ok && !v)
addPropertyToPresentationAttributeStyle(style, CSSPropertyWidth, 1, CSSPrimitiveValue::CSS_PX);
else
addHTMLLengthToStyle(style, CSSPropertyWidth, value);
} else if (name == colorAttr) {
addPropertyToPresentationAttributeStyle(style, CSSPropertyBorderStyle, CSSValueSolid);
addHTMLColorToStyle(style, CSSPropertyBorderColor, value);
addHTMLColorToStyle(style, CSSPropertyBackgroundColor, value);
} else if (name == noshadeAttr) {
if (!hasAttributeWithoutSynchronization(colorAttr)) {
addPropertyToPresentationAttributeStyle(style, CSSPropertyBorderStyle, CSSValueSolid);
RefPtr<CSSPrimitiveValue> darkGrayValue = CSSValuePool::singleton().createColorValue(Color::darkGray);
style.setProperty(CSSPropertyBorderColor, darkGrayValue);
style.setProperty(CSSPropertyBackgroundColor, darkGrayValue);
}
} else if (name == sizeAttr) {
StringImpl* si = value.impl();
int size = si->toInt();
if (size <= 1)
addPropertyToPresentationAttributeStyle(style, CSSPropertyBorderBottomWidth, 0, CSSPrimitiveValue::CSS_PX);
else
addPropertyToPresentationAttributeStyle(style, CSSPropertyHeight, size - 2, CSSPrimitiveValue::CSS_PX);
} else
HTMLElement::collectStyleForPresentationAttribute(name, value, style);
}
示例13: formStatesFromStateVector
void FormController::formStatesFromStateVector(const Vector<String>& stateVector, SavedFormStateMap& map)
{
map.clear();
size_t i = 0;
if (stateVector.size() < 1 || stateVector[i++] != formStateSignature())
return;
while (i + 1 < stateVector.size()) {
AtomicString formKey = stateVector[i++];
auto state = SavedFormState::deserialize(stateVector, i);
if (!state) {
i = 0;
break;
}
map.add(formKey.impl(), WTFMove(state));
}
if (i != stateVector.size())
map.clear();
}
示例14: toCoreAtomicString
void V8Window::namedPropertyGetterCustom(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
{
LocalDOMWindow* window = V8Window::toNative(info.Holder());
if (!window)
return;
LocalFrame* frame = window->frame();
// window is detached from a frame.
if (!frame)
return;
// Search sub-frames.
AtomicString propName = toCoreAtomicString(name);
Frame* child = frame->tree().scopedChild(propName);
if (child) {
v8SetReturnValueFast(info, child->domWindow(), window);
return;
}
// Search IDL functions defined in the prototype
if (!info.Holder()->GetRealNamedProperty(name).IsEmpty())
return;
// Search named items in the document.
Document* doc = frame->document();
if (doc && doc->isHTMLDocument()) {
if (toHTMLDocument(doc)->hasNamedItem(propName) || doc->hasElementWithId(propName.impl())) {
RefPtrWillBeRawPtr<HTMLCollection> items = doc->windowNamedItems(propName);
if (!items->isEmpty()) {
if (items->hasExactlyOneItem()) {
v8SetReturnValueFast(info, items->item(0), window);
return;
}
v8SetReturnValueFast(info, items.release(), window);
return;
}
}
}
}
示例15: removeItemFromMap
static void removeItemFromMap(HashCountedSet<AtomicStringImpl*>& map, const AtomicString& name)
{
if (name.isEmpty())
return;
map.remove(name.impl());
}