| Left: | ||
| Right: |
| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * This file is part of Adblock Plus <http://adblockplus.org/>, | 2 * This file is part of Adblock Plus <http://adblockplus.org/>, |
| 3 * Copyright (C) 2006-2014 Eyeo GmbH | 3 * Copyright (C) 2006-2014 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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 203 | 203 |
| 204 // If the element isn't rendered (since its or one of its ancestor's | 204 // If the element isn't rendered (since its or one of its ancestor's |
| 205 // "diplay" property is "none"), the overlay wouldn't match the element. | 205 // "diplay" property is "none"), the overlay wouldn't match the element. |
| 206 if (!elt.offsetParent) | 206 if (!elt.offsetParent) |
| 207 return; | 207 return; |
| 208 | 208 |
| 209 var thisStyle = getComputedStyle(elt, null); | 209 var thisStyle = getComputedStyle(elt, null); |
| 210 var overlay = document.createElement('div'); | 210 var overlay = document.createElement('div'); |
| 211 overlay.prisoner = elt; | 211 overlay.prisoner = elt; |
| 212 overlay.className = "__adblockplus__overlay"; | 212 overlay.className = "__adblockplus__overlay"; |
| 213 overlay.setAttribute('style', 'opacity:0.4; background-color:#ffffff; display: inline-box; ' + 'width:' + thisStyle.width + '; height:' + thisStyle.height + '; position:absolute; overflow:hidden; -webkit-box-sizing:border-box; z-index: 999 99'); | 213 overlay.setAttribute('style', 'opacity:0.4; background-color:#ffffff; display: inline-box; ' + 'width:' + thisStyle.width + '; height:' + thisStyle.height + '; position:absolute; overflow:hidden; -webkit-box-sizing:border-box;'); |
| 214 var pos = getAbsolutePosition(elt); | 214 var pos = getAbsolutePosition(elt); |
| 215 overlay.style.left = pos[0] + "px"; | 215 overlay.style.left = pos[0] + "px"; |
| 216 overlay.style.top = pos[1] + "px"; | 216 overlay.style.top = pos[1] + "px"; |
| 217 | |
| 218 if (thisStyle.position != "static") | |
| 219 overlay.style.zIndex = thisStyle.zIndex; | |
| 220 else | |
| 221 overlay.style.zIndex = getComputedStyle(elt.offsetParent).zIndex; | |
|
kzar
2014/11/26 09:10:04
We should probably check that elt.offsetParent isn
Sebastian Noack
2014/11/26 09:32:46
That is already done with http://codereview.adbloc
kzar
2014/11/26 10:53:30
Whoops, gotya!
| |
| 222 | |
| 217 // elt.parentNode.appendChild(overlay, elt); | 223 // elt.parentNode.appendChild(overlay, elt); |
| 218 document.body.appendChild(overlay); | 224 document.body.appendChild(overlay); |
| 219 return overlay; | 225 return overlay; |
| 220 } | 226 } |
| 221 | 227 |
| 222 // Show dialog asking user whether she wants to add the proposed filters derived | 228 // Show dialog asking user whether she wants to add the proposed filters derived |
| 223 // from selected page element | 229 // from selected page element |
| 224 function clickHide_showDialog(left, top, filters) | 230 function clickHide_showDialog(left, top, filters) |
| 225 { | 231 { |
| 226 // If we are already selecting, abort now | 232 // If we are already selecting, abort now |
| (...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 752 break; | 758 break; |
| 753 default: | 759 default: |
| 754 sendResponse({}); | 760 sendResponse({}); |
| 755 break; | 761 break; |
| 756 } | 762 } |
| 757 }); | 763 }); |
| 758 | 764 |
| 759 if (window == window.top) | 765 if (window == window.top) |
| 760 ext.backgroundPage.sendMessage({type: "report-html-page"}); | 766 ext.backgroundPage.sendMessage({type: "report-html-page"}); |
| 761 } | 767 } |
| OLD | NEW |