diff --git a/lib/tools/phantomas/custom_modules/modules/domQYLT/domQYLT.js b/lib/tools/phantomas/custom_modules/modules/domQYLT/domQYLT.js index fe19cdc..85ed0ef 100644 --- a/lib/tools/phantomas/custom_modules/modules/domQYLT/domQYLT.js +++ b/lib/tools/phantomas/custom_modules/modules/domQYLT/domQYLT.js @@ -270,6 +270,61 @@ exports.module = function(phantomas) { phantomas.spy(Node.prototype, 'insertBefore', insertBeforeSpyBefore, function(result) { phantomas.leaveContext(); }); + + + phantomas.spy(Document.prototype, 'createElement', function(tagName) { + + phantomas.enterContext({ + type: 'createElement', + callDetails: { + context: { + domElement: '#document' + }, + arguments: [tagName] + }, + backtrace: phantomas.getBacktrace() + }); + + }, function(result, args) { + phantomas.leaveContext(); + }); + + + phantomas.spy(Document.prototype, 'createTextNode', function(text) { + + phantomas.enterContext({ + type: 'createTextNode', + callDetails: { + context: { + domElement: '#document' + }, + arguments: [text] + }, + backtrace: phantomas.getBacktrace() + }); + + }, function(result, args) { + phantomas.leaveContext(); + }); + + + phantomas.spy(Document.prototype, 'createDocumentFragment', function() { + + phantomas.enterContext({ + type: 'createDocumentFragment', + callDetails: { + context: { + domElement: '#document' + }, + arguments: [] + }, + backtrace: phantomas.getBacktrace() + }); + + }, function(result, args) { + phantomas.leaveContext(); + }); + })(window.__phantomas); }); });