JavaScript is disabled on your browser.
Skip navigation links
org.htmlunit.css

Class StyleElement

  • All Implemented Interfaces:
    Serializable


    public class StyleElement
    extends Object
    implements Serializable 
    INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
    Contains information about a single style element, including its name, its value, and an index which can be compared against other indices in order to determine precedence.
    Author:
    Mike Bowler, Christian Sell, Daniel Gredler, Chris Erskine, Ahmed Ashour, Rodney Gitzel, Sudhan Moghe, Ronald Brill, Frank Danek
    See Also:
    Serialized Form
    • Field Detail

    • Constructor Detail

      • StyleElement

        public StyleElement(String name,
         String value,
         String priority,
         org.htmlunit.cssparser.parser.selector.SelectorSpecificity specificity,
         long index)
        Creates a new instance.
        Parameters:
        name - the style element's name
        value - the style element's value
        priority - the style element's priority like "important"
        specificity - the specificity of the rule providing this style information
        index - the style element's index
      • StyleElement

        public StyleElement(String name,
         String value,
         String priority,
         org.htmlunit.cssparser.parser.selector.SelectorSpecificity specificity)
        Creates a new instance.
        Parameters:
        name - the style element's name
        value - the style element's value
        priority - the style element's priority like "important"
        specificity - the specificity of the rule providing this style information
    • Method Detail

      • getName

        public String getName()
        Returns the style element's name.
        Returns:
        the style element's name
      • getValue

        public String getValue()
        Returns the style element's value.
        Returns:
        the style element's value
      • getPriority

        public String getPriority()
        Returns the style element's priority.
        Returns:
        the style element's priority
      • isImportant

        public boolean isImportant()
        Returns:
        true if priority is 'important'
      • getIndex

        public long getIndex()
        Returns the style element's index.
        Returns:
        the style element's index
      • compareToByImportanceAndSpecificity

        public static int compareToByImportanceAndSpecificity(StyleElement first,
         StyleElement second)
        This takes only the importance, the specificity and the index into account. The name and value properties are ignored.
        Parameters:
        first - the StyleElement to compare
        second - the StyleElement to compare with
        Returns:
        a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
Skip navigation links

Copyright © 2002–2025 Gargoyle Software Inc.. All rights reserved.

AltStyle によって変換されたページ (->オリジナル) /