function extractAttributesInStylesheet(stylesheet) {
  const attributesInStylesheet = new Set();

  stylesheet.rules.forEach((rule) => {
    const selectors = csswhat.parse(rule.selector);
    selectors.forEach((subselector) => {
      subselector.forEach((segment) => {
        if (segment.type !== 'attribute') {
          return;
        }

        attributesInStylesheet.add(segment.name);
      });
    });
  });

  return attributesInStylesheet;
}
@param {import('../lib/types.js').Stylesheet} stylesheet
@returns {Set<string>}