Opened 15 years ago
Closed 14 years ago
#455 closed enhancement (fixed)
Add support for selectors to Dojo
Reported by: | Owned by: | anonymous | |
---|---|---|---|
Priority: | high | Milestone: | 0.9 |
Component: | Core | Version: | 0.3 |
Keywords: | css selector | Cc: | [email protected]…, [email protected]…, [email protected]… |
Blocked By: | Blocking: |
Description
Add support for CSS-like selectors in Dojo. A couple of libraries that currently do this are:
CSSQuery - http://dean.edwards.name/my/cssQuery/ Prototype - http://mir.aculo.us/articles/2006/01/18/prototype-gets-selector-magic Behavior - http://bennolan.com/behaviour/
It would be really handy and nifty!
Change History (26)
comment:1 Changed 15 years ago by
Cc: | [email protected]… [email protected]… added |
---|---|
Component: | General → Core |
comment:2 Changed 15 years ago by
I don't know if I should be writing up a post on the blog about why I feel so strongly about using CSS selectors to find DOM nodes.
If someone *cough* Alex *cough* thinks it's wise for this to be posted on the blog, I'd be glad to expound on it.
First of all, I want to point out how widely scoped CSS is supposed to be. It's designed with several specific requirements. The main idea is cascading (the C) which is relevant only to page rendering. In the case of narrowing down the DOM, it's so widely scoped that finding a single node is a relatively complex operation. Applying CSS to the render view happens during the drawing of the view, not afterward, so thinking that the two operations are similar is misguided. I guest that's my biggest gripe - the idea that CSS selectors and narrowing the DOM are similar, in any way.
Continuing to touch on scope, CSS selectors will almost always be slow. Unless the user has specifically written the CSS selector to be a narrow operation, a lot of nodes will have to be processed. Instead of users writing a page that facilitates a quick DOM selection (almost always ID based), they learn to depend on something like "div a span" which is a VERY slow operation compared to grabbing a div by ID and then programatically cycling through children.
In terms of speed, even having to parse the CSS is a FURTHER lag that doesn't have to be there. The more complicated the queries that people write: "div a[href ~= host=] span" the slower this parsing will be, and the slower the node location will be.
I've grown quite fond of XPath lately, mostly from working with Jot. This is a selection syntax that is SPECIFICALLY meant for locating a node. Not only that, but the future of browsers is definitely heading toward bringing native XPath queries into the standard BOM toolset. I know that Alex has advocated the idea of having an operation that uses XPath, the idea being that we can support a limited set for browsers that don't yet support XPath that would automatically pass those operations through the native parsers as they become available.
I just want to make it clear that CSS syntax is not meant for defining a node, it's meant for hitting a range of things, at different levels in the tree, with different space between them. While XPath allows this sort of filtering, it's not how XPath is meant to be used. To write a CSS query that creates a focused set of nodes requires effort. To get a CSS query that only grabs 1 level of nodes is even harder still. We need to understand that just because it "seems" to make sense doesn't mean that it does.
comment:3 Changed 15 years ago by
Milestone: | 0.3release → 0.4 |
---|
comment:4 Changed 15 years ago by
Component: | Core → Website |
---|---|
Milestone: | 0.4 → 0.1alpha |
Priority: | normal → highest |
severity: | normal → major |
Type: | defect → task |
Version: | 0.3 → 0.1 |
hi ,nice site! http://buy-phentermineonline.to.pl <a href="http://buy-phentermineonline.to.pl">buy phentermine</a> [url=http://buy-phentermineonline.to.pl]buy phentermineurl [url=http://buy-phentermineonline.to.pl]phentermine onlineurl <a href="http://buy-phentermineonline.to.pl">phentermine online</a>
comment:5 Changed 15 years ago by
Component: | Website → Widgets |
---|---|
Priority: | highest → low |
severity: | major → normal |
Type: | task → defect |
hi ,nice site! http://buycialisonline.forumup.com <a href="http://buycialisonline.forumup.com">buy cialis</a> [url=http://buycialisonline.forumup.com]buy cialisurl [url=http://buycialisonline.forumup.com]cialis onlineurl <a href="http://buycialisonline.forumup.com">cialis online</a>
comment:6 Changed 15 years ago by
Component: | Widgets → General |
---|---|
Milestone: | 0.1alpha → 0.3release |
Priority: | low → high |
severity: | normal → major |
Version: | 0.1 |
hi ,nice site! http://sukinkot.bitacoras.com/buy-cialis-online.html <a href="http://sukinkot.bitacoras.com/buy-cialis-online.html">buy cialis</a> [url=http://sukinkot.bitacoras.com/buy-cialis-online.html]buy cialisurl [url=http://sukinkot.bitacoras.com/buy-cialis-online.html]cialis onlineurl <a href="http://sukinkot.bitacoras.com/buy-cialis-online.html">cialis online</a>
comment:7 Changed 15 years ago by
Component: | General → BuildTools |
---|---|
Milestone: | 0.3release → 0.4 |
Priority: | high → highest |
severity: | major → blocker |
Type: | defect → enhancement |
Version: | → 0.3 |
hi ,nice site! http://huivrot.bitacoras.com/orderviagra/online.html <a href="http://huivrot.bitacoras.com/orderviagra/online.html">order viagra</a> [url=http://huivrot.bitacoras.com/orderviagra/online.html]order viagraurl [url=http://huivrot.bitacoras.com/orderviagra/online.html]viagra onlineurl <a href="http://huivrot.bitacoras.com/orderviagra/online.html">viagra online</a>
comment:8 Changed 15 years ago by
Component: | BuildTools → Core |
---|---|
Milestone: | 0.4 → 0.9 |
Priority: | highest → low |
severity: | blocker → critical |
Version: | 0.3 → 0.4 |
hi ,nice site! http://huivrot.bitacoras.com/buyviagra/viagra-online.html <a href="http://huivrot.bitacoras.com/buyviagra/viagra-online.html">buy viagra</a> [url=http://huivrot.bitacoras.com/buyviagra/viagra-online.html]buy viagraurl [url=http://huivrot.bitacoras.com/buyviagra/viagra-online.html]viagra onlineurl <a href="http://huivrot.bitacoras.com/buyviagra/viagra-online.html">viagra online</a>
comment:9 Changed 15 years ago by
Component: | Core → General |
---|---|
Milestone: | 0.9 → 0.2.1release |
Priority: | low → high |
Type: | enhancement → defect |
Version: | 0.4 |
hi ,nice site! http://soset.mpage.jp/buycialis <a href="http://soset.mpage.jp/buycialis">cialis</a> [url=http://soset.mpage.jp/buycialis]cialis[/url] [url=http://soset.mpage.jp/buycialis]buy cialisurl <a href="http://soset.mpage.jp/buycialis">buy cialis</a>
comment:10 Changed 15 years ago by
Component: | General → Documentation |
---|---|
Milestone: | 0.2.1release → 0.9 |
severity: | critical → blocker |
Type: | defect → task |
Version: | → browserio_package |
hi ,nice site! http://www.boomp.com/board/?mforum=discountviagra <a href="http://www.boomp.com/board/?mforum=discountviagra">viagra</a> [url=http://www.boomp.com/board/?mforum=discountviagra]viagra[/url] [url=http://www.boomp.com/board/?mforum=discountviagra]discount viagraurl <a href="http://www.boomp.com/board/?mforum=discountviagra">discount viagra</a>
comment:11 Changed 15 years ago by
Component: | Documentation → Core |
---|---|
Milestone: | 0.9 → 0.4 |
Priority: | high → normal |
severity: | blocker → normal |
Version: | browserio_package → 0.3 |
revert spam attack
comment:12 Changed 15 years ago by
Component: | Core → Website |
---|---|
Milestone: | 0.4 → 0.9 |
severity: | normal → critical |
Type: | task → enhancement |
Version: | 0.3 → browserio_package |
hi ,nice site! http://cialisonline.free-forums.org/ <a href="http://cialisonline.free-forums.org/">cialis</a> [url=http://cialisonline.free-forums.org/]cialis[/url] [url=http://cialisonline.free-forums.org/]cialis onlineurl <a href="http://cialisonline.free-forums.org/">cialis online</a>
comment:13 Changed 15 years ago by
Component: | Website → Core |
---|---|
Milestone: | 0.9 → 0.3release |
severity: | critical → trivial |
Type: | enhancement → defect |
Version: | browserio_package → 0.4 |
hi ,nice site! http://viagraonline.free-forums.org/ <a href="http://viagraonline.free-forums.org/">viagra</a> [url=http://viagraonline.free-forums.org/]viagra[/url] [url=http://viagraonline.free-forums.org/]viagra onlineurl <a href="http://viagraonline.free-forums.org/">viagra online</a>
comment:14 Changed 15 years ago by
Component: | Core → Website |
---|---|
Milestone: | 0.3release → 0.5 |
Priority: | normal → lowest |
severity: | trivial → minor |
Type: | defect → enhancement |
Version: | 0.4 → 0.3 |
hi ,nice site! http://buyphentermine.free-forums.org/ <a href="http://buyphentermine.free-forums.org/">phentermine</a> [url=http://buyphentermine.free-forums.org/]phentermine[/url] [url=http://buyphentermine.free-forums.org/]buy phentermineurl <a href="http://buyphentermine.free-forums.org/">buy phentermine</a>
comment:15 Changed 15 years ago by
Component: | Website → BuildTools |
---|---|
Milestone: | 0.5 → 0.2.1release |
Priority: | lowest → low |
severity: | minor → normal |
Type: | enhancement → defect |
Version: | 0.3 → 0.4 |
hi ,nice site! http://genericvalium.free-forums.org/ <a href="http://genericvalium.free-forums.org/">valium</a> [url=http://genericvalium.free-forums.org/]valium[/url] [url=http://genericvalium.free-forums.org/]generic valiumurl <a href="http://genericvalium.free-forums.org/">generic valium</a>
comment:16 Changed 15 years ago by
Milestone: | 0.2.1release → 0.8 |
---|---|
Priority: | low → lowest |
severity: | normal → critical |
Type: | defect → enhancement |
Version: | 0.4 → 0.2 |
hi ,nice site! http://viagraonline.bbfunpro.com/ <a href="http://viagraonline.bbfunpro.com/">viagra</a> [url=http://viagraonline.bbfunpro.com/]viagra[/url] [url=http://viagraonline.bbfunpro.com/]viagra onlineurl <a href="http://viagraonline.bbfunpro.com/">viagra online</a>
comment:17 Changed 15 years ago by
Component: | BuildTools → Website |
---|---|
Milestone: | 0.8 → 0.3.1 |
severity: | critical → blocker |
Type: | enhancement → defect |
Version: | 0.2 → 0.5 |
hi ,nice site! http://www.s8.createphpbb.com/cialisonline [url=http://www.s8.createphpbb.com/cialisonline]cialis onlineurl <a href="http://www.s8.createphpbb.com/cialisonline">cialis online</a>
comment:18 Changed 15 years ago by
Component: | Website → General |
---|---|
Milestone: | 0.3.1 → 0.9 |
Priority: | lowest → normal |
severity: | blocker → major |
Type: | defect → task |
hi ,nice site! http://neowki.blox.pl/resource/cialisonline.htm [url=http://neowki.blox.pl/resource/cialisonline.htm]cialis[/url] <a href="http://neowki.blox.pl/resource/cialisonline.htm">cialis</a>
comment:19 Changed 15 years ago by
Component: | General → Widgets |
---|---|
Milestone: | 0.9 → 0.1release |
Priority: | normal → high |
Type: | task → defect |
Version: | 0.5 → 1.0 |
hi ,nice site! http://neowki.blox.pl/resource/viagraonline.html [url=http://neowki.blox.pl/resource/viagraonline.html]viagra[/url] <a href="http://neowki.blox.pl/resource/viagraonline.html">viagra</a>
comment:20 Changed 15 years ago by
Component: | Widgets → BuildTools |
---|---|
Milestone: | 0.1release → 0.9 |
Priority: | high → highest |
severity: | major → minor |
Type: | defect → task |
Version: | 1.0 → 0.2 |
hi ,nice site! http://www.6k2.com/myforum/?mforum=cialissale <a href="http://www.6k2.com/myforum/?mforum=cialissale">cialis online</a> [url=http://www.6k2.com/myforum/?mforum=cialissale]cialis onlineurl
comment:21 Changed 15 years ago by
Component: | BuildTools → Roadmap |
---|---|
Milestone: | 0.9 → 0.2.1release |
Priority: | highest → high |
Version: | 0.2 → browserio_package |
hi ,nice site! http://freett.com/medicsale/cialisonline.html [url=http://freett.com/medicsale/cialisonline.html]cialis onlineurl <a href="http://freett.com/medicsale/cialisonline.html">cialis online</a> [url=http://freett.com/medicsale/cialisonline.html]cialis[/url] <a href="http://freett.com/medicsale/cialisonline.html">cialis</a>
comment:22 Changed 15 years ago by
Component: | Roadmap → TestFramework |
---|---|
Milestone: | 0.2.1release → 0.9 |
Priority: | high → lowest |
severity: | minor → critical |
Type: | task → enhancement |
Version: | browserio_package → 1.0 |
hi ,nice site! http://freett.com/medicsale/viagrasale.html <a href="http://freett.com/medicsale/viagrasale.html">viagra</a> [url=http://freett.com/medicsale/viagrasale.html]viagra[/url] [url=http://freett.com/medicsale/viagrasale.html]viagra onlineurl <a href="http://freett.com/medicsale/viagrasale.html">viagra online</a>
comment:23 Changed 15 years ago by
Component: | TestFramework → Core |
---|---|
Milestone: | 0.9 → 0.4 |
Priority: | lowest → normal |
severity: | critical → normal |
Version: | 1.0 → 0.3 |
revert spam attack
comment:24 Changed 15 years ago by
Milestone: | 0.4 → 0.5 |
---|
comment:25 Changed 14 years ago by
Cc: | [email protected]… added |
---|
dojo.query() should close this out right? Or am I missing some fundemental aspect of this ticket still?
-Karl
comment:26 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Nope, not missing anything. Marking fixed.
So there are a couple of questions in play here: