Use element.ownerDocument instead of document.
This commit is contained in:
parent
6fdb285562
commit
0759ee67dd
3 changed files with 8 additions and 5 deletions
|
|
@ -121,8 +121,8 @@ var Text = function(parentEl) {
|
||||||
// Note: characterWidth can be a float!
|
// Note: characterWidth can be a float!
|
||||||
measureNode.innerHTML = lang.stringRepeat("Xy", n);
|
measureNode.innerHTML = lang.stringRepeat("Xy", n);
|
||||||
|
|
||||||
if (document.body) {
|
if (this.element.ownerDocument.body) {
|
||||||
document.body.appendChild(measureNode);
|
this.element.ownerDocument.body.appendChild(measureNode);
|
||||||
} else {
|
} else {
|
||||||
var container = this.element.parentNode;
|
var container = this.element.parentNode;
|
||||||
while (!dom.hasCssClass(container, "ace_editor"))
|
while (!dom.hasCssClass(container, "ace_editor"))
|
||||||
|
|
@ -257,7 +257,7 @@ var Text = function(parentEl) {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.$renderLinesFragment = function(config, firstRow, lastRow) {
|
this.$renderLinesFragment = function(config, firstRow, lastRow) {
|
||||||
var fragment = document.createDocumentFragment(),
|
var fragment = this.element.ownerDocument.createDocumentFragment(),
|
||||||
row = firstRow,
|
row = firstRow,
|
||||||
fold = this.session.getNextFold(row),
|
fold = this.session.getNextFold(row),
|
||||||
foldStart = fold ?fold.start.row :Infinity;
|
foldStart = fold ?fold.start.row :Infinity;
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ var ScrollBar = function(parent) {
|
||||||
// of 0px
|
// of 0px
|
||||||
// in Firefox 6+ scrollbar is hidden if element has the same width as scrollbar
|
// in Firefox 6+ scrollbar is hidden if element has the same width as scrollbar
|
||||||
// make element a little bit wider to retain scrollbar when page is zoomed
|
// make element a little bit wider to retain scrollbar when page is zoomed
|
||||||
this.width = dom.scrollbarWidth();
|
this.width = dom.scrollbarWidth(parent.ownerDocument);
|
||||||
this.element.style.width = (this.width || 15) + 5 + "px";
|
this.element.style.width = (this.width || 15) + 5 + "px";
|
||||||
|
|
||||||
event.addListener(this.element, "scroll", this.onScroll.bind(this));
|
event.addListener(this.element, "scroll", this.onScroll.bind(this));
|
||||||
|
|
|
||||||
|
|
@ -135,7 +135,10 @@ var VirtualRenderer = function(container, theme) {
|
||||||
height : 1
|
height : 1
|
||||||
};
|
};
|
||||||
|
|
||||||
this.$loop = new RenderLoop(this.$renderChanges.bind(this));
|
this.$loop = new RenderLoop(
|
||||||
|
this.$renderChanges.bind(this),
|
||||||
|
this.container.ownerDocument.defaultView
|
||||||
|
);
|
||||||
this.$loop.schedule(this.CHANGE_FULL);
|
this.$loop.schedule(this.CHANGE_FULL);
|
||||||
|
|
||||||
this.setPadding(4);
|
this.setPadding(4);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue