| Index: lib/elemHideHitRegistration.js |
| =================================================================== |
| --- a/lib/elemHideHitRegistration.js |
| +++ b/lib/elemHideHitRegistration.js |
| @@ -121,17 +121,21 @@ HitRegistrationChannel.prototype = { |
| } catch(e) {} |
| }, this); |
| }, |
| open: function() |
| { |
| let {Policy} = require("contentPolicy"); |
| let {ElemHide} = require("elemHide"); |
| - let data = "<bindings xmlns='http://www.mozilla.org/xbl'><binding id='dummy'/></bindings>"; |
| + |
| + // This dummy binding below won't have any effect on the element. For |
| + // elements that should be hidden however we don't return any binding at |
| + // all, this makes Gecko stop constructing the node - it cannot be shown. |
| + let data = "<bindings xmlns='http://www.mozilla.org/xbl'><binding id='dummy' bindToUntrustedContent='true'/></bindings>"; |
| let filter = ElemHide.getFilterByKey(this.key); |
| if (filter) |
| { |
| let wnd = Utils.getRequestWindow(this); |
| if (wnd && wnd.document && !Policy.processNode(wnd, wnd.document, Policy.type.ELEMHIDE, filter)) |
| data = "<bindings xmlns='http://www.mozilla.org/xbl'/>"; |
| } |