Closed Bug 146048 Opened 24 years ago Closed 24 years ago

image context menu is slow when image blocking is active

Categories

(Core :: Graphics: Image Blocking, defect)

x86
Linux
defect
Not set
normal

Tracking

()

VERIFIED DUPLICATE of bug 115818

People

(Reporter: tomi.leppikangas, Assigned: morse)

Details

(Keywords: perf)

Attachments

(1 file)

From bug #77051 When there is lot of sites listed in cookie or image block list, image contextmenu is slow. I have 8 image block sites and about 500 cookie block sites and after right clicking on image opening popup takes about 2secs. Steps to reproduse: 1. get lots of sites to image or cookie blockin list (maybe some scripts that adds sites to profile/cookperm.txt) 2. right click on image Actual results: Takes about 2-3sec to open menu. Expected: Menu opens instantly. I hacked patch that shows the problem: extensions/cookie/resources/content/cookieContextOverlay.xul: initImageBlocking : function () { try { // Block image depends on whether an image was clicked on, and, // whether the user pref is enabled. /*********************************************************************** gContextMenu.showItem ("context-blockimage", gContextMenu.onImage && cookieContextMenu.isPrefSet() && cookieContextMenu.isBlockingImages()); gContextMenu.showItem ("context-unblockimage", gContextMenu.onImage && cookieContextMenu.isPrefSet() && !cookieContextMenu.isBlockingImages()); ********************************************************************/ } catch (e) {} }, When that code is commented out menus works instantly.
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla1.2alpha
When comparing how image blocking is handled in cookieNavigatorOverlay.xul and cookieContextOverlay.xul there seems to be some differencies. cookieNavigatorOverlay.xul uses function permissionmanager.testForBlocking(window._content.location,IMAGEPERMISSION) and cookieContextOverlay.xul travels list line by line. Can cookieContextOverlay.xul use that testForBlocking() function too?
Keywords: perf
Target Milestone: mozilla1.2alpha → ---
Comment on attachment 84679 [details] [diff] [review] patch that uses testForBlocking() for site search looks good to me. r=morse
Attachment #84679 - Flags: review+
Having well over 5000 image domains blocked (I generated a list of akamai domains) :) contextmenu on images takes over 10 seconds to appear. Going to apply the patch myself in a moment to test a bit, but I'm feeling hopeful. uhm, nominating for mozilla 1.0 is not much use anymore, but should we then nominate for mozilla 1.0.1?
OS: Linux → All
*drools and applies the patch to all his builds* Works like a dream. Thank you! :) I did notice you used tabs in the patch though. Please replace those by spaces.
Comment on attachment 84679 [details] [diff] [review] patch that uses testForBlocking() for site search sr=waterson
Attachment #84679 - Flags: superreview+
Morse, can you check this in? I dont have cvs access. Change those tabs to spaces before checkin.
OS: All → Linux
OK, checked in on trunk.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Awww... and I was *so* enjoying the nice, stable 1.0 branch. Haven't crashed in a long long time. Now I have enough reason to use trunk again. *sigh*. But thanks.
Verified fixed on linux nightly build 2002052507
Status: RESOLVED → VERIFIED
Any chance we could get this in the branch as well? Seems pretty low risk to me...
Actually this is a dup of bug 115818, and the patches in both these reports are nearly identical. However the patch in 115818 is slightly better in that it: - has an added check for a null vector, which is a good thing to have - has a more efficient return. Instead of: if (X) return false; return true; it does simply return !X;
This patch has now been backed out of the trunk and the better patch in bug 115818 has been put onto the trunk instead.
reopening so I can mark this as a dup
Status: VERIFIED → REOPENED
Resolution: FIXED → ---
*** This bug has been marked as a duplicate of 115818 ***
Status: REOPENED → RESOLVED
Closed: 24 years ago24 years ago
Resolution: --- → DUPLICATE
Verified as dup. Sorry that i didnt see other bug, patch in that is better.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: