Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: include.postload.js

Issue 6022881116946432: Issue 1868 - Create overlays for <img> elements to work around issues with <area> elements (Closed)
Patch Set: Created Jan. 26, 2015, 10:56 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2015 Eyeo GmbH 3 * Copyright (C) 2006-2015 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 337
338 // Turn on the choose element to create filter thing 338 // Turn on the choose element to create filter thing
339 function clickHide_activate() { 339 function clickHide_activate() {
340 if(document == null) 340 if(document == null)
341 return; 341 return;
342 342
343 // If we are already selecting, abort now 343 // If we are already selecting, abort now
344 if (clickHide_activated || clickHideFiltersDialog) 344 if (clickHide_activated || clickHideFiltersDialog)
345 clickHide_deactivate(); 345 clickHide_deactivate();
346 346
347 // Add overlays for blockable elements that don't emit mouse events that they can still be selected 347 // Add overlays for blockable elements that don't emit mouse events that they
348 var elts = document.querySelectorAll('object,embed,iframe,frame'); 348 // can still be selected. While images generally emit mouse events we have
349 // also to add overlays for them, in case <area> elments are used (#1868).
350 var elts = document.querySelectorAll('object,embed,iframe,frame,img');
349 for(var i=0; i<elts.length; i++) 351 for(var i=0; i<elts.length; i++)
350 { 352 {
351 var element = elts[i]; 353 var element = elts[i];
352 if (isBlockable(element)) 354 if (isBlockable(element))
353 addElementOverlay(element); 355 addElementOverlay(element);
354 } 356 }
355 357
356 clickHide_activated = true; 358 clickHide_activated = true;
357 document.addEventListener("mouseover", clickHide_mouseOver, true); 359 document.addEventListener("mouseover", clickHide_mouseOver, true);
358 document.addEventListener("mouseout", clickHide_mouseOut, true); 360 document.addEventListener("mouseout", clickHide_mouseOut, true);
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
729 lastRightClickEventValid = false; 731 lastRightClickEventValid = false;
730 else 732 else
731 lastRightClickEvent = null; 733 lastRightClickEvent = null;
732 break; 734 break;
733 } 735 }
734 }); 736 });
735 737
736 if (window == window.top) 738 if (window == window.top)
737 ext.backgroundPage.sendMessage({type: "report-html-page"}); 739 ext.backgroundPage.sendMessage({type: "report-html-page"});
738 } 740 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld