[loki-editor commit] r658 - trunk/src

0 views
Skip to first unread message

codesite...@google.com

unread,
Dec 4, 2008, 11:18:46 AM12/4/08
to loki-c...@googlegroups.com
Author: enaeseth
Date: Thu Dec 4 08:17:16 2008
New Revision: 658

Modified:
trunk/src/utilities.js

Log:
Fixing addStyleSheet for WebKit.

Modified: trunk/src/utilities.js
==============================================================================
--- trunk/src/utilities.js (original)
+++ trunk/src/utilities.js Thu Dec 4 08:17:16 2008
@@ -398,18 +398,18 @@
addStyleSheet: function add_style_sheet(url) {
base2.DOM.bind(this);

- function fix_document() {
- var root = this.documentElement ||
- this.getElementsByTagName("HTML")[0];
- var body = this.getElementsByTagName("BODY");
+ function fix_document(document) {
+ var root = document.documentElement ||
+ document.getElementsByTagName("HTML")[0];
+ var body = document.getElementsByTagName("BODY");
if (!body.length) {
- body = this.createElement("BODY");
+ body = document.createElement("BODY");
root.appendChild(body);
} else {
body = body[0];
}

- var head = this.createElement("HEAD");
+ var head = document.createElement("HEAD");
root.insertBefore(head, body);
}

@@ -430,7 +430,7 @@
});
var head = this.querySelector("head");
if (!head) {
- fix_document();
+ fix_document(this);
head = this.querySelector("head");
}
head.appendChild(link);

Reply all
Reply to author
Forward
0 new messages