RESOLVED FIXED99843
Maintain a list of active CSS stylesheets
https://bugs.webkit.org/show_bug.cgi?id=99843
Summary Maintain a list of active CSS stylesheets
Antti Koivisto
Reported 2012-10-19 08:39:22 PDT
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.
Attachments
patch (14.85 KB, patch)
2012-10-19 11:14 PDT, Antti Koivisto
kling: review+
Glenn Adams
Comment 1 2012-10-19 08:59:43 PDT
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.
Antti Koivisto
Comment 2 2012-10-19 11:14:44 PDT
Andreas Kling
Comment 3 2012-10-19 11:59:46 PDT
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.
Antti Koivisto
Comment 4 2012-10-19 12:18:35 PDT
Note You need to log in before you can comment on or make changes to this bug.