这篇教程C++ treeScope函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中treeScope函数的典型用法代码示例。如果您正苦于以下问题:C++ treeScope函数的具体用法?C++ treeScope怎么用?C++ treeScope使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了treeScope函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: treeScopevoid ScopedStyleResolver::addTreeBoundaryCrossingRules(const RuleSet& authorRules, CSSStyleSheet* parentStyleSheet, unsigned sheetIndex){ bool isDocumentScope = treeScope().rootNode().isDocumentNode(); if (authorRules.deepCombinatorOrShadowPseudoRules().isEmpty() && (isDocumentScope || (authorRules.contentPseudoElementRules().isEmpty() && authorRules.slottedPseudoElementRules().isEmpty()))) return; if (!authorRules.deepCombinatorOrShadowPseudoRules().isEmpty()) m_hasDeepOrShadowSelector = true; OwnPtrWillBeRawPtr<RuleSet> ruleSetForScope = RuleSet::create(); addRules(ruleSetForScope.get(), authorRules.deepCombinatorOrShadowPseudoRules()); if (!isDocumentScope) { addRules(ruleSetForScope.get(), authorRules.contentPseudoElementRules()); addRules(ruleSetForScope.get(), authorRules.slottedPseudoElementRules()); } if (!m_treeBoundaryCrossingRuleSet) { m_treeBoundaryCrossingRuleSet = adoptPtrWillBeNoop(new CSSStyleSheetRuleSubSet()); treeScope().document().styleResolver()->addTreeBoundaryCrossingScope(treeScope().rootNode()); } m_treeBoundaryCrossingRuleSet->append(RuleSubSet::create(parentStyleSheet, sheetIndex, ruleSetForScope.release()));}
开发者ID:astojilj,项目名称:chromium-crosswalk,代码行数:25,
示例2: treeScopevoid HTMLMapElement::parseAttribute(const QualifiedName& name, const AtomicString& value){ // FIXME: This logic seems wrong for XML documents. // Either the id or name will be used depending on the order the attributes are parsed. if (isIdAttributeName(name) || name == nameAttr) { if (isIdAttributeName(name)) { // Call base class so that hasID bit gets set. HTMLElement::parseAttribute(name, value); if (document().isHTMLDocument()) return; } if (inDocument()) treeScope().removeImageMap(this); String mapName = value; if (mapName[0] == '#') mapName = mapName.substring(1); m_name = AtomicString(document().isHTMLDocument() ? mapName.lower() : mapName); if (inDocument()) treeScope().addImageMap(this); return; } HTMLElement::parseAttribute(name, value);}
开发者ID:eth-srl,项目名称:BlinkER,代码行数:26,
示例3: treeScopevoid ScopedStyleResolver::appendCSSStyleSheet(CSSStyleSheet& cssSheet, const MediaQueryEvaluator& medium){ unsigned index = m_authorStyleSheets.size(); m_authorStyleSheets.append(&cssSheet); StyleSheetContents* sheet = cssSheet.contents(); AddRuleFlags addRuleFlags = treeScope().document().securityOrigin()->canRequest(sheet->baseURL()) ? RuleHasDocumentSecurityOrigin : RuleHasNoSpecialState; const RuleSet& ruleSet = sheet->ensureRuleSet(medium, addRuleFlags); addKeyframeRules(ruleSet); addFontFaceRules(ruleSet); addTreeBoundaryCrossingRules(ruleSet, &cssSheet, index); treeScope().document().styleResolver()->addMediaQueryResults(ruleSet.viewportDependentMediaQueryResults());}
开发者ID:kingysu,项目名称:blink-crosswalk,代码行数:13,
示例4: treeScope// getElementById on SVGSVGElement is restricted to only the child subtree defined by the <svg> element.// See http://www.w3.org/TR/SVG11/struct.html#InterfaceSVGSVGElementElement* SVGSVGElement::getElementById(const String& id){ Element* element = treeScope().getElementById(id); if (element && element->isDescendantOf(this)) return element; if (treeScope().containsMultipleElementsWithId(id)) { for (auto element : *treeScope().getAllElementsById(id)) { if (element->isDescendantOf(this)) return element; } } return nullptr;}
开发者ID:houzhenggang,项目名称:webkit,代码行数:15,
示例5: ASSERTvoid ContainerNode::parserAppendChild(PassRefPtr<Node> newChild){ ASSERT(newChild); ASSERT(!newChild->parentNode()); // Use appendChild if you need to handle reparenting (and want DOM mutation events). ASSERT(!newChild->isDocumentFragment());#if ENABLE(TEMPLATE_ELEMENT) ASSERT(!hasTagName(HTMLNames::templateTag));#endif if (&document() != &newChild->document()) document().adoptNode(newChild.get(), ASSERT_NO_EXCEPTION); { NoEventDispatchAssertion assertNoEventDispatch; // FIXME: This method should take a PassRefPtr. appendChildToContainer(newChild.get(), *this); treeScope().adoptIfNeeded(newChild.get()); } newChild->updateAncestorConnectedSubframeCountForInsertion(); ChildListMutationScope(*this).childAdded(*newChild); notifyChildInserted(*newChild, ChildChangeSourceParser); ChildNodeInsertionNotifier(*this).notify(*newChild); newChild->setNeedsStyleRecalc(ReconstructRenderTree);}
开发者ID:sinoory,项目名称:webv8,代码行数:29,
示例6: collectorvoid DocumentStyleSheetCollection::updateActiveStyleSheets(StyleEngine* engine, StyleResolverUpdateMode updateMode){ StyleSheetCollection collection; ActiveDocumentStyleSheetCollector collector(collection); collectStyleSheets(engine, collector); StyleSheetChange change; analyzeStyleSheetChange(updateMode, collection, change); if (change.styleResolverUpdateType == Reconstruct) { engine->clearMasterResolver(); // FIMXE: The following depends on whether StyleRuleFontFace was modified or not. // No need to always-clear font cache. engine->clearFontCache(); } else if (StyleResolver* styleResolver = engine->resolver()) { if (change.styleResolverUpdateType != Additive) { ASSERT(change.styleResolverUpdateType == Reset); styleResolver->resetAuthorStyle(treeScope()); engine->removeFontFaceRules(change.fontFaceRulesToRemove); styleResolver->removePendingAuthorStyleSheets(m_activeAuthorStyleSheets); styleResolver->lazyAppendAuthorStyleSheets(0, collection.activeAuthorStyleSheets()); } else { styleResolver->lazyAppendAuthorStyleSheets(m_activeAuthorStyleSheets.size(), collection.activeAuthorStyleSheets()); } } if (change.requiresFullStyleRecalc) document().setNeedsStyleRecalc(SubtreeStyleChange); collection.swap(*this); updateUsesRemUnits();}
开发者ID:krockot,项目名称:mojo,代码行数:32,
示例7: clearShadowTreevoid SVGUseElement::buildPendingResource(){ if (inUseShadowTree()) return; clearShadowTree(); cancelShadowTreeRecreation(); if (!referencedScope() || !inDocument()) return; AtomicString id; Element* target = SVGURIReference::targetElementFromIRIString(hrefString(), treeScope(), &id, externalDocument()); if (!target || !target->inDocument()) { // If we can't find the target of an external element, just give up. // We can't observe if the target somewhen enters the external document, nor should we do it. if (externalDocument()) return; if (id.isEmpty()) return; referencedScope()->document().accessSVGExtensions().addPendingResource(id, this); ASSERT(hasPendingResources()); return; } if (target->isSVGElement()) { buildShadowAndInstanceTree(toSVGElement(target)); invalidateDependentShadowTrees(); } ASSERT(!m_needsShadowTreeRecreation);}
开发者ID:astojilj,项目名称:chromium-crosswalk,代码行数:31,
示例8: requestvoid ScopedStyleResolver::collectMatchingTreeBoundaryCrossingRules(ElementRuleCollector& collector, CascadeOrder cascadeOrder){ for (const auto& rules : *m_treeBoundaryCrossingRuleSet) { MatchRequest request(rules->m_ruleSet.get(), &treeScope().rootNode(), rules->m_parentStyleSheet, rules->m_parentIndex); collector.collectMatchingRules(request, cascadeOrder, true); }}
开发者ID:astojilj,项目名称:chromium-crosswalk,代码行数:7,
示例9: dirAttributeChangedvoid HTMLElement::parseAttribute(const QualifiedName& name, const AtomicString& value){ if (isIdAttributeName(name) || name == classAttr || name == styleAttr) return Element::parseAttribute(name, value); if (name == dirAttr) dirAttributeChanged(value); else if (name == tabindexAttr) { int tabindex = 0; if (value.isEmpty()) { clearTabIndexExplicitlyIfNeeded(); if (treeScope().adjustedFocusedElement() == this) { // We might want to call blur(), but it's dangerous to dispatch // events here. document().setNeedsFocusedElementCheck(); } } else if (parseHTMLInteger(value, tabindex)) { // Clamp tabindex to the range of 'short' to match Firefox's behavior. setTabIndexExplicitly(max(static_cast<int>(std::numeric_limits<short>::min()), min(tabindex, static_cast<int>(std::numeric_limits<short>::max())))); } } else { const AtomicString& eventName = eventNameForAttributeName(name); if (!eventName.isNull()) setAttributeEventListener(eventName, createAttributeEventListener(this, name, value)); }}
开发者ID:Igalia,项目名称:blink,代码行数:26,
示例10: targetElementinline SVGElement* SVGSMILElement::eventBaseFor(const Condition& condition){ Element* eventBase = condition.baseID().isEmpty() ? targetElement() : treeScope().getElementById(AtomicString(condition.baseID())); if (eventBase && eventBase->isSVGElement()) return toSVGElement(eventBase); return nullptr;}
开发者ID:aobzhirov,项目名称:ChromiumGStreamerBackend,代码行数:7,
示例11: requestvoid ScopedStyleResolver::collectMatchingTreeBoundaryCrossingRules(ElementRuleCollector& collector, bool includeEmptyRules, CascadeOrder cascadeOrder){ RuleRange ruleRange = collector.matchedResult().ranges.authorRuleRange(); for (const auto& rules : *m_treeBoundaryCrossingRuleSet) { MatchRequest request(rules->m_ruleSet.get(), includeEmptyRules, &treeScope().rootNode(), rules->m_parentStyleSheet, rules->m_parentIndex); collector.collectMatchingRules(request, ruleRange, cascadeOrder, true); }}
开发者ID:kingysu,项目名称:blink-crosswalk,代码行数:8,
示例12: affectedByAttributeSelectorbool Element::affectedByAttributeSelector(const AtomicString& attributeName) const{ if (attributeName.isEmpty()) return false; if (treeScope().scopedStyleResolver().hasSelectorForAttribute(attributeName)) return true; return false;}
开发者ID:ksimbili,项目名称:sky_engine,代码行数:8,
示例13: affectedByIdSelectorbool Element::affectedByIdSelector(const AtomicString& idValue) const{ if (idValue.isEmpty()) return false; if (treeScope().scopedStyleResolver().hasSelectorForId(idValue)) return true; return false;}
开发者ID:ksimbili,项目名称:sky_engine,代码行数:8,
示例14: parentScopedStyleResolver* ScopedStyleResolver::parent() const{ for (TreeScope* scope = treeScope().parentTreeScope(); scope; scope = scope->parentTreeScope()) { if (ScopedStyleResolver* resolver = scope->scopedStyleResolver()) return resolver; } return nullptr;}
开发者ID:astojilj,项目名称:chromium-crosswalk,代码行数:8,
示例15: getIdAttributevoid Element::removedFrom(ContainerNode* insertionPoint){ if (insertionPoint->isInTreeScope() && treeScope() == document()) { const AtomicString& idValue = getIdAttribute(); if (!idValue.isNull()) updateId(insertionPoint->treeScope(), idValue, nullAtom); } ContainerNode::removedFrom(insertionPoint);}
开发者ID:ksimbili,项目名称:sky_engine,代码行数:10,
示例16: updateIdinline void Element::updateId(const AtomicString& oldId, const AtomicString& newId){ if (!isInTreeScope()) return; if (oldId == newId) return; updateId(treeScope(), oldId, newId);}
开发者ID:ksimbili,项目名称:sky_engine,代码行数:10,
示例17: treeScopePassRefPtrWillBeRawPtr<FilterEffect> SVGFEImageElement::build(SVGFilterBuilder*, Filter* filter){ if (m_cachedImage) { // Don't use the broken image icon on image loading errors. RefPtr<Image> image = m_cachedImage->errorOccurred() ? nullptr : m_cachedImage->image(); return FEImage::createWithImage(filter, image, m_preserveAspectRatio->currentValue()); } return FEImage::createWithIRIReference(filter, treeScope(), hrefString(), m_preserveAspectRatio->currentValue());}
开发者ID:astojilj,项目名称:chromium-crosswalk,代码行数:11,
示例18: contextMenuIdHTMLMenuElement* HTMLElement::contextMenu() const{ const AtomicString& contextMenuId(fastGetAttribute(contextmenuAttr)); if (contextMenuId.isNull()) return nullptr; Element* element = treeScope().getElementById(contextMenuId); // Not checking if the menu element is of type "popup". // Ignoring menu element type attribute is intentional according to the standard. return isHTMLMenuElement(element) ? toHTMLMenuElement(element) : nullptr;}
开发者ID:kingysu,项目名称:blink-crosswalk,代码行数:11,
示例19: treeScopeShadowRoot* InsertionPoint::assignedFrom() const{ Node* treeScopeRoot = treeScope()->rootNode(); if (!treeScopeRoot->isShadowRoot()) return 0; ShadowRoot* olderShadowRoot = toShadowRoot(treeScopeRoot)->olderShadowRoot(); if (olderShadowRoot && olderShadowRoot->assignedTo() == this) return olderShadowRoot; return 0;}
开发者ID:Moondee,项目名称:Artemis,代码行数:11,
示例20: treeScopeElement* DocumentFragment::getElementById(const AtomicString& id) const{ // Fast path for ShadowRoot, where we are both a DocumentFragment and a TreeScope. if (isTreeScope()) return treeScope().getElementById(id); // Otherwise, fall back to iterating all of the element descendants. for (auto& element : elementDescendants(*this)) { if (element.getIdAttribute() == id) return const_cast<Element*>(&element); } return nullptr;}
开发者ID:rhythmkay,项目名称:webkit,代码行数:14,
注:本文中的treeScope函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ tree_cons函数代码示例 C++ tree函数代码示例 |