本文整理汇总了C++中MediaQuery::ignored方法的典型用法代码示例。如果您正苦于以下问题:C++ MediaQuery::ignored方法的具体用法?C++ MediaQuery::ignored怎么用?C++ MediaQuery::ignored使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MediaQuery
的用法示例。
在下文中一共展示了MediaQuery::ignored方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: evalCheckingViewportDependentResults
bool MediaQueryEvaluator::evalCheckingViewportDependentResults(const MediaQuerySet* querySet, Vector<std::unique_ptr<MediaQueryResult>>& results)
{
if (!querySet)
return true;
auto& queries = querySet->queryVector();
if (!queries.size())
return true;
bool result = false;
for (size_t i = 0; i < queries.size() && !result; ++i) {
MediaQuery* query = queries[i].get();
if (query->ignored())
continue;
if (mediaTypeMatch(query->mediaType())) {
auto& expressions = query->expressions();
size_t j = 0;
for (; j < expressions.size(); ++j) {
bool exprResult = eval(expressions.at(j).get());
if (expressions.at(j)->isViewportDependent())
results.append(std::make_unique<MediaQueryResult>(*expressions.at(j), exprResult));
if (!exprResult)
break;
}
result = applyRestrictor(query->restrictor(), expressions.size() == j);
} else
result = applyRestrictor(query->restrictor(), false);
}
return result;
}
示例2: eval
bool MediaQueryEvaluator::eval(const MediaQuerySet* querySet, StyleResolver* styleResolver) const
{
if (!querySet)
return true;
const Vector<OwnPtr<MediaQuery> >& queries = querySet->queryVector();
if (!queries.size())
return true; // empty query list evaluates to true
// iterate over queries, stop if any of them eval to true (OR semantics)
bool result = false;
for (size_t i = 0; i < queries.size() && !result; ++i) {
MediaQuery* query = queries[i].get();
if (query->ignored())
continue;
if (mediaTypeMatch(query->mediaType())) {
const Vector<OwnPtr<MediaQueryExp> >* exps = query->expressions();
// iterate through expressions, stop if any of them eval to false
// (AND semantics)
size_t j = 0;
for (; j < exps->size(); ++j) {
bool exprResult = eval(exps->at(j).get());
if (styleResolver && exps->at(j)->isViewportDependent())
styleResolver->addViewportDependentMediaQueryResult(exps->at(j).get(), exprResult);
if (!exprResult)
break;
}
// assume true if we are at the end of the list,
// otherwise assume false
result = applyRestrictor(query->restrictor(), exps->size() == j);
} else
result = applyRestrictor(query->restrictor(), false);
}
return result;
}