Titanium JIRA Archive
Alloy (ALOY)

[ALOY-17] sizzle.js: only id selectors work

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-07-19T11:52:04.000+0000
Affected Version/s2012 Sprint 14
Fix Version/s2012 Sprint 14
ComponentsRuntime
Labelsn/a
ReporterTony Lukasavage
AssigneeTony Lukasavage
Created2012-05-16T06:43:29.000+0000
Updated2012-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.

Comments

  1. Tony Lukasavage 2012-05-16

    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:
       loadXML('<HTML><BODY></BODY></HTML>');
       
    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.
  2. Tony Lukasavage 2012-05-16

    fix details here: [https://github.com/appcelerator/ZipTi/commit/42ca5d42e5341975827c2c7b1bbf95e8aaf0be4e](https://github.com/appcelerator/ZipTi/commit/42ca5d42e5341975827c2c7b1bbf95e8aaf0be4e)

JSON Source