summaryrefslogtreecommitdiffstats
path: root/docs/code-quality/lint/linters/eslint-plugin-mozilla/use-ownerGlobal.rst
blob: 5d9905fc9fe7204206bea0bcb8374b7e055b3972 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use-ownerGlobal
===============

Require ``.ownerGlobal`` instead of ``.ownerDocument.defaultView``.

Examples of incorrect code for this rule:
-----------------------------------------

.. code-block:: js

    aEvent.target.ownerDocument.defaultView;
    this.DOMPointNode.ownerDocument.defaultView.getSelection();

Examples of correct code for this rule:
---------------------------------------

.. code-block:: js

    aEvent.target.ownerGlobal;
    this.DOMPointNode.ownerGlobal.getSelection();