示例#1
0
DisplayObject*
DisplayList::getDisplayObjectByName(const std::string& name)
{
    testInvariant();

    const container_type::iterator e = _charsByDepth.end();

    container_type::const_iterator it =
        std::find_if( _charsByDepth.begin(), e, NameEquals(name));

    if (it == e) return 0;
    
    return *it;

}
示例#2
0
DisplayObject*
DisplayList::getDisplayObjectByName(string_table& st, const ObjectURI& uri,
        bool caseless) const
{
    testInvariant();

    const container_type::const_iterator e = _charsByDepth.end();

    container_type::const_iterator it =
        std::find_if(_charsByDepth.begin(), e, NameEquals(st, uri, caseless));

    if (it == e) return 0;
    
    return *it;

}
示例#3
0
BrowsingContext* BrowsingContext::FindWithNameInSubtree(
    const nsAString& aName, BrowsingContext* aRequestingContext) {
  MOZ_DIAGNOSTIC_ASSERT(!aName.IsEmpty());

  if (NameEquals(aName) && aRequestingContext->CanAccess(this) && IsActive()) {
    return this;
  }

  for (BrowsingContext* child : mChildren) {
    if (BrowsingContext* found =
            child->FindWithNameInSubtree(aName, aRequestingContext)) {
      return found;
    }
  }

  return nullptr;
}