use-ownerGlobal.rst (499B)
1 use-ownerGlobal 2 =============== 3 4 Require ``.ownerGlobal`` instead of ``.ownerDocument.defaultView``. 5 6 Examples of incorrect code for this rule: 7 ----------------------------------------- 8 9 .. code-block:: js 10 11 aEvent.target.ownerDocument.defaultView; 12 this.DOMPointNode.ownerDocument.defaultView.getSelection(); 13 14 Examples of correct code for this rule: 15 --------------------------------------- 16 17 .. code-block:: js 18 19 aEvent.target.ownerGlobal; 20 this.DOMPointNode.ownerGlobal.getSelection();