(href, removeFromCache)
| 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 () { |
no test coverage detected