(scope, nodeList, $rootElement, parentBoundTranscludeFn)
| 9191 | return linkFnFound ? compositeLinkFn : null; |
| 9192 | |
| 9193 | function compositeLinkFn(scope, nodeList, $rootElement, parentBoundTranscludeFn) { |
| 9194 | var nodeLinkFn, childLinkFn, node, childScope, i, ii, idx, childBoundTranscludeFn; |
| 9195 | var stableNodeList; |
| 9196 | |
| 9197 | |
| 9198 | if (nodeLinkFnFound) { |
| 9199 | // copy nodeList so that if a nodeLinkFn removes or adds an element at this DOM level our |
| 9200 | // offsets don't get screwed up |
| 9201 | var nodeListLength = nodeList.length; |
| 9202 | stableNodeList = new Array(nodeListLength); |
| 9203 | |
| 9204 | // create a sparse array by only copying the elements which have a linkFn |
| 9205 | for (i = 0; i < linkFns.length; i += 3) { |
| 9206 | idx = linkFns[i]; |
| 9207 | stableNodeList[idx] = nodeList[idx]; |
| 9208 | } |
| 9209 | } else { |
| 9210 | stableNodeList = nodeList; |
| 9211 | } |
| 9212 | |
| 9213 | for (i = 0, ii = linkFns.length; i < ii;) { |
| 9214 | node = stableNodeList[linkFns[i++]]; |
| 9215 | nodeLinkFn = linkFns[i++]; |
| 9216 | childLinkFn = linkFns[i++]; |
| 9217 | |
| 9218 | if (nodeLinkFn) { |
| 9219 | if (nodeLinkFn.scope) { |
| 9220 | childScope = scope.$new(); |
| 9221 | compile.$$addScopeInfo(jqLite(node), childScope); |
| 9222 | } else { |
| 9223 | childScope = scope; |
| 9224 | } |
| 9225 | |
| 9226 | if (nodeLinkFn.transcludeOnThisElement) { |
| 9227 | childBoundTranscludeFn = createBoundTranscludeFn( |
| 9228 | scope, nodeLinkFn.transclude, parentBoundTranscludeFn); |
| 9229 | |
| 9230 | } else if (!nodeLinkFn.templateOnThisElement && parentBoundTranscludeFn) { |
| 9231 | childBoundTranscludeFn = parentBoundTranscludeFn; |
| 9232 | |
| 9233 | } else if (!parentBoundTranscludeFn && transcludeFn) { |
| 9234 | childBoundTranscludeFn = createBoundTranscludeFn(scope, transcludeFn); |
| 9235 | |
| 9236 | } else { |
| 9237 | childBoundTranscludeFn = null; |
| 9238 | } |
| 9239 | |
| 9240 | nodeLinkFn(childLinkFn, childScope, node, $rootElement, childBoundTranscludeFn); |
| 9241 | |
| 9242 | } else if (childLinkFn) { |
| 9243 | childLinkFn(scope, node.childNodes, undefined, parentBoundTranscludeFn); |
| 9244 | } |
| 9245 | } |
| 9246 | } |
| 9247 | } |
| 9248 | |
| 9249 | function mergeConsecutiveTextNodes(nodeList, idx, notLiveList) { |
no test coverage detected