function matches (Component $component)
  {
    if ($this->matchTag && $this->matchTag !== $component->getTagName ())
      return false;
    if ($this->matchClass &&
        (!$component instanceof HtmlComponent || !preg_match ($this->matchClass, $component->props->class))
    )
      return false;
    if ($component->supportsProperties () && ($prop = $this->matchPropName)) {
      if (!$component->props->defines ($prop))
        return false;
      if ($this->matchPropValue !== '') {
        if ($component->props->$prop != $this->matchPropValue)
          return false;
      }
      else if (!exists ($component->props->$prop))
        return false;
    }
    return true;
  }