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


C++ QualifiedName::namespaceURI方法代码示例

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


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

示例1: if

PassRefPtr<Element> CustomElementRegistry::createCustomTagElement(const QualifiedName& tagName)
{
    if (!document())
        return 0;

    ASSERT(isCustomTagName(tagName.localName()));

    RefPtr<Element> element;

    if (HTMLNames::xhtmlNamespaceURI == tagName.namespaceURI())
        element = HTMLElement::create(tagName, document());
    else if (SVGNames::svgNamespaceURI == tagName.namespaceURI())
        element = SVGElement::create(tagName, document());
    else
        return Element::create(tagName, document());

    element->setIsCustomElement();

    RefPtr<CustomElementDefinition> definition = findAndCheckNamespace(tagName.localName(), tagName.namespaceURI());
    if (!definition || definition->isTypeExtension()) {
        // If a definition for a type extension was available, this
        // custom tag element will be unresolved in perpetuity.
        didCreateUnresolvedElement(CustomElementDefinition::CustomTag, tagName.localName(), element.get());
    } else {
        didCreateCustomTagElement(definition.get(), element.get());
    }

    return element.release();
}
开发者ID:windyuuy,项目名称:opera,代码行数:29,代码来源:CustomElementRegistry.cpp

示例2: registerElement

void CustomElementRegistry::registerElement(CustomElementConstructorBuilder* constructorBuilder, const AtomicString& userSuppliedName, ExceptionCode& ec)
{
    RefPtr<CustomElementRegistry> protect(this);

    if (!constructorBuilder->isFeatureAllowed())
        return;

    AtomicString type = userSuppliedName.lower();
    if (!isValidName(type)) {
        ec = INVALID_CHARACTER_ERR;
        return;
    }

    if (!constructorBuilder->validateOptions()) {
        ec = INVALID_STATE_ERR;
        return;
    }

    QualifiedName tagName = nullQName();
    if (!constructorBuilder->findTagName(type, tagName)) {
        ec = NAMESPACE_ERR;
        return;
    }
    ASSERT(tagName.namespaceURI() == HTMLNames::xhtmlNamespaceURI || tagName.namespaceURI() == SVGNames::svgNamespaceURI);

    if (m_definitions.contains(type)) {
        ec = INVALID_STATE_ERR;
        return;
    }

    RefPtr<CustomElementCallback> lifecycleCallbacks = constructorBuilder->createCallback(document());

    // Consulting the constructor builder could execute script and
    // kill the document.
    if (!document()) {
        ec = INVALID_STATE_ERR;
        return;
    }

    RefPtr<CustomElementDefinition> definition = CustomElementDefinition::create(type, tagName.localName(), tagName.namespaceURI(), lifecycleCallbacks);

    if (!constructorBuilder->createConstructor(document(), definition.get())) {
        ec = NOT_SUPPORTED_ERR;
        return;
    }

    m_definitions.add(definition->type(), definition);

    // Upgrade elements that were waiting for this definition.
    CustomElementUpgradeCandidateMap::ElementSet upgradeCandidates = m_candidates.takeUpgradeCandidatesFor(definition.get());
    constructorBuilder->didRegisterDefinition(definition.get(), upgradeCandidates);

    for (CustomElementUpgradeCandidateMap::ElementSet::iterator it = upgradeCandidates.begin(); it != upgradeCandidates.end(); ++it) {
        (*it)->setNeedsStyleRecalc(); // :unresolved has changed

        enqueueReadyCallback(lifecycleCallbacks.get(), *it);
    }
}
开发者ID:windyuuy,项目名称:opera,代码行数:58,代码来源:CustomElementRegistry.cpp

示例3: registerElement

