Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/andybalholm/cascadia
/ functions
Functions
151 in github.com/andybalholm/cascadia
⨍
Functions
151
◇
Types & classes
32
↓ 14 callers
Method
Match
(n *html.Node)
selector.go:14
↓ 11 callers
Function
matchAttribute
matches elements where the attribute named key satisifes the function f.
selector.go:310
↓ 9 callers
Method
String
Returns a CSS input compiling to this selector.
selector.go:23
↓ 6 callers
Method
skipWhitespace
skipWhitespace consumes whitespace characters and comments. It returns true if there was actually anything to skip.
parser.go:256
↓ 5 callers
Method
Specificity
()
selector.go:20
↓ 5 callers
Function
hasAttr
(n *html.Node, attr string)
pseudo_classes.go:356
↓ 5 callers
Method
parseIdentifier
parseIdentifier parses an identifier.
parser.go:100
↓ 5 callers
Function
toLowerASCII
toLowerASCII returns s with all ASCII capital letters lowercased.
parser.go:63
↓ 4 callers
Method
MatchAll
MatchAll returns a slice of the nodes that match the selector, from n and its children.
selector.go:122
↓ 4 callers
Function
matchInsensitiveValue
matches elements where we ignore (or not) the case of the attribute value the user attribute is the value set by the user to match elements the real a
selector.go:301
↓ 4 callers
Function
nodeString
(n *html.Node)
selector_test.go:33
↓ 3 callers
Function
Compile
Compile parses a selector and returns, if successful, a Selector object that can be used to match against html.Node objects.
selector.go:102
↓ 3 callers
Function
ParseGroup
ParseGroup parses a selector, or a group of selectors separated by commas. Use `ParseGroupWithPseudoElements` if you need support for pseudo-elements.
selector.go:64
↓ 3 callers
Function
ParseGroupWithPseudoElements
ParseGroupWithPseudoElements parses a selector, or a group of selectors separated by commas. It supports pseudo-elements.
selector.go:80
↓ 3 callers
Method
PseudoElement
Returns a pseudo-element, or an empty string.
selector.go:26
↓ 3 callers
Method
parseName
parseName parses a name (which is like an identifier, but doesn't have extra restrictions on the first character).
parser.go:126
↓ 3 callers
Method
parseSelector
parseSelector parses a selector that may include combinators.
parser.go:829
↓ 3 callers
Method
parseSelectorGroup
parseSelectorGroup parses a group of selectors, separated by commas.
parser.go:873
↓ 3 callers
Method
parseString
parseString parses a single- or double-quoted string.
parser.go:160
↓ 2 callers
Method
Add
(other Specificity)
specificity.go:21
↓ 2 callers
Method
Less
returns `true` if s < other (strictly), false otherwise
specificity.go:9
↓ 2 callers
Function
Parse
Parse parses a selector. Use `ParseWithPseudoElement` if you need support for pseudo-elements.
selector.go:31
↓ 2 callers
Function
escape
espace special CSS char
serialize.go:22
↓ 2 callers
Function
inDisabledFieldset
(n *html.Node)
pseudo_classes.go:429
↓ 2 callers
Function
loadValidSelectors
(t *testing.T)
w3_test.go:60
↓ 2 callers
Function
matchInclude
returns true if s is a whitespace-separated list that includes val.
selector.go:337
↓ 2 callers
Function
nodeOwnText
nodeOwnText returns the contents of the text nodes that are direct children of n.
pseudo_classes.go:147
↓ 2 callers
Function
nodeText
nodeText returns the text contained in n and its descendants.
pseudo_classes.go:139
↓ 2 callers
Method
parseEscape
parseEscape parses a backslash escape.
parser.go:24
↓ 2 callers
Function
parseReference
(filename string)
w3_test.go:31
↓ 2 callers
Method
parseRegex
parseRegex parses a regular expression; the end is defined by encountering an unmatched closing ')' or ']' which is not consumed
parser.go:222
↓ 1 callers
Method
Filter
Filter returns the nodes in nodes that match the selector.
selector.go:191
↓ 1 callers
Method
Match
Match returns true if the node matches the selector.
selector.go:156
↓ 1 callers
Method
MatchFirst
MatchFirst returns the first node that matches s, from n and its children.
selector.go:161
↓ 1 callers
Function
MustCompile
MustCompile is like Compile, but panics instead of returning an error.
selector.go:112
↓ 1 callers
Function
MustParseHTML
(doc string)
benchmark_test.go:10
↓ 1 callers
Function
ParseWithPseudoElement
ParseWithPseudoElement parses a single selector, with support for pseudo-element.
selector.go:47
↓ 1 callers
Function
Query
Query returns the first node that matches m, from the descendants of n. If none matches, it returns nil.
selector.go:177
↓ 1 callers
Function
QueryAll
QueryAll returns a slice of all the nodes that match m, from the descendants of n.
selector.go:151
↓ 1 callers
Function
attributeDashMatch
matches elements where the attribute named key equals val or starts with val plus a hyphen.
selector.go:352
↓ 1 callers
Function
attributeNotEqualMatch
attributeNotEqualMatch matches elements where the attribute named key does not have the value val.
selector.go:324
↓ 1 callers
Function
attributePrefixMatch
attributePrefixMatch returns a Selector that matches elements where the attribute named key starts with val.
selector.go:370
↓ 1 callers
Function
attributeRegexMatch
attributeRegexMatch matches nodes where the attribute named key matches the regular expression rx
selector.go:415
↓ 1 callers
Function
attributeSubstringMatch
attributeSubstringMatch matches nodes where the attribute named key contains val.
selector.go:400
↓ 1 callers
Function
attributeSuffixMatch
attributeSuffixMatch matches elements where the attribute named key ends with val.
selector.go:385
↓ 1 callers
Function
childMatch
matches an element if it matches d and its parent matches a.
selector.go:526
↓ 1 callers
Method
consumeClosingParenthesis
consumeClosingParenthesis consumes a closing parenthesis and any preceding whitespace. It returns true if there was actually a parenthesis to skip.
parser.go:296
↓ 1 callers
Method
consumeParenthesis
consumeParenthesis consumes an opening parenthesis and any following whitespace. It returns true if there was actually a parenthesis to skip.
parser.go:285
↓ 1 callers
Function
descendantMatch
matches an element if it matches d and has an ancestor that matches a.
selector.go:511
↓ 1 callers
Function
getId
(n *html.Node)
w3_test.go:43
↓ 1 callers
Function
hasChildMatch
hasChildMatch returns whether n has any child that matches a.
pseudo_classes.go:51
↓ 1 callers
Function
hasDescendantMatch
hasDescendantMatch performs a depth-first search of n's descendants, testing whether any of them match a. It returns true as soon as a match is found,
pseudo_classes.go:63
↓ 1 callers
Function
hasLegendInPreviousSiblings
(n *html.Node)
pseudo_classes.go:420
↓ 1 callers
Function
hexDigit
(c byte)
parser.go:82
↓ 1 callers
Function
isEqual
(m map[string]int, l []string)
w3_test.go:52
↓ 1 callers
Method
matchAllInto
(n *html.Node, storage []*html.Node)
selector.go:126
↓ 1 callers
Function
nameChar
nameChar returns whether c can be a character within an identifier (not counting an escape sequence).
parser.go:94
↓ 1 callers
Function
nameStart
nameStart returns whether c can be the first character of an identifier (not counting an initial hyphen, or an escape sequence).
parser.go:88
↓ 1 callers
Function
nthChildMatch
nthChildMatch implements :nth-child(an+b). If last is true, implements :nth-last-child instead. If ofType is true, implements :nth-of-type instead.
pseudo_classes.go:177
↓ 1 callers
Method
parseAttributeSelector
parseAttributeSelector parses a selector that matches by attribute value.
parser.go:353
↓ 1 callers
Method
parseClassSelector
parseClassSelector parses a selector that matches by class attribute.
parser.go:335
↓ 1 callers
Method
parseIDSelector
parseIDSelector parses a selector that matches by id attribute.
parser.go:317
↓ 1 callers
Method
parseInteger
parseInteger parses a decimal integer.
parser.go:613
↓ 1 callers
Method
parseNth
parseNth parses the argument for :nth-child (normally of the form an+b).
parser.go:633
↓ 1 callers
Method
parsePseudoclassSelector
parsePseudoclassSelector parses a pseudoclass selector like :not(p) or a pseudo-element For backwards compatibility, both ':' and '::' prefix are allo
parser.go:451
↓ 1 callers
Method
parseSimpleSelectorSequence
parseSimpleSelectorSequence parses a selector sequence that applies to a single element.
parser.go:755
↓ 1 callers
Method
parseTypeSelector
parseTypeSelector parses a type selector (one that matches by tag name).
parser.go:308
↓ 1 callers
Function
queryInto
(n *html.Node, m Matcher, storage []*html.Node)
selector.go:138
↓ 1 callers
Function
setup
(selector, testHTML string)
selector_test.go:795
↓ 1 callers
Function
setupMatcher
(selector, testHTML string)
selector_test.go:843
↓ 1 callers
Function
setupSel
(selector, HTML string)
specificity_test.go:86
↓ 1 callers
Function
siblingMatch
matches an element if it matches s2 and is preceded by an element that matches s1. If adjacent is true, the sibling must be immediately before the ele
selector.go:532
↓ 1 callers
Function
simpleNthChildMatch
simpleNthChildMatch implements :nth-child(b). If ofType is true, implements :nth-of-type instead.
pseudo_classes.go:221
↓ 1 callers
Function
simpleNthLastChildMatch
simpleNthLastChildMatch implements :nth-last-child(b). If ofType is true, implements :nth-last-of-type instead.
pseudo_classes.go:249
↓ 1 callers
Function
writeNodeText
writeNodeText writes the text contained in n and its descendants to b.
pseudo_classes.go:127
Function
BenchmarkMatchAll
(b *testing.B)
benchmark_test.go:47
Function
Filter
Filter returns the nodes that match m.
selector.go:201
Function
Fuzz
Fuzz is the entrypoint used by the go-fuzz framework
fuzz/fuzz.go:6
Method
Match
Matches elements with a given tag name.
selector.go:215
Method
Match
Matches elements by class attribute.
selector.go:232
Method
Match
Matches elements by id attribute.
selector.go:251
Method
Match
Matches elements by attribute value.
selector.go:272
Method
Match
(n *html.Node)
selector.go:437
Method
Match
Matches elements if each sub-selectors matches.
selector.go:455
Method
Match
(n *html.Node)
selector.go:490
Method
Match
Match returns true if the node matches one of the single selectors.
selector.go:579
Method
Match
(n *html.Node)
pseudo_classes.go:31
Method
Match
(n *html.Node)
pseudo_classes.go:96
Method
Match
(n *html.Node)
pseudo_classes.go:114
Method
Match
(n *html.Node)
pseudo_classes.go:163
Method
Match
Match implements :only-child. If `ofType` is true, it implements :only-of-type instead.
pseudo_classes.go:282
Method
Match
Matches input, select, textarea and button elements.
pseudo_classes.go:311
Method
Match
Matches empty elements.
pseudo_classes.go:320
Method
Match
Match implements :root
pseudo_classes.go:346
Method
Match
Match implements :link
pseudo_classes.go:365
Method
Match
(n *html.Node)
pseudo_classes.go:374
Method
Match
(n *html.Node)
pseudo_classes.go:388
Method
Match
(n *html.Node)
pseudo_classes.go:407
Method
Match
(n *html.Node)
pseudo_classes.go:444
Method
PseudoElement
()
selector.go:223
next →
1–100 of 151, ranked by callers