Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(css/prefixer): use eq_ignore_span #6656

Merged
merged 2 commits into from
Dec 15, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 8 additions & 8 deletions crates/swc_css_prefixer/src/prefixer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1115,7 +1115,7 @@ impl VisitMut for Prefixer {
"-moz-placeholder",
);

if new_moz_prelude_with_previous != new_moz_prelude {
if !new_moz_prelude_with_previous.eq_ignore_span(&new_moz_prelude) {
let qualified_rule = Box::new(QualifiedRule {
span: DUMMY_SP,
prelude: new_moz_prelude_with_previous,
Expand Down Expand Up @@ -1201,7 +1201,7 @@ impl VisitMut for Prefixer {
"-ms-input-placeholder",
);

if new_ms_prelude_with_previous != new_ms_prelude {
if !new_ms_prelude_with_previous.eq_ignore_span(&new_ms_prelude) {
let qualified_rule = Box::new(QualifiedRule {
span: DUMMY_SP,
prelude: new_ms_prelude_with_previous,
Expand Down Expand Up @@ -1805,7 +1805,7 @@ impl VisitMut for Prefixer {
);
}

if n.value != old_spec_webkit_value {
if !n.value.eq_ignore_span(&old_spec_webkit_value) {
self.added_declarations.push(Box::new(Declaration {
span: n.span,
name: n.name.clone(),
Expand Down Expand Up @@ -2458,7 +2458,7 @@ impl VisitMut for Prefixer {

replace_ident(&mut old_spec_ms_value, "pixelated", "nearest-neighbor");

if ms_value != old_spec_ms_value {
if !ms_value.eq_ignore_span(&old_spec_ms_value) {
add_declaration!(
Prefix::Ms,
"-ms-interpolation-mode",
Expand Down Expand Up @@ -3356,7 +3356,7 @@ impl VisitMut for Prefixer {
_ => {}
}

if n.value != webkit_value {
if !n.value.eq_ignore_span(&webkit_value) {
self.added_declarations.push(Box::new(Declaration {
span: n.span,
name: n.name.clone(),
Expand All @@ -3365,7 +3365,7 @@ impl VisitMut for Prefixer {
}));
}

if n.value != moz_value {
if !n.value.eq_ignore_span(&moz_value) {
self.added_declarations.push(Box::new(Declaration {
span: n.span,
name: n.name.clone(),
Expand All @@ -3374,7 +3374,7 @@ impl VisitMut for Prefixer {
}));
}

if n.value != o_value {
if !n.value.eq_ignore_span(&o_value) {
self.added_declarations.push(Box::new(Declaration {
span: n.span,
name: n.name.clone(),
Expand All @@ -3383,7 +3383,7 @@ impl VisitMut for Prefixer {
}));
}

if n.value != ms_value {
if !n.value.eq_ignore_span(&ms_value) {
self.added_declarations.push(Box::new(Declaration {
span: n.span,
name: n.name.clone(),
Expand Down