[ALOY-17] sizzle.js: only id selectors work
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-07-19T11:52:04.000+0000 |
Affected Version/s | 2012 Sprint 14 |
Fix Version/s | 2012 Sprint 14 |
Components | Runtime |
Labels | n/a |
Reporter | Tony Lukasavage |
Assignee | Tony Lukasavage |
Created | 2012-05-16T06:43:29.000+0000 |
Updated | 2012-07-19T11:52:04.000+0000 |
Description
Tasks:
* It appears to be this call that is failing in sizzle.js
Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType;
// this fails also
// Array.prototype.slice.call( document.documentElement.childNodes._nodes, 0 )[0].nodeType;
* We should attempt to solve the problem without editing sizzle.js. If possible, the changes should be made to the XML DOM parsing code which we have full control over. The XML DOM parsing code is no longer updated, while sizzle.js is updated on a regular basis.
The
Array.prototype.slice
check was failing because no elements, aside from the document element, are loaded into the DOM at the point when this check is made. By specifying the XML load like this:The check passes and we can now traverse elements by tag name. Apprpriate changes have been made to the DOM generation code to account for the BODY tag.
fix details here: [https://github.com/appcelerator/ZipTi/commit/42ca5d42e5341975827c2c7b1bbf95e8aaf0be4e](https://github.com/appcelerator/ZipTi/commit/42ca5d42e5341975827c2c7b1bbf95e8aaf0be4e)