MCPcopy
hub / github.com/winjs/winjs / getStateRecord

Function getStateRecord

src/js/WinJS/Fragments.js:108–128  ·  view source on GitHub ↗
(href, removeFromCache)

Source from the content-addressed store, hash-verified

106 }
107
108 function getStateRecord(href, removeFromCache) {
109 if (typeof href === "string") {
110 return loadFromCache(href, removeFromCache);
111 } else {
112 var state = {
113 docfrag: _ElementUtilities.data(href).docFragment
114 };
115 if (!state.docfrag) {
116 var fragment = _Global.document.createDocumentFragment();
117 while (href.childNodes.length > 0) {
118 fragment.appendChild(href.childNodes[0]);
119 }
120 state.docfrag = _ElementUtilities.data(href).docFragment = fragment;
121 href.setAttribute("data-win-hasfragment", "");
122 }
123 if (removeFromCache) {
124 clearCache(href);
125 }
126 return Promise.as(state);
127 }
128 }
129 function createEntry(state, href) {
130 return populateDocument(state, href).
131 then(function () {

Callers 2

renderImplFunction · 0.85
cacheFunction · 0.85

Calls 6

loadFromCacheFunction · 0.85
clearCacheFunction · 0.85
appendChildMethod · 0.80
setAttributeMethod · 0.65
dataMethod · 0.45

Tested by

no test coverage detected