mirror of
https://github.com/servo/servo
synced 2026-04-26 09:35:26 +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:
@@ -22,11 +22,11 @@ use crate::script_runtime::CanGc;
|
||||
|
||||
#[dom_struct]
|
||||
pub(crate) struct CSSNestedDeclarations {
|
||||
cssrule: CSSRule,
|
||||
css_rule: CSSRule,
|
||||
#[ignore_malloc_size_of = "Stylo"]
|
||||
#[no_trace]
|
||||
nesteddeclarationsrule: RefCell<Arc<Locked<NestedDeclarationsRule>>>,
|
||||
style_decl: MutNullableDom<CSSStyleDeclaration>,
|
||||
style_declaration: MutNullableDom<CSSStyleDeclaration>,
|
||||
}
|
||||
|
||||
impl CSSNestedDeclarations {
|
||||
@@ -35,9 +35,9 @@ impl CSSNestedDeclarations {
|
||||
nesteddeclarationsrule: Arc<Locked<NestedDeclarationsRule>>,
|
||||
) -> Self {
|
||||
Self {
|
||||
cssrule: CSSRule::new_inherited(parent_stylesheet),
|
||||
css_rule: CSSRule::new_inherited(parent_stylesheet),
|
||||
nesteddeclarationsrule: RefCell::new(nesteddeclarationsrule),
|
||||
style_decl: Default::default(),
|
||||
style_declaration: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ impl CSSNestedDeclarations {
|
||||
nesteddeclarationsrule: Arc<Locked<NestedDeclarationsRule>>,
|
||||
guard: &SharedRwLockReadGuard,
|
||||
) {
|
||||
if let Some(ref style_decl) = self.style_decl.get() {
|
||||
if let Some(ref style_decl) = self.style_declaration.get() {
|
||||
style_decl
|
||||
.update_property_declaration_block(&nesteddeclarationsrule.read_with(guard).block);
|
||||
}
|
||||
@@ -76,7 +76,7 @@ impl SpecificCSSRule for CSSNestedDeclarations {
|
||||
}
|
||||
|
||||
fn get_css(&self) -> DOMString {
|
||||
let guard = self.cssrule.shared_lock().read();
|
||||
let guard = self.css_rule.shared_lock().read();
|
||||
self.nesteddeclarationsrule
|
||||
.borrow()
|
||||
.read_with(&guard)
|
||||
@@ -88,8 +88,8 @@ impl SpecificCSSRule for CSSNestedDeclarations {
|
||||
impl CSSNestedDeclarationsMethods<crate::DomTypeHolder> for CSSNestedDeclarations {
|
||||
/// <https://drafts.csswg.org/css-nesting/#dom-cssnesteddeclarations-style>
|
||||
fn Style(&self, can_gc: CanGc) -> DomRoot<CSSStyleDeclaration> {
|
||||
self.style_decl.or_init(|| {
|
||||
let guard = self.cssrule.shared_lock().read();
|
||||
self.style_declaration.or_init(|| {
|
||||
let guard = self.css_rule.shared_lock().read();
|
||||
CSSStyleDeclaration::new(
|
||||
self.global().as_window(),
|
||||
CSSStyleOwner::CSSRule(
|
||||
|
||||
Reference in New Issue
Block a user