mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-01-07 02:04:11 +01:00
Fix sanitizer.
--HG-- branch : testing
This commit is contained in:
@@ -673,6 +673,20 @@ const Util = Module("util", {
|
||||
return str;
|
||||
},
|
||||
|
||||
/**
|
||||
* Scrolls an element into view if and only if it's not already
|
||||
* fully visible.
|
||||
*
|
||||
* @param {Node} elem The element to make visible.
|
||||
*/
|
||||
scrollIntoView: function scrollIntoView(elem) {
|
||||
let win = elem.ownerDocument.defaultView;
|
||||
let rect = elem.getBoundingClientRect();
|
||||
if (!(rect && rect.top < win.innerHeight && rect.bottom >= 0 && rect.left < win.innerWidth && rect.right >= 0))
|
||||
elem.scrollIntoView();
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Returns an array of URLs parsed from <b>str</b>.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user