Bug 156585 - img onload event is fired upon receiving a 301
Summary: img onload event is fired upon receiving a 301
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2016-04-14 11:35 PDT by Myles C. Maxfield
Modified: 2016-04-26 06:53 PDT (History)
6 users (show)

See Also:


Attachments
Reproduction (1.01 KB, text/html)
2016-04-14 11:37 PDT, Myles C. Maxfield
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Myles C. Maxfield 2016-04-14 11:35:20 PDT
1. Use the Network Link Conditioner (http://nshipster.com/network-link-conditioner/) to make the network slow
2. Open the reproduction html
3. Click somewhere
4. Wait a little while

Actual behavior: Red rectangle gets very narrow for a split second before jumping back to its original size

Expected behavior: Red rectangle never changes size

Firefox / Chrome display the expected behavior.

The link that we load when clicking (https://placehold.it/200x200) returns a 301. Initial guess is that we're firing the onload event upon receiving the 301, rather than the subsequent 200.
Comment 1 Myles C. Maxfield 2016-04-14 11:35:59 PDT
This was reported by https://twitter.com/jordan_thomas/status/720270360944357377
Comment 2 Myles C. Maxfield 2016-04-14 11:37:36 PDT
Created attachment 276408 [details]
Reproduction
Comment 3 Radar WebKit Bug Importer 2016-04-14 11:40:41 PDT
<rdar://problem/25731182>
Comment 4 Radar WebKit Bug Importer 2016-04-14 11:40:42 PDT
<rdar://problem/25731147>
Comment 5 Brady Eidson 2016-04-14 11:57:30 PDT
This must be a regression. Would be great if somebody could pinpoint when.
Comment 6 Alex Christensen 2016-04-14 15:00:45 PDT
If this is a regression, it's been in a while.  On Chrome I see no flash, on Firefox I see a blue flash, and on Safari I see a flash of the rectangle of a different size.  Also, from similar tests I'm pretty sure the 301 is not initiating the onload, but from reading the JavaScript it seems like that's what's going on.
Comment 7 mail 2016-04-26 06:53:08 PDT
I opened the reproduction html in v6.0.5 (7536.30.1) and see the "bounce" behavior there too. I also tried v5.1.9 (6534.59.8) and did _not_ see the behavior (although it does render the demo a little funky).