File tree Expand file tree Collapse file tree 1 file changed +60
-0
lines changed
Expand file tree Collapse file tree 1 file changed +60
-0
lines changed Original file line number Diff line number Diff line change 11
2+ import {
3+ CSSCounterStyleRule ,
4+ CSSFontFaceRule ,
5+ CSSFontFeatureValuesRule ,
6+ CSSImportRule ,
7+ CSSKeyframeRule ,
8+ CSSKeyframesRule ,
9+ CSSMarginRule ,
10+ CSSMediaRule ,
11+ CSSNamespaceRule ,
12+ CSSPageRule ,
13+ CSSStyleRule ,
14+ CSSSupportsRule ,
15+ }
16+ from '../cssom/index.js'
17+
218/**
319 * @see {@link https://drafts.csswg.org/cssom-1/#cssrule }
420 */
@@ -14,4 +30,48 @@ export default class CSSRuleImpl {
1430 this . parentRule = parentRule
1531 this . parentStyleSheet = parentStyleSheet
1632 }
33+
34+ /**
35+ * @return {number }
36+ * @see {@link https://drafts.csswg.org/cssom-1/#dom-cssrule-type }
37+ */
38+ get type ( ) {
39+ if ( CSSStyleRule . isImpl ( this ) ) {
40+ return 1
41+ }
42+ if ( CSSImportRule . isImpl ( this ) ) {
43+ return 3
44+ }
45+ if ( CSSMediaRule . isImpl ( this ) ) {
46+ return 4
47+ }
48+ if ( CSSFontFaceRule . isImpl ( this ) ) {
49+ return 5
50+ }
51+ if ( CSSPageRule . isImpl ( this ) ) {
52+ return 6
53+ }
54+ if ( CSSKeyframesRule . isImpl ( this ) ) {
55+ return 7
56+ }
57+ if ( CSSKeyframeRule . isImpl ( this ) ) {
58+ return 8
59+ }
60+ if ( CSSMarginRule . isImpl ( this ) ) {
61+ return 9
62+ }
63+ if ( CSSNamespaceRule . isImpl ( this ) ) {
64+ return 10
65+ }
66+ if ( CSSCounterStyleRule . isImpl ( this ) ) {
67+ return 11
68+ }
69+ if ( CSSSupportsRule . isImpl ( this ) ) {
70+ return 12
71+ }
72+ if ( CSSFontFeatureValuesRule . isImpl ( this ) ) {
73+ return 14
74+ }
75+ return 0
76+ }
1777}
You can’t perform that action at this time.
0 commit comments