Bug 41027 - Cannot prevent loading of images in <object> tags using onbeforeload.
Summary: Cannot prevent loading of images in <object> tags using onbeforeload.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Andy Estes
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2010-06-22 17:41 PDT by Andy Estes
Modified: 2010-07-07 07:37 PDT (History)
4 users (show)

See Also:


Attachments
test case (219 bytes, text/html)
2010-06-22 17:41 PDT, Andy Estes
no flags Details
Patch (5.89 KB, patch)
2010-07-03 01:41 PDT, Andy Estes
no flags Details | Formatted Diff | Diff
Patch (6.59 KB, patch)
2010-07-06 15:40 PDT, Andy Estes
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andy Estes 2010-06-22 17:41:02 PDT
Created attachment 59447 [details]
test case

In general, a script can prevent loading of resources in <object> tags by handling the beforeload event and calling preventDefault().  See LayoutTests/fast/dom/beforeload/flash-before-load.html.  Unfortunately, this does not seem to work when the resource specified in the <object> is an image.  See the attached test case.
Comment 1 Andy Estes 2010-06-22 17:44:46 PDT
<rdar://problem/8120596>
Comment 2 Andy Estes 2010-07-03 01:41:11 PDT
Created attachment 60443 [details]
Patch
Comment 3 Andy Estes 2010-07-03 01:49:21 PDT
Comment on attachment 60443 [details]
Patch

Oops, I just realied the fallback case isn't handled correctly.  I'll try again.
Comment 4 Andy Estes 2010-07-06 15:40:18 PDT
Created attachment 60658 [details]
Patch
Comment 5 Adam Barth 2010-07-07 03:09:49 PDT
Comment on attachment 60658 [details]
Patch

Interesting.  I verified that updateRenderer() will do the work removed in attach().  Thanks for the patch.
Comment 6 WebKit Commit Bot 2010-07-07 07:37:35 PDT
Comment on attachment 60658 [details]
Patch

Clearing flags on attachment: 60658

Committed r62664: <http://trac.webkit.org/changeset/62664>
Comment 7 WebKit Commit Bot 2010-07-07 07:37:39 PDT
All reviewed patches have been landed.  Closing bug.