MCPcopy Create free account
hub / github.com/Stranger6667/css-inline / stylesheets

Method stylesheets

css-inline/src/html/document.rs:127–133  ·  view source on GitHub ↗

Iterate over `href` attribute values of `link[rel~=stylesheet]` tags.

(&self)

Source from the content-addressed store, hash-verified

125
126 /// Iterate over `href` attribute values of `link[rel~=stylesheet]` tags.
127 pub(crate) fn stylesheets(&self) -> impl Iterator<Item = &str> + '_ {
128 self.linked_stylesheets.iter().filter_map(|node_id| {
129 self[*node_id]
130 .as_element()
131 .and_then(|data| data.attributes.get(local_name!("href")))
132 })
133 }
134
135 /// Add a new linked stylesheet location.
136 pub(super) fn add_linked_stylesheet(&mut self, node: NodeId) {

Callers 2

inline_to_implMethod · 0.80
test_collect_stylesheetsFunction · 0.80

Calls 3

iterMethod · 0.80
as_elementMethod · 0.45
getMethod · 0.45

Tested by 1

test_collect_stylesheetsFunction · 0.64