Class: Browser::CSS::Rule
Direct Known Subclasses
Style
Defined Under Namespace
Classes: Style
Constant Summary
collapse
- STYLE_RULE =
1
- CHARSET_RULE =
2
- IMPORT_RULE =
3
- MEDIA_RULE =
4
- FONT_FACE_RULE =
5
- PAGE_RULE =
6
- KEYFRAMES_RULE =
7
- KEYFRAME_RULE =
8
- NAMESPACE_RULE =
10
- COUNTER_STYLE_RULE =
11
- SUPPORTS_RULE =
12
- DOCUMENT_RULE =
13
- FONT_FEATURE_VALUES_RULE =
14
- VIEWPORT_RULE =
15
- REGION_STYLE_RULE =
16
Class Method Summary
collapse
Instance Method Summary
collapse
#restricted?, #set_native_reference
Class Method Details
.new(rule) ⇒ Object
23
24
25
26
27
28
29
30
31
32
33
34
35
|
# File 'opal/browser/css/rule.rb', line 23
def self.new(rule)
if self == Rule
@classes ||= [nil, Style]
if klass = @classes[`rule.type`]
klass.new(rule)
else
raise ArgumentError, 'cannot instantiate a non derived Rule object'
end
else
super(rule)
end
end
|
Instance Method Details
40
41
42
|
# File 'opal/browser/css/rule.rb', line 40
def parent
Rule.new(`#@native.parentRule`) if `#@native.parentRule != null`
end
|
#style_sheet ⇒ Object
44
45
46
|
# File 'opal/browser/css/rule.rb', line 44
def style_sheet
StyleSheet.new(`#@native.parentStyleSheet`) if `#@native.parentStyleSheet != null`
end
|