mirror of
https://github.com/servo/servo
synced 2026-04-30 11:27:28 +02:00
script: Use snakecase for variables in CSS implementation files (#42558)
Use snakecase to be consistent. Also these names are normally quite long already. Testing: Just renaming. --------- Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
This commit is contained in:
@@ -23,21 +23,21 @@ use crate::script_runtime::CanGc;
|
||||
|
||||
#[dom_struct]
|
||||
pub(crate) struct CSSGroupingRule {
|
||||
cssrule: CSSRule,
|
||||
rulelist: MutNullableDom<CSSRuleList>,
|
||||
css_rule: CSSRule,
|
||||
rule_list: MutNullableDom<CSSRuleList>,
|
||||
}
|
||||
|
||||
impl CSSGroupingRule {
|
||||
pub(crate) fn new_inherited(parent_stylesheet: &CSSStyleSheet) -> CSSGroupingRule {
|
||||
CSSGroupingRule {
|
||||
cssrule: CSSRule::new_inherited(parent_stylesheet),
|
||||
rulelist: MutNullableDom::new(None),
|
||||
css_rule: CSSRule::new_inherited(parent_stylesheet),
|
||||
rule_list: MutNullableDom::new(None),
|
||||
}
|
||||
}
|
||||
|
||||
fn rulelist(&self, can_gc: CanGc) -> DomRoot<CSSRuleList> {
|
||||
let parent_stylesheet = self.upcast::<CSSRule>().parent_stylesheet();
|
||||
self.rulelist.or_init(|| {
|
||||
self.rule_list.or_init(|| {
|
||||
let rules = if let Some(rule) = self.downcast::<CSSConditionRule>() {
|
||||
rule.clone_rules()
|
||||
} else if let Some(rule) = self.downcast::<CSSLayerBlockRule>() {
|
||||
@@ -57,11 +57,11 @@ impl CSSGroupingRule {
|
||||
}
|
||||
|
||||
pub(crate) fn parent_stylesheet(&self) -> &CSSStyleSheet {
|
||||
self.cssrule.parent_stylesheet()
|
||||
self.css_rule.parent_stylesheet()
|
||||
}
|
||||
|
||||
pub(crate) fn shared_lock(&self) -> &SharedRwLock {
|
||||
self.cssrule.shared_lock()
|
||||
self.css_rule.shared_lock()
|
||||
}
|
||||
|
||||
pub(crate) fn update_rules(
|
||||
@@ -69,7 +69,7 @@ impl CSSGroupingRule {
|
||||
rules: &Arc<Locked<CssRules>>,
|
||||
guard: &SharedRwLockReadGuard,
|
||||
) {
|
||||
if let Some(rulelist) = self.rulelist.get() {
|
||||
if let Some(rulelist) = self.rule_list.get() {
|
||||
rulelist.update_rules(RulesSource::Rules(rules.clone()), guard);
|
||||
}
|
||||
}
|
||||
@@ -85,7 +85,7 @@ impl CSSGroupingRuleMethods<crate::DomTypeHolder> for CSSGroupingRule {
|
||||
/// <https://drafts.csswg.org/cssom/#dom-cssgroupingrule-insertrule>
|
||||
fn InsertRule(&self, rule: DOMString, index: u32, can_gc: CanGc) -> Fallible<u32> {
|
||||
// TODO: this should accumulate the rule types of all ancestors.
|
||||
let rule_type = self.cssrule.as_specific().ty();
|
||||
let rule_type = self.css_rule.as_specific().ty();
|
||||
let containing_rule_types = CssRuleTypes::from(rule_type);
|
||||
let parse_relative_rule_type = match rule_type {
|
||||
CssRuleType::Style | CssRuleType::Scope => Some(rule_type),
|
||||
|
||||
Reference in New Issue
Block a user