1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-03-07 04:15:46 +01:00

Handle :pagestyle properly for frameset documents.

This commit is contained in:
Kris Maglione
2010-10-03 15:14:37 -04:00
parent 49d6841b0d
commit 57f27000c8

View File

@@ -502,7 +502,6 @@ const Buffer = Module("buffer", {
* @param {Node} elem The element to focus. * @param {Node} elem The element to focus.
*/ */
focusElement: function (elem) { focusElement: function (elem) {
let doc = window.content.document;
let win = elem.ownerDocument && elem.ownerDocument.defaultView || elem; let win = elem.ownerDocument && elem.ownerDocument.defaultView || elem;
win.dactylFocusAllowed = true; win.dactylFocusAllowed = true;
@@ -520,7 +519,7 @@ const Buffer = Module("buffer", {
try { try {
let [x, y] = elem.getAttribute("coords").split(",").map(parseFloat); let [x, y] = elem.getAttribute("coords").split(",").map(parseFloat);
elem.dispatchEvent(events.create(doc, "mouseover", { screenX: x, screenY: y })); elem.dispatchEvent(events.create(elem.ownerDocument, "mouseover", { screenX: x, screenY: y }));
} }
catch (e) {} catch (e) {}
} }
@@ -913,7 +912,7 @@ const Buffer = Module("buffer", {
// copied (and tuned somebit) from browser.jar -> nsContextMenu.js // copied (and tuned somebit) from browser.jar -> nsContextMenu.js
let focusedWindow = document.commandDispatcher.focusedWindow; let focusedWindow = document.commandDispatcher.focusedWindow;
if (focusedWindow == window) if (focusedWindow == window)
focusedWindow = content; focusedWindow = buffer.focusedFrame;
let docCharset = null; let docCharset = null;
if (focusedWindow) if (focusedWindow)
@@ -1107,11 +1106,11 @@ const Buffer = Module("buffer", {
}, },
findScrollableWindow: function findScrollableWindow() { findScrollableWindow: function findScrollableWindow() {
let win = buffer.focusedFrame; win = window.document.commandDispatcher.focusedWindow;
if (win && (win.scrollMaxX > 0 || win.scrollMaxY > 0)) if (win && (win.scrollMaxX > 0 || win.scrollMaxY > 0))
return win; return win;
win = window.document.commandDispatcher.focusedWindow; let win = buffer.focusedFrame;
if (win && (win.scrollMaxX > 0 || win.scrollMaxY > 0)) if (win && (win.scrollMaxX > 0 || win.scrollMaxY > 0))
return win; return win;
@@ -1292,7 +1291,7 @@ const Buffer = Module("buffer", {
if (options["usermode"]) if (options["usermode"])
options["usermode"] = false; options["usermode"] = false;
window.stylesheetSwitchAll(window.content, arg); window.stylesheetSwitchAll(buffer.focusedFrame, arg);
}, },
{ {
argCount: "?", argCount: "?",