mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-23 17:42:27 +01:00
fix util.computedStyle
This commit is contained in:
@@ -35,7 +35,7 @@ function Buffer() //{{{
|
|||||||
/////////////////////////////////////////////////////////////////////////////{{{
|
/////////////////////////////////////////////////////////////////////////////{{{
|
||||||
/* FIXME: This doesn't belong here. */
|
/* FIXME: This doesn't belong here. */
|
||||||
let mainWindowID = config.mainWindowID || "main-window";
|
let mainWindowID = config.mainWindowID || "main-window";
|
||||||
let fontSize = util.computedStyle(document.getElementById(mainWindowID))["font-size"];
|
let fontSize = util.computedStyle(document.getElementById(mainWindowID)).fontSize;
|
||||||
|
|
||||||
styles.registerSheet("chrome://liberator/skin/liberator.css");
|
styles.registerSheet("chrome://liberator/skin/liberator.css");
|
||||||
let error = styles.addSheet("font-size", "chrome://liberator/content/buffer.xhtml",
|
let error = styles.addSheet("font-size", "chrome://liberator/content/buffer.xhtml",
|
||||||
@@ -909,8 +909,8 @@ function Buffer() //{{{
|
|||||||
selController.setCaretEnabled(caretmode);
|
selController.setCaretEnabled(caretmode);
|
||||||
}
|
}
|
||||||
let range = selection.getRangeAt(0);
|
let range = selection.getRangeAt(0);
|
||||||
if (util.computedStyle(range.startContainer)["white-space"] == "pre"
|
if (util.computedStyle(range.startContainer).whiteSpace == "pre"
|
||||||
&& util.computedStyle(range.endContainer)["white-space"] == "pre")
|
&& util.computedStyle(range.endContainer).whiteSpace == "pre")
|
||||||
return String(range);
|
return String(range);
|
||||||
return String(selection);
|
return String(selection);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -141,8 +141,7 @@ const util = { //{{{
|
|||||||
{
|
{
|
||||||
while (node instanceof Text && node.parentNode)
|
while (node instanceof Text && node.parentNode)
|
||||||
node = node.parentNode;
|
node = node.parentNode;
|
||||||
let style = node.ownerDocument.defaultView.getComputedStyle(node, null);
|
return node.ownerDocument.defaultView.getComputedStyle(node, null);
|
||||||
return util.Array.assocToObj(Array.map(style, function (k) [k, style.getPropertyValue(k)]));
|
|
||||||
},
|
},
|
||||||
|
|
||||||
copyToClipboard: function (str, verbose)
|
copyToClipboard: function (str, verbose)
|
||||||
|
|||||||
Reference in New Issue
Block a user