Class CSSUtil

java.lang.Object
io.sf.carte.doc.style.css.impl.CSSUtil

public class CSSUtil extends Object
Utility methods related to CSS.
  • Constructor Details

    • CSSUtil

      public CSSUtil()
  • Method Details

    • isValidIdentifier

      public static boolean isValidIdentifier(CharSequence s)
      Is the given string a valid CSS identifier?
      Parameters:
      s - the non-empty identifier to test; cannot contain hex escapes.
      Returns:
      true if is a valid identifier.
    • isValidPseudoName

      public static boolean isValidPseudoName(CharSequence s)
      Is the given string a valid CSS pseudo-element/class name?
      Parameters:
      s - the non-empty name to test; cannot contain escapes.
      Returns:
      true if is a valid name.
    • isInvalidCSSContentType

      public static boolean isInvalidCSSContentType(URL url, String conType)
      Check whether the given content-type is invalid for the provided URL pointing to a style sheet.
      Parameters:
      url - the URL.
      conType - the content-type.
      Returns:
      true if the content-type is invalid for a CSS style sheet.
    • isUnimplementedImageFunction

      public static boolean isUnimplementedImageFunction(String lcfName)
      Check whether the given function name is a proposed image function that was not yet implemented in browsers at the time of last revision.

      This method helps the library in processing image functions that had not been implemented by browsers when it was released.

      Parameters:
      lcfName - the lower-case name of the function.
      Returns:
      true if the name is an unimplemented proposed image function.
    • matchEnv

      public static CSSValueSyntax.Match matchEnv(CSSValueSyntax rootSyntax, CSSValueSyntax syntax, String name, LexicalUnit fallback)
      Match an environment variable.
    • isEnvLengthName

      public static boolean isEnvLengthName(String name)