From 8c8a5de39a9c23afc851956ff5b8e376cbc705d1 Mon Sep 17 00:00:00 2001 From: Ben Spencer Date: Mon, 30 Aug 2010 17:07:41 +0100 Subject: [PATCH] buffer.focused_selection_controller: update for new focus system xulrunner 1.9.2 introduced a new focus system which removed the hasFocus property from nsIDocShell, breaking buffer.focused_selection_controller. See http://bugs.conkeror.org/issue295 for complete details. resolves issue295 --- modules/buffer.js | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/modules/buffer.js b/modules/buffer.js index b3ac5ea..0830ddc 100644 --- a/modules/buffer.js +++ b/modules/buffer.js @@ -237,21 +237,9 @@ buffer.prototype = { }, get focused_selection_controller () { - var child_docshells = this.doc_shell.getDocShellEnumerator( - Ci.nsIDocShellTreeItem.typeContent, - Ci.nsIDocShell.ENUMERATE_FORWARDS); - while (child_docshells.hasMoreElements()) { - let ds = child_docshells.getNext() - .QueryInterface(Ci.nsIDocShell); - if (ds.hasFocus) { - let display = ds.QueryInterface(Ci.nsIInterfaceRequestor) - .getInterface(Ci.nsISelectionDisplay); - if (! display) - return null; - return display.QueryInterface(Ci.nsISelectionController); - } - } - return this.doc_shell + return this.focused_frame + .QueryInterface(Ci.nsIInterfaceRequestor) + .getInterface(Ci.nsIWebNavigation) .QueryInterface(Ci.nsIInterfaceRequestor) .getInterface(Ci.nsISelectionDisplay) .QueryInterface(Ci.nsISelectionController); -- 2.11.4.GIT