CustomElementDefinition* CustomElementRegistry::registerElement(Document* document, CustomElementConstructorBuilder* constructorBuilder, const AtomicString& userSuppliedName, CustomElement::NameSet validNames, ExceptionState& exceptionState)
{
    AtomicString type = userSuppliedName.lower();

    if (!constructorBuilder->isFeatureAllowed()) {
        CustomElementException::throwException(CustomElementException::CannotRegisterFromExtension, type, exceptionState);
        return 0;
    }

    if (!CustomElement::isValidName(type, validNames)) {
        CustomElementException::throwException(CustomElementException::InvalidName, type, exceptionState);
        return 0;
    }

    if (m_registeredTypeNames.contains(type)) {
        CustomElementException::throwException(CustomElementException::TypeAlreadyRegistered, type, exceptionState);
        return 0;
    }

    QualifiedName tagName = QualifiedName::null();
    if (!constructorBuilder->validateOptions(type, tagName, exceptionState))
        return 0;

    ASSERT(tagName.namespaceURI() == HTMLNames::xhtmlNamespaceURI || tagName.namespaceURI() == SVGNames::svgNamespaceURI);

    ASSERT(!m_documentWasDetached);

    RefPtrWillBeRawPtr<CustomElementLifecycleCallbacks> lifecycleCallbacks = constructorBuilder->createCallbacks();

    // Consulting the constructor builder could execute script and
    // kill the document.
    if (m_documentWasDetached) {
        CustomElementException::throwException(CustomElementException::ContextDestroyedCreatingCallbacks, type, exceptionState);
        return 0;
    }

    const CustomElementDescriptor descriptor(type, tagName.namespaceURI(), tagName.localName());
    RefPtrWillBeRawPtr<CustomElementDefinition> definition = CustomElementDefinition::create(descriptor, lifecycleCallbacks);

    if (!constructorBuilder->createConstructor(document, definition.get(), exceptionState))
        return 0;

    m_definitions.add(descriptor, definition);
    m_registeredTypeNames.add(descriptor.type());

    if (!constructorBuilder->didRegisterDefinition(definition.get())) {
        CustomElementException::throwException(CustomElementException::ContextDestroyedRegisteringDefinition, type, exceptionState);
        return 0;
    }

    return definition.get();
}
开发者ID:eth-srl,项目名称:BlinkER,代码行数:52,代码来源:CustomElementRegistry.cpp

示例4: create

PassRefPtrWillBeRawPtr<Element> CustomElementRegistrationContext::createCustomTagElement(Document& document, const QualifiedName& tagName)
{
    ASSERT(CustomElement::isValidName(tagName.localName()));

    RefPtrWillBeRawPtr<Element> element;

    if (HTMLNames::xhtmlNamespaceURI == tagName.namespaceURI()) {
        element = HTMLElement::create(tagName, document);
    } else if (SVGNames::svgNamespaceURI == tagName.namespaceURI()) {
        element = SVGUnknownElement::create(tagName, document);
    } else {
        // XML elements are not custom elements, so return early.
        return Element::create(tagName, &document);
    }

    element->setCustomElementState(Element::WaitingForUpgrade);
    resolveOrScheduleResolution(element.get(), nullAtom);
    return element.release();
}
开发者ID:ericwilligers,项目名称:blink,代码行数:19,代码来源:CustomElementRegistrationContext.cpp

示例5: isCaseSensitiveAttribute

bool HTMLDocument::isCaseSensitiveAttribute(
    const QualifiedName& attributeName) {
  static HashSet<StringImpl*>* htmlCaseInsensitiveAttributesSet =
      createHtmlCaseInsensitiveAttributesSet();
  bool isPossibleHTMLAttr =
      !attributeName.hasPrefix() && (attributeName.namespaceURI() == nullAtom);
  return !isPossibleHTMLAttr ||
         !htmlCaseInsensitiveAttributesSet->contains(
             attributeName.localName().impl());
}
开发者ID:mirror,项目名称:chromium,代码行数:10,代码来源:HTMLDocument.cpp

示例6: cssPropertyIdForSVGAttributeName

CSSPropertyID SVGElement::cssPropertyIdForSVGAttributeName(const QualifiedName& attrName)
{
    if (!attrName.namespaceURI().isNull())
        return CSSPropertyInvalid;

    static NeverDestroyed<HashMap<AtomicStringImpl*, CSSPropertyID>> properties;
    if (properties.get().isEmpty())
        populateAttributeNameToCSSPropertyIDMap(properties.get());

    return properties.get().get(attrName.localName().impl());
}
开发者ID:cheekiatng,项目名称:webkit,代码行数:11,代码来源:SVGElement.cpp

示例7: setTypeExtension

PassRefPtr<Element> CustomElementRegistry::createElement(const QualifiedName& localName, const AtomicString& typeExtension) const
{
    const QualifiedName& typeName = QualifiedName(nullAtom, typeExtension, localName.namespaceURI());
    if (RefPtr<CustomElementConstructor> found = find(typeName, localName)) {
        RefPtr<Element> created = found->createElement();
        if (!typeName.localName().isEmpty() && localName != typeName)
            return setTypeExtension(created, typeExtension);
        return created.release();
    }

    return 0;
}
开发者ID:,项目名称:,代码行数:12,代码来源:

