(scope, nodeList, $rootElement, parentBoundTranscludeFn)
| 9262 | return linkFnFound ? compositeLinkFn : null; |
| 9263 | |
| 9264 | function compositeLinkFn(scope, nodeList, $rootElement, parentBoundTranscludeFn) { |
| 9265 | var nodeLinkFn, childLinkFn, node, childScope, i, ii, idx, childBoundTranscludeFn; |
| 9266 | var stableNodeList; |
| 9267 | |
| 9268 | |
| 9269 | if (nodeLinkFnFound) { |
| 9270 | // copy nodeList so that if a nodeLinkFn removes or adds an element at this DOM level our |
| 9271 | // offsets don't get screwed up |
| 9272 | var nodeListLength = nodeList.length; |
| 9273 | stableNodeList = new Array(nodeListLength); |
| 9274 | |
| 9275 | // create a sparse array by only copying the elements which have a linkFn |
| 9276 | for (i = 0; i < linkFns.length; i += 3) { |
| 9277 | idx = linkFns[i]; |
| 9278 | stableNodeList[idx] = nodeList[idx]; |
| 9279 | } |
| 9280 | } else { |
| 9281 | stableNodeList = nodeList; |
| 9282 | } |
| 9283 | |
| 9284 | for (i = 0, ii = linkFns.length; i < ii;) { |
| 9285 | node = stableNodeList[linkFns[i++]]; |
| 9286 | nodeLinkFn = linkFns[i++]; |
| 9287 | childLinkFn = linkFns[i++]; |
| 9288 | |
| 9289 | if (nodeLinkFn) { |
| 9290 | if (nodeLinkFn.scope) { |
| 9291 | childScope = scope.$new(); |
| 9292 | compile.$$addScopeInfo(jqLite(node), childScope); |
| 9293 | } else { |
| 9294 | childScope = scope; |
| 9295 | } |
| 9296 | |
| 9297 | if (nodeLinkFn.transcludeOnThisElement) { |
| 9298 | childBoundTranscludeFn = createBoundTranscludeFn( |
| 9299 | scope, nodeLinkFn.transclude, parentBoundTranscludeFn); |
| 9300 | |
| 9301 | } else if (!nodeLinkFn.templateOnThisElement && parentBoundTranscludeFn) { |
| 9302 | childBoundTranscludeFn = parentBoundTranscludeFn; |
| 9303 | |
| 9304 | } else if (!parentBoundTranscludeFn && transcludeFn) { |
| 9305 | childBoundTranscludeFn = createBoundTranscludeFn(scope, transcludeFn); |
| 9306 | |
| 9307 | } else { |
| 9308 | childBoundTranscludeFn = null; |
| 9309 | } |
| 9310 | |
| 9311 | nodeLinkFn(childLinkFn, childScope, node, $rootElement, childBoundTranscludeFn); |
| 9312 | |
| 9313 | } else if (childLinkFn) { |
| 9314 | childLinkFn(scope, node.childNodes, undefined, parentBoundTranscludeFn); |
| 9315 | } |
| 9316 | } |
| 9317 | } |
| 9318 | } |
| 9319 | |
| 9320 | function mergeConsecutiveTextNodes(nodeList, idx, notLiveList) { |
no test coverage detected