Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 22 additions & 4 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,25 @@ if (!doc.body.insertAdjacentHTML) {
}

elementProto.matches =
elementProto.webkitMatchesSelector ||
elementProto.mozMatchesSelector ||
elementProto.oMatchesSelector ||
elementProto.msMatchesSelector
elementProto.webkitMatchesSelector ||
elementProto.mozMatchesSelector ||
elementProto.oMatchesSelector ||
elementProto.msMatchesSelector


// Add support for createContextualFragment for IE9
if (typeof Range.prototype.createContextualFragment == "undefined") {
Range.prototype.createContextualFragment = function(html) {
var startNode = this.startContainer
, doc = startNode.nodeType == 9 ? startNode : startNode.ownerDocument
, container = doc.createElement("div")
, frag, n;

container.innerHTML = html;
frag = doc.createDocumentFragment();
while (n = container.firstChild) {
frag.appendChild(n);
}
return frag;
};
}