code: public SanitizedContent knownDirAttrSanitized(Dir dir) {
      Preconditions.checkNotNull(dir);
      if (dir != contextDir) {
        switch (dir) {
          case LTR:
            return LTR_DIR;
          case RTL:
            return RTL_DIR;
          case NEUTRAL:
            // fall out.
        }
      }
      return NEUTRAL_DIR;
    }
docs: Returns "dir=\"ltr\"" or "dir=\"rtl\"", depending on the given directionality, if it is not
  NEUTRAL or the same as the context directionality. Otherwise, returns "".
  
  @param dir Given directionality. Must not be null.
  @return "dir=\"rtl\"" for RTL text in non-RTL context; "dir=\"ltr\"" for LTR text in non-LTR
  context; else, the empty string.