Currently we maintain a per-document list of stylesheets that matches what is returned by the StyleSheetList DOM API. This list contains both CSS and XSLT stylesheets which internally have basically nothing in common. Maintaining a list of active CSS stylesheets separately simplifies code in number of places.
I wonder if the code shouldn't maintain (internally) two separate lists, one for CSS, another for XSLT, and then simply merge them when returning a list from CSS OM. Since there are no (external) add/remove operators on an OM returned list, then it could simply be a copy, rather than live, yes? Note that in CSS OM ED, at least at the moment, there is no instance of StyleSheet that is not a CSSStyleSheet; i.e., it doesn't explicitly define (or preclude) another concrete flavor of StyleSheet.
Created attachment 169654 [details] patch
Comment on attachment 169654 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=169654&action=review Yup, this is nicer. > Source/WebCore/css/StyleResolver.cpp:408 > -void StyleResolver::appendAuthorStylesheets(unsigned firstNew, const Vector<RefPtr<StyleSheet> >& stylesheets) > +void StyleResolver::appendAuthorStylesheets(unsigned firstNew, const Vector<RefPtr<CSSStyleSheet> >& styleSheets) Stylesheets vs styleSheets in function name vs parameter name.
http://trac.webkit.org/changeset/131929