X
Kliknite sem pre prechod na mobilnú verziu webu.

Fórum podpory

Why Firefox fetch source of image if <img> is inside <template>?

Pridané

Sources of images inside <template> shouldn't be fetch. I do not observed this kind of behavior in chromium which is correct in my opinion. I hold in <template> javascript template literals strings mixed into html code for further html generation from json objects recieved from api. A 'src' attribute holds something like `${object.source ? object.source : }` and firefox thinks he should look up for this thing in the internet. Is this behavior demanded or overlooked?

Using Firefox Quantum 61.0 (64-bit) for GNU/Linux.

ps. sorry if I missplaced this question but I find this site to be extremely unintuitive.

Sources of images inside <template> shouldn't be fetch. I do not observed this kind of behavior in chromium which is correct in my opinion. I hold in <template> javascript template literals strings mixed into html code for further html generation from json objects recieved from api. A 'src' attribute holds something like `${object.source ? object.source : ''}` and firefox thinks he should look up for this thing in the internet. Is this behavior demanded or overlooked? Using Firefox Quantum 61.0 (64-bit) for GNU/Linux. ps. sorry if I missplaced this question but I find this site to be extremely unintuitive.

Vybrané riešenie

Citácia

Ďalšie informácie o systéme

Nainštalované zásuvné moduly

  • Shockwave Flash 30.0 r0

Aplikácie

  • Identifikácia prehliadača: Mozilla/5.0 (X11; Linux x86_64; rv:61.0) Gecko/20100101 Firefox/61.0

Viac informácií

Pkshadow
  • Top 10 Contributor
974 riešení 13169 odpovedí

Please supply the URL or the whole piece of code, URL would be best.

Please supply the URL or the whole piece of code, URL would be best.
Pomohlo vám to?
Citácia

Autor otázky

Dunno how to place sample code here

Dunno how to place sample code here

Upravil(a) remek dňa

Pomohlo vám to?
Citácia
Pkshadow
  • Top 10 Contributor
974 riešení 13169 odpovedí

remek said

<template> </template> Dunno how to place sample code here

Need the code between the two can use Edit to the right to change the post. As mentioned URL would be best. Upload your HTML & CSS to here to see if your code passes : HTML https://validator.w3.org/ CSS https://jigsaw.w3.org/css-validator/

''remek [[#answer-1142348|said]]'' <blockquote> <template> <img src="anything"> </template> Dunno how to place sample code here </blockquote> Need the code between the two can use Edit to the right to change the post. As mentioned URL would be best. Upload your HTML & CSS to here to see if your code passes : HTML https://validator.w3.org/ CSS https://jigsaw.w3.org/css-validator/
Pomohlo vám to?
Citácia

Autor otázky

Just create template tag inside body and img inside template with src="anything". Then proceede to the site with this code and type ctrl-shift-e and then ctrl-shift-r and 404 GET will show up. WHY? img inside <template> should be ignored and not requested.

Just create template tag inside body and img inside template with src="anything". Then proceede to the site with this code and type ctrl-shift-e and then ctrl-shift-r and 404 GET will show up. WHY? img inside <template> should be ignored and not requested.

Upravil(a) remek dňa

Pomohlo vám to?
Citácia
Pkshadow
  • Top 10 Contributor
974 riešení 13169 odpovedí

Find out what W3C has to say, usually it will mention how to fix it or if it can belong there.

Find out what W3C has to say, usually it will mention how to fix it or if it can belong there.
Pomohlo vám to?
Citácia

Autor otázky

I am afraid I cannot provide URL but I think it is a simple question that not require a code or URL. Why firefox parse img tag inside template tag. Is it on purpose? Why is it on purpose? Is it a bug?

I am afraid I cannot provide URL but I think it is a simple question that not require a code or URL. Why firefox parse img tag inside template tag. Is it on purpose? Why is it on purpose? Is it a bug?

Upravil(a) remek dňa

Pomohlo vám to?
Citácia

Autor otázky

Not find anything on this topic on net. Otherwise I will not even bother to ask for answers here.

Not find anything on this topic on net. Otherwise I will not even bother to ask for answers here.
Pomohlo vám to?
Citácia
Pkshadow
  • Top 10 Contributor
974 riešení 13169 odpovedí

As mentioned upload it. Is it HTML5 is it HTML5 Responsive, Is HTML 4.0, 4.0.1 Transitional. With out knowing it maybe allowed or maybe not. Also we are not teaching coding.

As mentioned upload it. Is it HTML5 is it HTML5 Responsive, Is HTML 4.0, 4.0.1 Transitional. With out knowing it maybe allowed or maybe not. Also we are not teaching coding.
Pomohlo vám to?
Citácia

Autor otázky

HTML5. I am not asking for teachings. Rather answers from firefox developers on this behavior. Not sure if it is correct place for this.

Behavior: Firefox parse img tag inside template tag and try fetch for value of src attribute. Question: Is this behavior correct and why? Reason: Chromium doesn't fetch img tag inside template tag. I think this behavior is most wanted.

HTML5. I am not asking for teachings. Rather answers from firefox developers on this behavior. Not sure if it is correct place for this. Behavior: Firefox parse img tag inside template tag and try fetch for value of src attribute. Question: Is this behavior correct and why? Reason: Chromium doesn't fetch img tag inside template tag. I think this behavior is most wanted.

Upravil(a) remek dňa

Pomohlo vám to?
Citácia
Pkshadow
  • Top 10 Contributor
974 riešení 13169 odpovedí

the address for local is file:// https://www.w3schools.com/tags/tag_template.asp

the address for local is file:// https://www.w3schools.com/tags/tag_template.asp
Pomohlo vám to? 0
Citácia

Autor otázky

Well... somebody is more oriented on this topic? Or can guide me where I can ask this question directly to developers?

Well... somebody is more oriented on this topic? Or can guide me where I can ask this question directly to developers?
Pomohlo vám to?
Citácia
jscher2000
  • Top 10 Contributor
7537 riešení 61432 odpovedí

Užitočné odpovede

I've never used the template tag. I see documentation here:

https://developer.mozilla.org/docs/Web/HTML/Element/template

It says:

While the parser does process the contents of the <template> element while loading the page, it does so only to ensure that those contents are valid; the element's contents are not rendered, however.

The word "process" is ambiguous, but I do see an image retrieval when running this Fiddle in Firefox:

https://jsfiddle.net/yom70axn/1/

And not in Chrome (on Windows).

Is there a standard which says what should happen with inline images?

I think this probably is beyond the purview of this support forum.

I've never used the template tag. I see documentation here: https://developer.mozilla.org/docs/Web/HTML/Element/template It says: <blockquote>While the parser does process the contents of the '''&lt;template&gt;''' element while loading the page, it does so only to ensure that those contents are valid; the element's contents are not rendered, however.</blockquote> The word "process" is ambiguous, but I do see an image retrieval when running this Fiddle in Firefox: https://jsfiddle.net/yom70axn/1/ And not in Chrome (on Windows). Is there a standard which says what should happen with inline images? I think this probably is beyond the purview of this support forum.
Pomohlo vám to? 1
Citácia

Autor otázky

Yes. In my opinion the image should not be retrieve. How suggest this to developers?

Yes. In my opinion the image should not be retrieve. How suggest this to developers?
Pomohlo vám to?
Citácia

Autor otázky

There is no standard I think for this. It is extremely difficult to find anything related this topic. But templates are used for.... templates. Theirs values are empty until filled and append to DOM.

There is no standard I think for this. It is extremely difficult to find anything related this topic. But templates are used for.... templates. Theirs values are empty until filled and append to DOM.
Pomohlo vám to?
Citácia
jscher2000
  • Top 10 Contributor
7537 riešení 61432 odpovedí

Vybrané riešenie

This might be a good place to raise the issue:

https://discourse.mozilla.org/c/firefox-development

This might be a good place to raise the issue: https://discourse.mozilla.org/c/firefox-development
Pomohlo vám to? 1
Citácia

Autor otázky

Thank You I much appreciate yours answers!

Thank You I much appreciate yours answers!
Pomohlo vám to?
Citácia
Položiť otázku

Ak chcete pridať odpoveď, musíte sa prihlásiť k svojmu účtu. Ak účet doteraz nemáte, položte novú otázku.