示例8: findAttributeWithName

static bool findAttributeWithName(const HTMLToken& token, const QualifiedName& name, size_t& indexOfMatchingAttribute)
{
    // Notice that we're careful not to ref the StringImpl here because we might be on a background thread.
    const String& attrName = name.namespaceURI() == XLinkNames::xlinkNamespaceURI ? "xlink:" + name.localName().string() : name.localName().string();

    for (size_t i = 0; i < token.attributes().size(); ++i) {
        if (equalIgnoringNullity(token.attributes().at(i).name, attrName)) {
            indexOfMatchingAttribute = i;
            return true;
        }
    }
    return false;
}
开发者ID:glenkim-dev,项目名称:blink-crosswalk,代码行数:13,代码来源:XSSAuditor.cpp

示例9: collectElementsByTagName

void SelectorDataList::collectElementsByTagName(ContainerNode& rootNode, const QualifiedName& tagName,  typename SelectorQueryTrait::OutputType& output) const
{
    for (Element& element : ElementTraversal::descendantsOf(rootNode)) {
        // querySelector*() doesn't allow namespaces and throws before it gets
        // here so we can ignore them.
        ASSERT(tagName.namespaceURI() == starAtom);
        if (matchesTagName(tagName, element)) {
            SelectorQueryTrait::appendElement(output, element);
            if (SelectorQueryTrait::shouldOnlyMatchFirstElement)
                return;
        }
    }
}
开发者ID:dstockwell,项目名称:blink,代码行数:13,代码来源:SelectorQuery.cpp

示例10: cssPropertyIdForFontFaceAttributeName

static CSSPropertyID cssPropertyIdForFontFaceAttributeName(const QualifiedName& attrName)
{
    if (!attrName.namespaceURI().isNull())
        return CSSPropertyInvalid;

    static HashMap<StringImpl*, CSSPropertyID>* propertyNameToIdMap = 0;
    if (!propertyNameToIdMap) {
        propertyNameToIdMap = new HashMap<StringImpl*, CSSPropertyID>;
        // This is a list of all @font-face CSS properties which are exposed as SVG XML attributes
        // Those commented out are not yet supported by WebCore's style system
        // mapAttributeToCSSProperty(propertyNameToIdMap, accent_heightAttr);
        // mapAttributeToCSSProperty(propertyNameToIdMap, alphabeticAttr);
        // mapAttributeToCSSProperty(propertyNameToIdMap, ascentAttr);
        // mapAttributeToCSSProperty(propertyNameToIdMap, bboxAttr);
        // mapAttributeToCSSProperty(propertyNameToIdMap, cap_heightAttr);
        // mapAttributeToCSSProperty(propertyNameToIdMap, descentAttr);
        mapAttributeToCSSProperty(propertyNameToIdMap, font_familyAttr);
        mapAttributeToCSSProperty(propertyNameToIdMap, font_sizeAttr);
        mapAttributeToCSSProperty(propertyNameToIdMap, font_stretchAttr);
        mapAttributeToCSSProperty(propertyNameToIdMap, font_styleAttr);
        mapAttributeToCSSProperty(propertyNameToIdMap, font_variantAttr);
        mapAttributeToCSSProperty(propertyNameToIdMap, font_weightAttr);
        // mapAttributeToCSSProperty(propertyNameToIdMap, hangingAttr);
        // mapAttributeToCSSProperty(propertyNameToIdMap, ideographicAttr);
        // mapAttributeToCSSProperty(propertyNameToIdMap, mathematicalAttr);
        // mapAttributeToCSSProperty(propertyNameToIdMap, overline_positionAttr);
        // mapAttributeToCSSProperty(propertyNameToIdMap, overline_thicknessAttr);
        // mapAttributeToCSSProperty(propertyNameToIdMap, panose_1Attr);
        // mapAttributeToCSSProperty(propertyNameToIdMap, slopeAttr);
        // mapAttributeToCSSProperty(propertyNameToIdMap, stemhAttr);
        // mapAttributeToCSSProperty(propertyNameToIdMap, stemvAttr);
        // mapAttributeToCSSProperty(propertyNameToIdMap, strikethrough_positionAttr);
        // mapAttributeToCSSProperty(propertyNameToIdMap, strikethrough_thicknessAttr);
        // mapAttributeToCSSProperty(propertyNameToIdMap, underline_positionAttr);
        // mapAttributeToCSSProperty(propertyNameToIdMap, underline_thicknessAttr);
        // mapAttributeToCSSProperty(propertyNameToIdMap, unicode_rangeAttr);
        // mapAttributeToCSSProperty(propertyNameToIdMap, units_per_emAttr);
        // mapAttributeToCSSProperty(propertyNameToIdMap, v_alphabeticAttr);
        // mapAttributeToCSSProperty(propertyNameToIdMap, v_hangingAttr);
        // mapAttributeToCSSProperty(propertyNameToIdMap, v_ideographicAttr);
        // mapAttributeToCSSProperty(propertyNameToIdMap, v_mathematicalAttr);
        // mapAttributeToCSSProperty(propertyNameToIdMap, widthsAttr);
        // mapAttributeToCSSProperty(propertyNameToIdMap, x_heightAttr);
    }

    return propertyNameToIdMap->get(attrName.localName().impl());
}
开发者ID:,项目名称:,代码行数:47,代码来源:

示例11: runAttributeChangedCallback

void ScriptCustomElementDefinition::runAttributeChangedCallback(
    Element* element,
    const QualifiedName& name,
    const AtomicString& oldValue,
    const AtomicString& newValue) {
  if (!m_scriptState->contextIsValid())
    return;
  ScriptState::Scope scope(m_scriptState.get());
  v8::Isolate* isolate = m_scriptState->isolate();
  v8::Local<v8::Value> argv[] = {
      v8String(isolate, name.localName()), v8StringOrNull(isolate, oldValue),
      v8StringOrNull(isolate, newValue),
      v8StringOrNull(isolate, name.namespaceURI()),
  };
  runCallback(m_attributeChangedCallback.newLocal(isolate), element,
              WTF_ARRAY_LENGTH(argv), argv);
}
开发者ID:ollie314,项目名称:chromium,代码行数:17,代码来源:ScriptCustomElementDefinition.cpp

示例12: appendAttribute

void MarkupAccumulator::appendAttribute(StringBuilder& result, const Element& element, const Attribute& attribute, Namespaces* namespaces)
{
    bool documentIsHTML = element.document().isHTMLDocument();

    result.append(' ');

    QualifiedName prefixedName = attribute.name();
    if (documentIsHTML && !attributeIsInSerializedNamespace(attribute))
        result.append(attribute.name().localName());
    else {
        if (!attribute.namespaceURI().isEmpty()) {
            AtomicStringImpl* foundNS = namespaces && attribute.prefix().impl() ? namespaces->get(attribute.prefix().impl()) : 0;
            bool prefixIsAlreadyMappedToOtherNS = foundNS && foundNS != attribute.namespaceURI().impl();
            if (attribute.prefix().isEmpty() || !foundNS || prefixIsAlreadyMappedToOtherNS) {
                if (AtomicStringImpl* prefix = namespaces ? namespaces->get(attribute.namespaceURI().impl()) : 0)
                    prefixedName.setPrefix(AtomicString(prefix));
                else {
                    bool shouldBeDeclaredUsingAppendNamespace = !attribute.prefix().isEmpty() && !foundNS;
                    if (!shouldBeDeclaredUsingAppendNamespace && attribute.localName() != xmlnsAtom && namespaces)
                        generateUniquePrefix(prefixedName, *namespaces);
                }
            }
        }
        result.append(prefixedName.toString());
    }

    result.append('=');

    if (element.isURLAttribute(attribute))
        appendQuotedURLAttributeValue(result, element, attribute);
    else {
        result.append('"');
        appendAttributeValue(result, attribute.value(), documentIsHTML);
        result.append('"');
    }

    if ((inXMLFragmentSerialization() || !documentIsHTML) && namespaces && shouldAddNamespaceAttribute(attribute, *namespaces))
        appendNamespace(result, prefixedName.prefix(), prefixedName.namespaceURI(), *namespaces);
}
开发者ID:Happy-Ferret,项目名称:webkit.js,代码行数:39,代码来源:MarkupAccumulator.cpp

示例13: appendAttribute

void MarkupAccumulator::appendAttribute(StringBuilder& result, const Element& element, const Attribute& attribute, Namespaces* namespaces)
{
    bool documentIsHTML = serializeAsHTMLDocument(element);

    result.append(' ');

    QualifiedName prefixedName = attribute.name();
    if (documentIsHTML && !attributeIsInSerializedNamespace(attribute)) {
        result.append(attribute.name().localName());
    } else {
        if (attribute.namespaceURI() == XLinkNames::xlinkNamespaceURI) {
            if (!attribute.prefix())
                prefixedName.setPrefix(xlinkAtom);
        } else if (attribute.namespaceURI() == XMLNames::xmlNamespaceURI) {
            if (!attribute.prefix())
                prefixedName.setPrefix(xmlAtom);
        } else if (attribute.namespaceURI() == XMLNSNames::xmlnsNamespaceURI) {
            if (attribute.name() != XMLNSNames::xmlnsAttr && !attribute.prefix())
                prefixedName.setPrefix(xmlnsAtom);
        }
        result.append(prefixedName.toString());
    }

    result.append('=');

    if (element.isURLAttribute(attribute)) {
        appendQuotedURLAttributeValue(result, element, attribute);
    } else {
        result.append('"');
        appendAttributeValue(result, attribute.value(), documentIsHTML);
        result.append('"');
    }

    if (!documentIsHTML && namespaces && shouldAddNamespaceAttribute(attribute, *namespaces))
        appendNamespace(result, prefixedName.prefix(), prefixedName.namespaceURI(), *namespaces);
}
开发者ID:junmin-zhu,项目名称:blink,代码行数:36,代码来源:MarkupAccumulator.cpp

示例14: hasAttribute

bool Element::hasAttribute(const QualifiedName& name) const
{
    return hasAttributeNS(name.namespaceURI(), name.localName());
}
开发者ID:Katarzynasrom,项目名称:patch-hosting-for-android-x86-support,代码行数:4,代码来源:Element.cpp

示例15: cssPropertyIdForSVGAttributeName

CSSPropertyID SVGElement::cssPropertyIdForSVGAttributeName(const QualifiedName& attrName)
{
    if (!attrName.namespaceURI().isNull())
        return CSSPropertyInvalid;

    static HashMap<StringImpl*, CSSPropertyID>* propertyNameToIdMap = 0;
    if (!propertyNameToIdMap) {
        propertyNameToIdMap = new HashMap<StringImpl*, CSSPropertyID>;
        // This is a list of all base CSS and SVG CSS properties which are exposed as SVG XML attributes
        const QualifiedName* const attrNames[] = {
            &alignment_baselineAttr,
            &baseline_shiftAttr,
            &buffered_renderingAttr,
            &clipAttr,
            &clip_pathAttr,
            &clip_ruleAttr,
            &SVGNames::colorAttr,
            &color_interpolationAttr,
            &color_interpolation_filtersAttr,
            &color_renderingAttr,
            &cursorAttr,
            &SVGNames::directionAttr,
            &displayAttr,
            &dominant_baselineAttr,
            &fillAttr,
            &fill_opacityAttr,
            &fill_ruleAttr,
            &filterAttr,
            &flood_colorAttr,
            &flood_opacityAttr,
            &font_familyAttr,
            &font_sizeAttr,
            &font_stretchAttr,
            &font_styleAttr,
            &font_variantAttr,
            &font_weightAttr,
            &image_renderingAttr,
            &letter_spacingAttr,
            &lighting_colorAttr,
            &marker_endAttr,
            &marker_midAttr,
            &marker_startAttr,
            &maskAttr,
            &mask_typeAttr,
            &opacityAttr,
            &overflowAttr,
            &paint_orderAttr,
            &pointer_eventsAttr,
            &shape_renderingAttr,
            &stop_colorAttr,
            &stop_opacityAttr,
            &strokeAttr,
            &stroke_dasharrayAttr,
            &stroke_dashoffsetAttr,
            &stroke_linecapAttr,
            &stroke_linejoinAttr,
            &stroke_miterlimitAttr,
            &stroke_opacityAttr,
            &stroke_widthAttr,
            &text_anchorAttr,
            &text_decorationAttr,
            &text_renderingAttr,
            &transform_originAttr,
            &unicode_bidiAttr,
            &vector_effectAttr,
            &visibilityAttr,
            &word_spacingAttr,
            &writing_modeAttr,
        };
        for (size_t i = 0; i < WTF_ARRAY_LENGTH(attrNames); i++) {
            CSSPropertyID propertyId = cssPropertyID(attrNames[i]->localName());
            ASSERT(propertyId > 0);
            propertyNameToIdMap->set(attrNames[i]->localName().impl(), propertyId);
        }
    }

    return propertyNameToIdMap->get(attrName.localName().impl());
}
开发者ID:astojilj,项目名称:chromium-crosswalk,代码行数:78,代码来源:SVGElement.cpp


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