1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
use Namespace;
/// Context for compiling CSS selectors.
///
/// This struct holds configuration that affects how selectors are parsed and matched.
/// Currently, it provides namespace prefix mappings for namespace-aware selector matching.
///
/// **Note:** While `SelectorContext` is always available for API consistency, namespace-related
/// features (prefix mappings and default namespace) only have an effect when the `namespaces`
/// feature is enabled. Without the feature, namespace prefixes in selectors will fail to match.
///
/// # Examples
///
/// Basic usage (requires `namespaces` feature):
///
/// ```
/// #[cfg(feature = "namespaces")]
/// {
/// use brik::SelectorContext;
/// use html5ever::ns;
///
/// let mut context = SelectorContext::new();
/// context.add_namespace("svg".to_string(), ns!(svg));
/// context.set_default_namespace(ns!(html));
/// }
/// ```