First Round of 1.3 Patches

First Round of 1.3 Patches

Hi Everyone -
I have the first round of jQuery 1.3 patches ready:
http://dev.jquery.com/~john/jquery1.3/
This is in addition to the Sizzle selector engine patch which I posted
a little bit ago (and which I'll be making an updated version of very
soon).
The patches are as follows:
append.patch: Use DocumentFragment in .domManip. This is a large
overhaul of .domManip (and moves some of the logic into jQuery.clean).
The result is that manipulation code (append/prepend/etc.) is about
15x faster. During this overhaul I made a change to how scripts are
executed. Roughly it means that scripts that are brought in as a
string and inserted are executed - but scripts that exist as DOM nodes
are not. This will solve the common problem wherein a script that
already exists in the page will be dual-executed. Let me know if this
affects your code - I suspect we'll learn more during the beta, as
well.
append-2.patch: Just in case, this is the same patch as above, but
with the old-style of functionality intact.
closest.patch: This adds a new method: .closest(selector). You can
think of it as .firstSelfOrAncestor. This has been a commonly
requested function and it will make implementing delegation code
trivial.
domready.patch: An overhaul of the ready code, removing the the "wait
for stylesheets to load" logic. I did a bunch of testing on this and
it really appears as if it's impossible to get proper stylesheet
loading detection implemented (I wanted to have a "cssready" event for
1.3, but it's not looking likely). Instead we need to back off and
simply provide normal DOM ready functionality in .ready(). This means
that we need to educate users to include their stylesheets before
their scripts in order for them to be accessible in time for DOM
ready.
multi-namespace.patch: This adds multiple-namespace support to events.
Previously you could only do it with one namespace e.g.
.bind("click.foo") or .trigger("click.foo"). The patch allows you to
use any number of namespaces e.g.
.bind("click.foo.bar").trigger("click.bar").unbind(".bar.foo").
selector.patch: Adds a new internal property that keeps track of the
selector chain.
$("div").find("span").filter(":hidden").parent().selector == "div
span.filter(:hidden).parent()". This is meant to be used by plugins
(like liveQuery), primarily. The implementation of selectors like
.parent() will be coming in a follow-up patch along with Sizzle.
strict.patch: Makes it so that we pass strict mode in Firefox 3. Only
a few minor tweaks necessary.
I have the following patches coming:
- Landing Sizzle
- Landing .parent()/.filter()/etc. selector implementation.
- Native event delegation
- Removing the remaining uses of jQuery.browser
--John