Skip to content

Conversation

@mgol
Copy link
Member

@mgol mgol commented May 29, 2024

Summary

Firefox 126+ implements CSS zoom in a way it affects width computed style
very slightly (100.008px instead of 100px); accept that difference.

Add a test for support tests resolving the same under CSS zoom & without one.
That test uncovered Chrome failing the reliableTrDimensions support test
under zoom; the test has been fixed.

Fixes gh-5489
Closes gh-5495
Ref gh-5496

3.x version: gh-5496

Checklist

@mgol mgol added the Tests label May 29, 2024
@mgol mgol added this to the 4.0.0 milestone May 29, 2024
@mgol mgol self-assigned this May 29, 2024
@mgol mgol added Needs review Discuss in Meeting Reserved for Issues and PRs that anyone would like to discuss in the weekly meeting. labels May 29, 2024
@mgol mgol force-pushed the firefox-zoom-gh-5489 branch from 12c5243 to f56402a Compare May 29, 2024 12:03
mgol added a commit to mgol/jquery that referenced this pull request May 29, 2024
Firefox 126+ implements CSS zoom in a way it affects width computed style
very slightly (`100.008px` instead of `100px`); accept that difference.

Also, skip the width setter under zoom test in Firefox 126 completely - that
version has CSS zoom affecting `offsetWidth` values. This has been fixed in
Firefox 127 so it's not worth working around it.

Add a test for support tests resolving the same under CSS zoom & without one.
That test uncovered Chrome failing the `reliableTrDimensions` support test
under zoom; the test has been fixed.

Fixes jquerygh-5489
Closes jquerygh-5496
Ref jquerygh-5495
@mgol mgol force-pushed the firefox-zoom-gh-5489 branch from f56402a to ddc2964 Compare May 29, 2024 12:30
mgol added a commit to mgol/jquery that referenced this pull request May 29, 2024
Firefox 126+ implements CSS zoom in a way it affects width computed style
very slightly (`100.008px` instead of `100px`); accept that difference.

Add a test for support tests resolving the same under CSS zoom & without one.

Fixes jquerygh-5489
Closes jquerygh-5495
Ref jquerygh-5496
@mgol mgol force-pushed the firefox-zoom-gh-5489 branch 2 times, most recently from 95a9c63 to dfa7f99 Compare May 29, 2024 12:36
mgol added a commit to mgol/jquery that referenced this pull request May 29, 2024
Firefox 126+ implements CSS zoom in a way it affects width computed style
very slightly (`100.008px` instead of `100px`); accept that difference.

Add a test for support tests resolving the same under CSS zoom & without one.
That test uncovered Chrome failing the `reliableTrDimensions` support test
under zoom; the test has been fixed.

Fixes jquerygh-5489
Closes jquerygh-5495
Ref jquerygh-5496
mgol added a commit to mgol/jquery that referenced this pull request May 29, 2024
Firefox 126+ implements CSS zoom in a way it affects width computed style
very slightly (`100.008px` instead of `100px`); accept that difference.

Add a test for support tests resolving the same under CSS zoom & without one.
That test uncovered Chrome failing the `reliableTrDimensions` support test
under zoom; the test has been fixed.

Fixes jquerygh-5489
Closes jquerygh-5495
Ref jquerygh-5496
@mgol mgol force-pushed the firefox-zoom-gh-5489 branch from dfa7f99 to f481229 Compare May 29, 2024 12:41
@mgol mgol changed the title Tests: Account for small differences in width under zoom in Firefox CSS:Tests: Fix tests & support tests under CSS Zoom May 29, 2024
@mgol mgol added the CSS label May 29, 2024
mgol added a commit to mgol/jquery that referenced this pull request May 29, 2024
Firefox 126+ implements CSS zoom in a way it affects width computed style
very slightly (`100.008px` instead of `100px`); accept that difference.

Also, skip the width setter under zoom test in Firefox 126 completely - that
version has CSS zoom affecting `offsetWidth` values. This has been fixed in
Firefox 127 so it's not worth working around it.

Add a test for support tests resolving the same under CSS zoom & without one.
That test uncovered Chrome failing the `reliableTrDimensions` support test
under zoom; the test has been fixed.

Fixes jquerygh-5489
Closes jquerygh-5496
Ref jquerygh-5495
@mgol
Copy link
Member Author

mgol commented May 29, 2024

Size diffs:

main @527fb3dcf0dcde69302a741dfc61cbfa58e99eb0
   raw     gz Filename
   +33     +5 dist/jquery.min.js
   +33     +5 dist/jquery.slim.min.js
   +33     +4 dist-module/jquery.module.min.js
   +33     +5 dist-module/jquery.slim.module.min.js

@mgol mgol requested a review from gibson042 May 29, 2024 15:23
Comment on lines +58 to +59
Math.round( parseFloat( trStyle.borderTopWidth ) ) +
Math.round( parseFloat( trStyle.borderBottomWidth ) ) ) === tr.offsetHeight;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IE / Edge, for which this support test was written, have much bigger differences here (something like 3 vs. 9) so rounding shouldn't affect it.

Firefox 126+ implements CSS zoom in a way it affects width computed style
very slightly (`100.008px` instead of `100px`); accept that difference.

Add a test for support tests resolving the same under CSS zoom & without one.
That test uncovered Chrome failing the `reliableTrDimensions` support test
under zoom; the test has been fixed.

Fixes jquerygh-5489
Closes jquerygh-5495
Ref jquerygh-5496
@mgol mgol force-pushed the firefox-zoom-gh-5489 branch from f481229 to 2f901cd Compare May 29, 2024 16:34
mgol added a commit to mgol/jquery that referenced this pull request May 29, 2024
Firefox 126+ implements CSS zoom in a way it affects width computed style
very slightly (`100.008px` instead of `100px`); accept that difference.

Also, skip the width setter under zoom test in Firefox 126 completely - that
version has CSS zoom affecting `offsetWidth` values. This has been fixed in
Firefox 127 so it's not worth working around it.

Add a test for support tests resolving the same under CSS zoom & without one.
That test uncovered Chrome failing the `reliableTrDimensions` support test
under zoom; the test has been fixed.

Fixes jquerygh-5489
Closes jquerygh-5496
Ref jquerygh-5495
@timmywil timmywil removed the Discuss in Meeting Reserved for Issues and PRs that anyone would like to discuss in the weekly meeting. label Jun 3, 2024
@mgol mgol merged commit 071f6db into jquery:main Jun 3, 2024
@mgol mgol deleted the firefox-zoom-gh-5489 branch June 3, 2024 16:15
@mgol mgol removed the Needs review label Jun 3, 2024
mgol added a commit that referenced this pull request Jun 3, 2024
Firefox 126+ implements CSS zoom in a way it affects width computed style
very slightly (`100.008px` instead of `100px`); accept that difference.

Also, skip the width setter under zoom test in Firefox 126 completely - that
version has CSS zoom affecting `offsetWidth` values. This has been fixed in
Firefox 127 so it's not worth working around it.

Add a test for support tests resolving the same under CSS zoom & without one.
That test uncovered Chrome failing the `reliableTrDimensions` support test
under zoom; the test has been fixed.

Fixes gh-5489
Closes gh-5496
Ref gh-5495
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 24, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Development

Successfully merging this pull request may close these issues.

Fix CSS test issues in Firefox coming from CSS zoom support

2 participants