-
Notifications
You must be signed in to change notification settings - Fork 20.6k
Tests: Switch background image from online file to local 1x1.jpg #4866
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
Conversation
@@ -113,7 +113,7 @@ div#fx-tests div.noback { | |||
#nothiddendivchild.prct { font-size: 150%; } | |||
|
|||
/* #9239 Attach a background to the body( avoid crashes in removing the test element in support ) */ | |||
body, div { background: url(https://static.jquery.com/files/rocker/images/logo_jquery_215x53.gif) no-repeat -1000px 0; } | |||
body, div { background: url(1x1.jpg) no-repeat -1000px 0; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it work in both Karma & PHP modes? We generally prepend baseURL
to paths which suggests such URLs are not enough, see e.g.:
Line 1134 in 025da4d
span = jQuery( "<span></span>" ).css( "background-image", "url(" + baseURL + "1x1.jpg)" ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yeah, the asserted value will need updating as well. Forgot about that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How come this is passing CI though?
Lines 1568 to 1571 in 025da4d
// Firefox returns auto's value | |
name: "backgroundImage", | |
value: [ "url('test.png')", "url(" + baseURL + "test.png)", "url(\"" + baseURL + "test.png\")" ], | |
expected: [ "none", "url(\"https://static.jquery.com/files/rocker/images/logo_jquery_215x53.gif\")" ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems the expected
field is never read for anything, neither applied, nor compared with, nor displayed anywhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've revised the PR to remove this property.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason for the 1x1.jpg
background is outlined in the bug mentioned above: https://bugs.jquery.com/ticket/9239. Apparently, in the past we've created an additional hidden body to perform support tests in and this was causing some bugs in some browsers. The issue was fixed in ceba855 and this background was added in e5457a5.
We already have the test for that in bodyBackground.html
so I guess this background was meant to just avoid some crashes in tests, perhaps related to old IE? In that case, it should be possible to just remove it. On real sites all divs wouldn't have background set anyway so removing it would get us closer to reality.
@timmywil since you added this, any objections to removing this block?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the way back in 2011. Yea, it's probably fine to remove now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Blocked on removing the background image.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, removing my objection - the path is relative to the CSS file so the fact a different absolute path is used in Karma & TestSwarm doesn't matter, the image will resolve properly.
We can handle removing the background separately.
Avoids noise from unexpected third-party pings during development (Little Snitch popped up unexpectedly asking for this legacy CDN hostname), and avoids console noise when testing/developing jQuery offline.
Checklist