-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathdisableEnyoDom.js
45 lines (39 loc) · 1.23 KB
/
disableEnyoDom.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
disableEnyoDom.js
a bold hack to tear out the parts of Enyo that interact with the DOM to test JavaScript speed
*/
enyo.dom.setInnerHtml = enyo.nop;
enyo.dom.applyBodyFit = enyo.nop;
enyo.dom.byId = function(id) {
return (typeof id == "string") ? null : id;
};
// disable code in enyo.Control that sets generated to true or creates nodes
enyo.Control.prototype.generateHtml = function() {
if (this.canGenerate === false) {
return '';
}
// do this first in case content generation affects outer html (styles or attributes)
var c = this.generateInnerHtml();
// generate tag, styles, attributes
var h = this.generateOuterHtml(c);
return h;
};
enyo.Control.prototype.renderNode = function() {
this.teardownRender();
};
enyo.Control.prototype.write = function() {
if (this.fit) {
this.setupBodyFitting();
}
// for IE10 support, we want full support over touch actions in Enyo-rendered areas
this.addClass("enyo-no-touch-action");
// add css to enable hw-accelerated scrolling on non-Android platforms (ENYO-900, ENYO-901)
this.setupOverflowScrolling();
this.generateHtml();
// post-rendering tasks
if (this.generated) {
this.rendered();
}
// support method chaining
return this;
};