Bug 99843 - Maintain a list of active CSS stylesheets
Summary: Maintain a list of active CSS stylesheets
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-19 08:39 PDT by Antti Koivisto
Modified: 2012-10-19 12:18 PDT (History)
7 users (show)

See Also:


Attachments
patch (14.85 KB, patch)
2012-10-19 11:14 PDT, Antti Koivisto
kling: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Antti Koivisto 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.
Comment 1 Glenn Adams 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.
Comment 2 Antti Koivisto 2012-10-19 11:14:44 PDT
Created attachment 169654 [details]
patch
Comment 3 Andreas Kling 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.
Comment 4 Antti Koivisto 2012-10-19 12:18:35 PDT
http://trac.webkit.org/changeset/131929