void 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())); }
CLuaSocketRestrictions::CLuaSocketRestrictions() { #ifndef TEST addRules(TCP_CONNECT, configHandler->GetString("TCPAllowConnect")); // addRules(TCP_LISTEN, configHandler->GetString("TCPAllowListen")); addRules(UDP_CONNECT, configHandler->GetString("UDPAllowConnect")); // addRules(UDP_LISTEN, configHandler->GetString("UDPAllowListen")); #endif }
void TreeBoundaryCrossingRules::addTreeBoundaryCrossingRules(const RuleSet& authorRules, ContainerNode& scopingNode, CSSStyleSheet* parentStyleSheet) { if (authorRules.treeBoundaryCrossingRules().isEmpty() && (scopingNode.isDocumentNode() || authorRules.shadowDistributedRules().isEmpty())) return; OwnPtrWillBeRawPtr<RuleSet> ruleSetForScope = RuleSet::create(); addRules(ruleSetForScope.get(), authorRules.treeBoundaryCrossingRules()); if (!scopingNode.isDocumentNode()) addRules(ruleSetForScope.get(), authorRules.shadowDistributedRules()); if (!m_treeBoundaryCrossingRuleSetMap.contains(&scopingNode)) { m_treeBoundaryCrossingRuleSetMap.add(&scopingNode, adoptPtrWillBeNoop(new CSSStyleSheetRuleSubSet())); m_scopingNodes.add(&scopingNode); } CSSStyleSheetRuleSubSet* ruleSubSet = m_treeBoundaryCrossingRuleSetMap.get(&scopingNode); ruleSubSet->append(std::make_pair(parentStyleSheet, ruleSetForScope.release())); }
void ScopedStyleResolver::addTreeBoundaryCrossingRules(const RuleSet& authorRules, CSSStyleSheet* parentStyleSheet, unsigned sheetIndex) { bool isDocumentScope = treeScope().rootNode().isDocumentNode(); if (authorRules.treeBoundaryCrossingRules().isEmpty() && (isDocumentScope || authorRules.shadowDistributedRules().isEmpty())) return; OwnPtrWillBeRawPtr<RuleSet> ruleSetForScope = RuleSet::create(); addRules(ruleSetForScope.get(), authorRules.treeBoundaryCrossingRules()); if (!isDocumentScope) addRules(ruleSetForScope.get(), authorRules.shadowDistributedRules()); if (!m_treeBoundaryCrossingRuleSet) { m_treeBoundaryCrossingRuleSet = adoptPtrWillBeNoop(new CSSStyleSheetRuleSubSet()); treeScope().document().styleResolver()->addTreeBoundaryCrossingScope(treeScope().rootNode()); } m_treeBoundaryCrossingRuleSet->append(RuleSubSet::create(parentStyleSheet, sheetIndex, ruleSetForScope.release())); }
MRule* MConfig::findMatchingRule( WFileName& fn, MRule* tgtRule, WString& mask ) { WVList list; WVList& symbols = tgtRule->symbols(); int icount = symbols.count(); for( int i=0; i<icount; i++ ) { MSymbol& sym = *(MSymbol*)symbols[i]; addRules( fn, sym.mask(), list, mask ); if( list.count() > 0 ) { return( (MRule*)list[0] ); } } return( nilRule() ); }
Database::Database(DatalogProgram* p) { parser = p; std::vector<Scheme*> svec = parser->sl->svec; for (int i = 0; i < svec.size(); i++) { //Loop through the list of schemes Token* name = svec.at(i)->first; std::vector<Token*> schema = svec.at(i)->idl; Relation* r = new Relation(name, schema); //Create a new relation with the name and attributes of each scheme addRelation(r); //Add the relation to the database } addTuples(); //Populate the database addRules(); //Add the rules to the database g = new Graph(rules); //Generate a depends-on graph for the rules //processRules(); //Generate new facts }
/*! Sets to deny a user with the identity \a identityKey to access to the actions \a actions. */ void TAccessValidator::setDenyUser(const QString &identityKey, const QStringList &actions) { addRules(AccessRule::User, identityKey, actions, false); }
/*! Sets to allow a user with the identity \a identityKey to access to the actions \a actions. */ void TAccessValidator::setAllowUser(const QString &identityKey, const QStringList &actions) { addRules(AccessRule::User, identityKey, actions, true); }
/*! Sets to deny a group with \a groupKey to access to the actions \a actions. */ void TAccessValidator::setDenyGroup(const QString &groupKey, const QStringList &actions) { addRules(AccessRule::Group, groupKey, actions, false); }
/*! Sets to allow a group with \a groupKey to access to the actions \a actions. */ void TAccessValidator::setAllowGroup(const QString &groupKey, const QStringList &actions) { addRules(AccessRule::Group, groupKey, actions, true); }
/*! Sets to deny an unauthenticated with the identity \a identityKey to access to the actions \a actions. */ void TAccessValidator::setDenyUnauthenticatedUser(const QStringList &actions) { addRules(AccessRule::UnauthenticatedUser, QString(), actions, false); }
/*! Sets to allow an unauthenticated with the identity \a identityKey to access to the actions \a actions. */ void TAccessValidator::setAllowUnauthenticatedUser(const QStringList &actions) { addRules(AccessRule::UnauthenticatedUser, QString(), actions, true); }