Titanium JIRA Archive
Alloy (ALOY)

[ALOY-64] Need to handle all selector types

GitHub Issuen/a
TypeSub-task
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-07-19T11:52:05.000+0000
Affected Version/s2012 Sprint 14
Fix Version/s2012 Sprint 14
ComponentsXML
Labelsn/a
ReporterTony Lukasavage
AssigneeTony Lukasavage
Created2012-05-22T13:37:46.000+0000
Updated2014-06-22T13:21:03.000+0000

Description

Currently we only support a subset of CSS selectors. We need to be able to handle child \(>\), grouping (,), siblings \(+\), and pseudo classes \(:\) as well

Update

We will likely support only ID, class, and possibly CSS attribute selectors in the first pass.

Comments

  1. Russell McMahon 2012-05-22

    I thought Sizzle handled these?
  2. Tony Lukasavage 2012-05-22

    It does, but not until we get the CSS from the generated parser's format into one that Sizzle can actually handle. We can select elements with $Ti right now with any selector, but we can't apply CSS in the same fashion yet.
  3. Tony Lukasavage 2012-05-22

    The core of the problem lies in the fact that we are specifying styles in CSS format, not JSON as they are used, which requires us to run them through the CSS generated parser before using them. The JSON output of the generated parser is not usable by itself, it needs to be converted to a form to which we can apply Sizzle before it's useful.
  4. Russell McMahon 2012-05-22

    Okay understood. For pseudo selector like lang and after:content we probably need to spec out, after:content is cool but I'm not sure appropriate for Titanium API.
  5. Tony Lukasavage 2012-05-30

    In light of our recent talks on CSS, the currently supported CSS notation is by id (#myId) or by class (#myClass). I'd also like to create a default, low priority selectors for data-ti-api types. For example:
       /* by id */
       

    myId {

    /* list of css properties */ } /* by class */ .myClass { /* list of css properties */ } /* by api type */ [data-ti-api="Label"] { -ti-color: '#fff'; }
  6. Tony Lukasavage 2012-06-27

    no longer using CSS

JSON Source