michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: "use strict"; michael@0: michael@0: module.metadata = { michael@0: "stability": "unstable" michael@0: }; michael@0: michael@0: var { Ci } = require("chrome"); michael@0: var method = require("../../method/core"); michael@0: michael@0: // Returns DOM node associated with a view for michael@0: // the given `value`. If `value` has no view associated michael@0: // it returns `null`. You can implement this method for michael@0: // this type to define what the result should be for it. michael@0: let getNodeView = method("getNodeView"); michael@0: getNodeView.define(x => michael@0: x instanceof Ci.nsIDOMNode ? x : michael@0: x instanceof Ci.nsIDOMWindow ? x : michael@0: null); michael@0: exports.getNodeView = getNodeView; michael@0: exports.viewFor = getNodeView; michael@0: michael@0: let getActiveView = method("getActiveView"); michael@0: exports.getActiveView = getActiveView;