cssmanager: Simplify iteration over style sheets

This commit is contained in:
Richard Hansen 2021-03-19 15:48:31 -04:00 committed by John McLear
parent cb9f6d6776
commit 5b05ee79ff

View file

@ -40,13 +40,8 @@ const makeCSSManager = (emptyStylesheetTitle, doc) => {
} else { } else {
throw new Error('Unknown dynamic style container'); throw new Error('Unknown dynamic style container');
} }
const allSheets = win.document.styleSheets; for (const s of win.document.styleSheets) {
if (s.title === title) return s;
for (let i = 0; i < allSheets.length; i++) {
const s = allSheets[i];
if (s.title === title) {
return s;
}
} }
return null; return null;
}; };