Closed Bug 1358747 Opened 7 years ago Closed 7 years ago

Change of url #hash makes new request on svg image and img

Categories

(Firefox :: Untriaged, defect)

53 Branch
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1121693

People

(Reporter: zdnexnet, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:53.0) Gecko/20100101 Firefox/53.0
Build ID: 20170413192749

Steps to reproduce:

1) Visit url http://pripravto.cz/cs/viewer.html?start_block=0&end_block=30#!product:6a3d8c8d-3517-4b3e-82be-c2bc5eb046bf
2) Open console, log requests and enter next code to change #hash part of image url


//javascript code to see how image
var img = document.querySelector(".template-drw");
var base_url = img.src;
var out = "";
setTimeout(function(){
out = base_url+"#view_TOP";
img.src= out;
},2000);

setTimeout(function(){
out = base_url+"#view_RIGHT";
img.src = out;
},4000);

setTimeout(function(){
out = base_url+"#view_FRONT";
img.src = out;
},6000);


Actual results:

When image src/href is changed Firefox makes new requests to fetch resource, but only #hash part of url is changed not whole url itself.



Here is attached log of how it behaves with Image inside svg

//this is image tag in svg
10:49:44.970 temp0
10:49:45.004 <image preserveAspectRatio="none" width="60" height="51" xlink:href="/userdata/products/untitled_dunt_49.svg?1492850701318#view_TOP_pAR">
//url of image tag
10:49:53.770 temp0.href
10:49:53.803 SVGAnimatedString { baseVal: "/userdata/products/untitled_dunt_49.svg?1492850701318#view_TOP_pAR", animVal: "/userdata/products/untitled_dunt_49.svg?1492850701318#view_TOP_pAR" }
10:49:59.978 temp0.href.baseVal
10:50:00.011 "/userdata/products/untitled_dunt_49.svg?1492850701318#view_TOP_pAR"
// here is change of hash to view_FRONT_pAR
10:50:28.109 temp0.href.baseVal = "/userdata/products/untitled_dunt_49.svg?1492850701318#view_FRONT_pAR"
10:50:28.154 "/userdata/products/untitled_dunt_49.svg?1492850701318#view_FRONT_pAR"
//firefox makes new request while we only change 
10:50:28.171 GET http://localhost:2000/userdata/products/untitled_dunt_49.svg [HTTP/1.1 304 Not Modified 206ms]


Firefox on tested 53/52/54 makes new request on <img> and on <image> in SVG


Expected results:

Firefox should see if #hash part of url is changed - if yes it should not make any new request as it happens with iframe/ main window. This works without problem on Chrome on Windows/Linux. The problem itself is that resource url itself will not change as that part of #hash url is never send to server - so server just replies 200 OK or 304 Not Modified while in Chrome request itself is never made in first place.

I am not sure if this is correct behavior, but if #hash url cannot change server response, i guess this request should not be made.

Hopefully this is understandable. If something is needed just ask.
We have started to see this behavior because some users were making more requests on our server that we thought was normal.  After some analysis we found out that this is the main cause. But maybe we are doing something wrong?

Thanks for response.
reproduced

creates GET requests on Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0

NO requests created on Ubuntu Chromium/56.0.2924.76 Chrome/56.0.2924.76 Safari/537.36

I think it should not create requests.
Status: UNCONFIRMED → RESOLVED
Closed: 7 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.