Class CssPseudoClassNode
- All Implemented Interfaces:
Locatable
CssRefinerNode implementation that represents a pseudo-class.
For example: :visited, :nth-child(2n)-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumDetermines if the pseudo-class is a function and if so which one.Nested classes/interfaces inherited from class com.google.common.css.compiler.ast.CssRefinerNode
CssRefinerNode.Refiner -
Field Summary
Fields inherited from class com.google.common.css.compiler.ast.CssRefinerNode
refinerName, refinerType -
Constructor Summary
ConstructorsConstructorDescriptionCssPseudoClassNode(CssPseudoClassNode.FunctionType functionType, String name, String argument, SourceCodeLocation sourceCodeLocation) Constructor for function pseudo-classes except the negation function like:lang(en)or:nth-child(2n).CssPseudoClassNode(String name, CssSelectorNode notSelector, SourceCodeLocation sourceCodeLocation) Constructor for the negation function pseudo-class.CssPseudoClassNode(String name, SourceCodeLocation sourceCodeLocation) Constructor for non-function pseudo-classes like:linkor:visited -
Method Summary
Modifier and TypeMethodDescriptiondeepCopy()Returns the specificity of this pseudo-class or an old pseudo-element starting with a single colon.voidsetArgument(String argument) toString()This is the default implementation oftoString().Methods inherited from class com.google.common.css.compiler.ast.CssRefinerNode
getPrefix, getRefinerName, getRefinerType, getSuffixMethods inherited from class com.google.common.css.compiler.ast.CssNode
ancestors, appendComment, deepCopyNodes, equals, getComments, getParent, getShouldBeFlipped, getSourceCodeLocation, getVisitController, hasComment, hashCode, inFunArgs, setComments, setShouldBeFlipped, setSourceCodeLocation
-
Constructor Details
-
CssPseudoClassNode
Constructor for non-function pseudo-classes like:linkor:visited -
CssPseudoClassNode
public CssPseudoClassNode(CssPseudoClassNode.FunctionType functionType, String name, String argument, SourceCodeLocation sourceCodeLocation) Constructor for function pseudo-classes except the negation function like:lang(en)or:nth-child(2n). -
CssPseudoClassNode
public CssPseudoClassNode(String name, CssSelectorNode notSelector, SourceCodeLocation sourceCodeLocation) Constructor for the negation function pseudo-class. -
CssPseudoClassNode
-
-
Method Details
-
deepCopy
-
getFunctionType
-
getArgument
-
setArgument
-
getNotSelector
-
getSpecificity
Returns the specificity of this pseudo-class or an old pseudo-element starting with a single colon.The :: notation for pseudo-elements is introduced in CSS level 3 in order to establish a discrimination between pseudo-classes and pseudo-elements. "For compatibility with existing style sheets, user agents must also accept the previous one-colon notation for pseudo-elements introduced in CSS levels 1 and 2 (namely, :first-line, :first-letter, :before and :after). This compatibility is not allowed for the new pseudo-elements introduced in this specification." http://www.w3.org/TR/css3-selectors/#target-pseudo
The negation pseudo-class itself does not influence the specificity. However, selectors inside the negation pseudo-class are counted like any other. Thus,
red.levelhas the same specificity as*:not(red.level).- Specified by:
getSpecificityin classCssRefinerNode
-
toString
Description copied from class:CssNodeThis is the default implementation oftoString().Overriding this method should only be done for debugging or logging purposes, not for the actual functionality of the compiler. If a string representation of a tree is needed, define a Visitor that builds the desired representation.
- Overrides:
toStringin classCssRefinerNode- See Also:
-