| OLD | NEW |
| 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 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 // "display" property is "none"), the overlay wouldn't match the element. | 263 // "display" property is "none"), the overlay wouldn't match the element. |
| 264 if (style.display == "none") | 264 if (style.display == "none") |
| 265 return null; | 265 return null; |
| 266 | 266 |
| 267 // If the element or one of its ancestors uses fixed postioning, the overlay | 267 // If the element or one of its ancestors uses fixed postioning, the overlay |
| 268 // has to use fixed postioning too. Otherwise it might not match the element
. | 268 // has to use fixed postioning too. Otherwise it might not match the element
. |
| 269 if (style.position == "fixed") | 269 if (style.position == "fixed") |
| 270 position = "fixed"; | 270 position = "fixed"; |
| 271 | 271 |
| 272 // Determine the effective z-index, which is the highest z-index used | 272 // Determine the effective z-index, which is the highest z-index used |
| 273 // by the element and its offset ancestors. When using a lower z-index | 273 // by the element and its offset ancestors, and increase it by one. |
| 274 // the element would cover the overlay. When using a higher z-index the | 274 // When using a lower z-index the element would cover the overlay. |
| 275 // overlay might also cover other elements. | 275 // When using a higher z-index the overlay might also cover other elements. |
| 276 if (style.position != "static" && style.zIndex != "auto") | 276 if (style.position != "static" && style.zIndex != "auto") |
| 277 { | 277 { |
| 278 if (zIndex == "auto") | 278 var curZIndex = parseInt(style.zIndex, 10) + 1; |
| 279 zIndex = style.zIndex; | 279 |
| 280 else | 280 if (zIndex == "auto" || curZIndex > zIndex) |
| 281 zIndex = Math.max(zIndex, style.zIndex); | 281 zIndex = curZIndex; |
| 282 } | 282 } |
| 283 } | 283 } |
| 284 | 284 |
| 285 var overlay = document.createElement('div'); | 285 var overlay = document.createElement('div'); |
| 286 overlay.prisoner = elt; | 286 overlay.prisoner = elt; |
| 287 overlay.className = "__adblockplus__overlay"; | 287 overlay.className = "__adblockplus__overlay"; |
| 288 overlay.setAttribute('style', 'opacity:0.4; display:inline-box; overflow:hidde
n; box-sizing:border-box;'); | 288 overlay.setAttribute('style', 'opacity:0.4; display:inline-box; overflow:hidde
n; box-sizing:border-box;'); |
| 289 var pos = getAbsolutePosition(elt); | 289 var pos = getAbsolutePosition(elt); |
| 290 overlay.style.width = elt.offsetWidth + "px"; | 290 overlay.style.width = elt.offsetWidth + "px"; |
| 291 overlay.style.height = elt.offsetHeight + "px"; | 291 overlay.style.height = elt.offsetHeight + "px"; |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 729 lastRightClickEventValid = false; | 729 lastRightClickEventValid = false; |
| 730 else | 730 else |
| 731 lastRightClickEvent = null; | 731 lastRightClickEvent = null; |
| 732 break; | 732 break; |
| 733 } | 733 } |
| 734 }); | 734 }); |
| 735 | 735 |
| 736 if (window == window.top) | 736 if (window == window.top) |
| 737 ext.backgroundPage.sendMessage({type: "report-html-page"}); | 737 ext.backgroundPage.sendMessage({type: "report-html-page"}); |
| 738 } | 738 } |
| OLD | NEW |