Embedded file loading with "display: none" --what do the specs say? |
Embedded file loading with "display: none" --what do the specs say? |
Christian J |
Mar 23 2014, 09:07 PM
Post
#1
|
. Group: WDG Moderators Posts: 9,656 Joined: 10-August 06 Member No.: 7 |
According to W3C, should embedded files (inline images, iframed pages etc) styled with "display: none" be downloaded from the server anyway? In practice my desktop browsers download such files, but I can't find anything in the W3C specs about it. Is this subject beyond the scope of W3C somehow?
|
CharlesEF |
Mar 23 2014, 10:22 PM
Post
#2
|
Programming Fanatic Group: Members Posts: 1,981 Joined: 27-April 13 From: Edinburg, Texas Member No.: 19,088 |
I might remember wrong but I have always gone with, display: none does not affect the flow of HTML, it just hides it. So, it will be downloaded. visibility: none will remove the element from the HTML flow, so no download.
I have no idea what W3C has to say about it. |
pandy |
Mar 24 2014, 05:28 AM
Post
#3
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
It does affect the flow since it's removed from the flow. Display: hidden doesn't. But maybe we don't mean the same thing with flow.
Christian, I don't remember for sure, but I think back in the day the consensus was images will still be downloaded. The google results I get now says the same. |
Christian J |
Mar 24 2014, 08:18 AM
Post
#4
|
. Group: WDG Moderators Posts: 9,656 Joined: 10-August 06 Member No.: 7 |
|
pandy |
Mar 24 2014, 11:15 AM
Post
#5
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
I don't think things like that are in the spec.
|
CharlesEF |
Mar 24 2014, 01:37 PM
Post
#6
|
Programming Fanatic Group: Members Posts: 1,981 Joined: 27-April 13 From: Edinburg, Texas Member No.: 19,088 |
It does affect the flow since it's removed from the flow. Display: hidden doesn't. But maybe we don't mean the same thing with flow. Christian, I don't remember for sure, but I think back in the day the consensus was images will still be downloaded. The google results I get now says the same. Maybe flow was not the right word but there is a difference between them. The articles I read are from many years ago (when I was using HTML 3.01 specs.) from Microsoft or maybe Netscape. Those articles are the reason I only use display: none |
pandy |
Mar 24 2014, 02:00 PM
Post
#7
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
Actually, I think you expressed it better than I. I thought you meant compared to if display: none wasn't used, but I understand how you meant now. It is as if the element wasn't there at all and thus it doesn't affect the flow of the page.
|
Christian J |
Mar 27 2014, 10:30 PM
Post
#8
|
. Group: WDG Moderators Posts: 9,656 Joined: 10-August 06 Member No.: 7 |
This W3C test result page might give a clue: http://www.w3.org/2009/03/image-display-none/results --the first H2 element with the text "Browsers that don't load the image" has the class name "good", while the second H2 element with the text "Browsers that load the image" (after all the spambot UA strings) has the class name "bad". This implies both that not loading images was the desired behavior (at least to the page author, at that time) and that W3C (or at least the page author) were interested enough to create the test page. So why not be more explicit about it?
BTW some mobile browsers seem to leave certain CSS background-images alone: http://timkadlec.com/2012/04/media-query-a...oading-results/ |
Lo-Fi Version | Time is now: 25th April 2024 - 10:08 AM |