Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
documentFragment as context?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Sahab Yazdani  
View profile  
 More options Sep 16 2009, 11:51 am
From: Sahab Yazdani <sahab.yazd...@gmail.com>
Date: Wed, 16 Sep 2009 08:51:29 -0700 (PDT)
Local: Wed, Sep 16 2009 11:51 am
Subject: documentFragment as context?
Hi All,

I am trying to use Sizzle to do matches using a documentFragment
object in IE8 (in IE7 back-compat mode). However, regardless of the
selector expression I always get an empty set. I starting looking at
the sizzle.js file to see what the matter is and right there at the
top of the file (around line 20) is this code fragment:

if ( context.nodeType !== 1 && context.nodeType !== 9 ) { return []; }

documentFragments created using document.createDocumentFragment has
nodeType 11.

Is this disallowed on purpose? Was it an oversight?

If it was on purpose, how would I go about matching on elements inside
a doc fragment?

Your help would be greatly appreciated.

Thanks in advance,
Sahab


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
John Resig  
View profile  
 More options Sep 16 2009, 11:58 am
From: John Resig <jere...@gmail.com>
Date: Wed, 16 Sep 2009 11:58:56 -0400
Local: Wed, Sep 16 2009 11:58 am
Subject: Re: documentFragment as context?

That's intentional. Browsers don't provide the very basic methods needed to
select elements within a document fragment. For example there is no
getElementsByTagName. Some of the new browsers support querySelectorAll on
fragments, but that's not guaranteed in all browsers.

--John

On Wed, Sep 16, 2009 at 11:51 AM, Sahab Yazdani <sahab.yazd...@gmail.com>wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sahab Yazdani  
View profile  
 More options Sep 16 2009, 12:05 pm
From: Sahab Yazdani <sahab.yazd...@gmail.com>
Date: Wed, 16 Sep 2009 09:05:35 -0700 (PDT)
Local: Wed, Sep 16 2009 12:05 pm
Subject: Re: documentFragment as context?
Okay, that is all I wanted to know.

Thanks for the quick response.

On Sep 16, 11:58 am, John Resig <jere...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Spocke  
View profile  
 More options Sep 18 2009, 7:22 pm
From: Spocke <spo...@moxiecode.com>
Date: Fri, 18 Sep 2009 16:22:20 -0700 (PDT)
Local: Fri, Sep 18 2009 7:22 pm
Subject: Re: documentFragment as context?
I guess the check could be rewritten to look for querySelectorAll or
getElementsByTag name and still provide the possibility to use
document fragments if you really need it. Why it's important for my
project is that we can get dramatic speed boosts if we can use sizzle
"some times" on document fragments. And document fragments on IE for
example has the getElementsByTagName since it's basically a whole
document clone.

On Sep 16, 5:58 pm, John Resig <jere...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Spocke  
View profile  
 More options Sep 22 2009, 3:34 pm
From: Spocke <spo...@moxiecode.com>
Date: Tue, 22 Sep 2009 12:34:36 -0700 (PDT)
Local: Tues, Sep 22 2009 3:34 pm
Subject: Re: documentFragment as context?
I managed to fake getElementsByTagName support for DocumentFraments so
this makes it possible to use the Sizzle engine on DocumentFragments
regardless of browser type or version.

Look at the changes here:
http://github.com/spocke/sizzle/commit/bc6ff34737ff57da18497bef301bbb...

Feel free to pull it in. The detection for querySelectorAll is in
another commit.

Regards

On Sep 16, 5:58 pm, John Resig <jere...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »