This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 27387 - CSSStyleSheet rules, addRule, removeRule
Summary: CSSStyleSheet rules, addRule, removeRule
Status: NEW
Alias: None
Product: CSS
Classification: Unclassified
Component: CSSOM (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Simon Pieters
QA Contact: public-css-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-21 11:02 UTC by Simon Pieters
Modified: 2014-11-24 10:32 UTC (History)
1 user (show)

See Also:


Attachments

Description Simon Pieters 2014-11-21 11:02:47 UTC
IE/WebKit/Blink have the following members of CSSStyleSheet:

rules
addRule()
removeRule()

Use counters:
rules ~0.2%
https://www.chromestatus.com/metrics/feature/timeline/popularity/219
addRule() ~0.1%
https://www.chromestatus.com/metrics/feature/timeline/popularity/220
removeRule() ~0.002%
https://www.chromestatus.com/metrics/feature/timeline/popularity/221
Comment 1 Philip J├Ągenstedt 2014-11-24 10:32:06 UTC
Yep, I added these use counters and was sad to see the results.

In Blink, removeRule is just an alias of deleteRule, so that's trivial.

addRule just does some concatenation and forwards to insertRule, so that's fairly trivial too.

rules seems to be like cssRules, but it excludes @charset rules. If we can get rid of @charset, it can presumably be made an alias of cssRules.

Data on how these are used in the wild would of course be great.