Skip to content

CSS: Don't warn for number values when prop in jQuery.cssNumber #348

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

Merged
merged 1 commit into from
May 15, 2020

Conversation

mgol
Copy link
Member

@mgol mgol commented May 11, 2020

Relying on numerical values for most CSS properties having "px" auto-appended
when set via .css( prop, value ) is deprecated. So far, Migrate was warning
for number values for all CSS properties with the exception of the ones to which
jQuery 4.x will still auto-append "px". However, if the used jQuery version
contains the property as a key in jQuery.cssNumber, it will already skip
the "px" auto-appending behavior, exactly as jQuery 4.x will. This commit
removes a warning in such cases.

This change will help jQuery UI from not triggering Migrate warnings.

Relying on numerical values for most CSS properties having `"px"` auto-appended
when set via `.css( prop, value )` is deprecated. So far, Migrate was warning
for number values for all CSS properties with the exception of the ones to which
jQuery 4.x will still auto-append `"px"`. However, if the used jQuery version
contains the property as a key in `jQuery.cssNumber`, it will already skip
the `"px"` auto-appending behavior, exactly as jQuery 4.x will. This commit
removes a warning in such cases.

This change will help jQuery UI from not triggering Migrate warnings.
@mgol mgol requested a review from dmethvin May 11, 2020 14:40
@mgol mgol merged commit d25ecd6 into jquery:master May 15, 2020
@mgol mgol deleted the css-number-warnings-lax branch May 15, 2020 21:52
@mgol mgol added this to the 3.3.1 milestone May 16, 2020
mgol added a commit to mgol/jquery that referenced this pull request Jul 18, 2020
The way warning agains number values in `.css()` setters was done in
jquery/jquery-migrate#337 and later refined in jquery/jquery-migrate#348
there's no need to send px-ed strings for `top` & `left` as they already
don't get the "px" suffix.

This reverts commit 57038fa.

Ref jquery/jquery-migrate/pull/337
Ref jquery/jquery-migrate/pull/348
mgol added a commit to mgol/jquery that referenced this pull request Jul 18, 2020
The way warning against number values in `.css()` setters was done in
jquery/jquery-migrate#337 and later refined in jquery/jquery-migrate#348
there's no need to send px-ed strings for `top` & `left` as they already
don't get the "px" suffix.

This reverts commit 57038fa.

Ref jquery/jquery-migrate/pull/337
Ref jquery/jquery-migrate/pull/348
mgol added a commit to jquery/jquery that referenced this pull request Jul 20, 2020
The way warning against number values in `.css()` setters was done in
jquery/jquery-migrate#337 and later refined in jquery/jquery-migrate#348
there's no need to send px-ed strings for `top` & `left` as they already
don't get the "px" suffix.

This reverts commit 57038fa.

Closes gh-4753
Ref jquery/jquery-migrate/pull/337
Ref jquery/jquery-migrate/pull/348
mgol added a commit to mgol/jquery-migrate that referenced this pull request Jul 29, 2020
The warning has been updated in code in jquerygh-348 but not in warnings.md.

Ref jquerygh-348
mgol added a commit that referenced this pull request Aug 25, 2020
The warning has been updated in code in gh-348 but not in warnings.md.

Closes gh-377
Ref gh-348
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants