[Dojo-checkins] [dojo] #11457: [patch] [cla] NodeList: efficient implementation of closest()
dojo
trac at dojotoolkit.org
Mon Jul 19 05:27:22 EDT 2010
#11457: [patch] [cla] NodeList: efficient implementation of closest()
-------------------------+--------------------------------------------------
Reporter: bill | Owner: anonymous
Type: enhancement | Status: new
Priority: normal | Milestone: tbd
Component: Core | Version: 1.5
Severity: normal | Resolution:
Keywords: |
-------------------------+--------------------------------------------------
Description changed by bill:
Old description:
> Enhance Nodelist.closest() to run quickly for simple selectors, avoiding
> running dojo.query() on the whole document (for each element of
> NodeList). This is a prerequisite to implementing live() and
> delegate().
>
> The base issue is:
> - dojo._filterQueryResult() runs quickly but only handles simple
> selector, like ".foo"
> - !NodeList._filterQueryResult() can handle any query (like ".foo
> .bar") but runs slowly (worst case O(n) where n is the number of nodes in
> the document).
>
> The two functions could be combined.
>
> After fixing dojo._filterQueryResult() to handle any selector,
> NodeList.orphan() can be enhanced to handle either simple or complex
> selectors.
>
> As per
> http://thread.gmane.org/gmane.comp.web.dojo.devel/12516/focus=12559,.
New description:
Enhance !Nodelist.closest() to run quickly for simple selectors, avoiding
running dojo.query() on the whole document (for each element of
!NodeList). This is a prerequisite to implementing live() and
delegate().
The base issue is:
- dojo._filterQueryResult() runs quickly but only handles simple
selector, like ".foo"
- !NodeList._filterQueryResult() can handle any query (like ".foo .bar")
but runs slowly (worst case O(n) where n is the number of nodes in the
document).
The two functions could be combined.
After fixing dojo._filterQueryResult() to handle any selector,
!NodeList.orphan() etc. will start to work for any selectors.
As per
http://thread.gmane.org/gmane.comp.web.dojo.devel/12516/focus=12559.
--
--
Ticket URL: <http://bugs.dojotoolkit.org/ticket/11457#comment:1>
dojo <http://dojotoolkit.org/>
The Dojo UI Toolkit
More information about the Dojo-checkins
mailing list