/// Return whether a script element's nonce is safe to use for CSP matching. /// /// CSP rejects nonces on parser elements with duplicate attributes or with an /// attribute name/value containing `( nonce: Option<&str>, had_duplicate_attributes: bool, attributes: impl IntoIterator, ) -> bool { nonce.is_some() && !had_duplicate_attributes && attributes.into_iter().all(|(name, value)| { !contains_nonce_breaking_markup(name) && !contains_nonce_breaking_markup(value) }) } fn contains_nonce_breaking_markup(value: &str) -> bool { [ b"